Patrick Jones
2149795f02
Removed tokenconsumer example file; will add the examples elsewhere.
2021-08-09 13:33:14 -07:00
Patrick Jones
c56d6183bb
Removed extraneous newline.
2021-08-05 10:44:14 -07:00
Patrick Jones
6338e2b5bb
Merge branch 'master' into downscope-example-additions
2021-08-05 10:32:17 -07:00
Patrick Jones
387bb65d12
Merge branch 'golang:master' into master
2021-08-05 10:31:36 -07:00
Patrick Jones
b74b0944f5
more nits
2021-08-05 10:27:23 -07:00
Patrick Jones
6f1e639406
google/downscope: update documentation
...
Change-Id: Ib4dfc7b554c1e7565cc61bc372a98ddd390e7453
GitHub-Last-Rev: 63894e5681
GitHub-Pull-Request: golang/oauth2#512
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/338389
Reviewed-by: Cody Oss <codyoss@google.com >
Reviewed-by: Chris Broadfoot <cbro@golang.org >
Trust: Cody Oss <codyoss@google.com >
Trust: Chris Broadfoot <cbro@golang.org >
Run-TryBot: Cody Oss <codyoss@google.com >
Run-TryBot: Chris Broadfoot <cbro@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
2021-08-05 13:40:26 +00:00
Patrick Jones
63894e5681
Update example_test.go
2021-08-04 14:43:05 -07:00
Patrick Jones
db8a13916c
downscope: update examples
2021-08-04 14:38:56 -07:00
Patrick Jones
e1c4f01528
downscope: add new examples and update existing ones.
2021-08-02 11:39:22 -07:00
Patrick Jones
e4caaa9222
Merge branch 'master' of github.com:Galadros/oauth2
2021-07-31 00:53:20 -07:00
Patrick Jones
0bd54f5919
downscope: documentation tweaks
2021-07-31 00:29:48 -07:00
Patrick Jones
3045b9f9df
Merge branch 'master' into master
2021-07-29 15:02:43 -07:00
Patrick Jones
e4ec8cdba1
Removed some code that's not yet finished
2021-07-29 14:44:16 -07:00
Patrick Jones
d921d8f367
Merge pull request #1 from Galadros/downscopeDocumentation
...
Merging with master to fix some PR oddities for downscoping documentation
2021-07-29 14:35:33 -07:00
Patrick Jones
c9764790d5
downscope: update documentation
2021-07-29 13:38:18 -07:00
Patrick Jones
a41e5a7819
downscope: implement support for token downscoping
...
Implements support for token downscoping to allow for the creation of tokens with restricted permissions
Change-Id: I52459bdb0dfdd5e8d86e6043ba0362f4bf4b823c
GitHub-Last-Rev: 941cf10a8e
GitHub-Pull-Request: golang/oauth2#502
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/326529
Reviewed-by: Chris Broadfoot <cbro@golang.org >
Run-TryBot: Chris Broadfoot <cbro@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Trust: Tyler Bui-Palsulich <tbp@google.com >
Trust: Cody Oss <codyoss@google.com >
2021-06-28 18:02:05 +00:00
Patrick Jones
941cf10a8e
downscope: move validation checks
2021-06-24 16:24:14 -07:00
Patrick Jones
fec7137f21
downscope: fix some nits
2021-06-24 11:42:43 -07:00
Patrick Jones
1888dba9b1
downscope: change return type of NewTokenSource
2021-06-23 10:17:59 -07:00
gIthuriel
a8dc77f794
google: add external account documentation
...
Adds some documentation to existing public structures for third-party authentication.
Change-Id: I756f5cd5619fbd752c028e99176991139fd45c60
GitHub-Last-Rev: c846ea6748
GitHub-Pull-Request: golang/oauth2#485
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/301610
Trust: Cody Oss <codyoss@google.com >
Trust: Tyler Bui-Palsulich <tbp@google.com >
Reviewed-by: Cody Oss <codyoss@google.com >
2021-06-22 21:54:36 +00:00
Patrick Jones
1024258a24
downscope: refactor some code to remove an extraneous function and instead run that code inside of Token()
2021-06-22 13:14:47 -07:00
Eno Compton
bce0382f6c
google: fix syntax error
...
Change-Id: I18dd98234a87dca59a199d90a5d0b9cedd80e5af
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/330189
Reviewed-by: Cody Oss <codyoss@google.com >
Trust: Cody Oss <codyoss@google.com >
Trust: Tyler Bui-Palsulich <tbp@google.com >
Run-TryBot: Cody Oss <codyoss@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-06-22 19:05:53 +00:00
gIthuriel
14747e66f6
google: check additional AWS variable
...
AWS_DEFAULT_REGION should have been checked as a backup to AWS_REGION but wasn't. Also removed a redundant print statement in a test case.
Change-Id: Ia6e13eb20f509110a81e3071228283c43a1e9283
GitHub-Last-Rev: 1a10bcc079
GitHub-Pull-Request: golang/oauth2#486
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/302789
Reviewed-by: Cody Oss <codyoss@google.com >
Trust: Cody Oss <codyoss@google.com >
Trust: Tyler Bui-Palsulich <tbp@google.com >
2021-06-22 16:52:04 +00:00
Patrick Jones
304d28ba9e
downscope: further updates and nits
2021-06-22 09:25:17 -07:00
Patrick Jones
a362f28044
downscope: fix grammar and punctuation.
2021-06-17 15:11:54 -07:00
Patrick Jones
1d9ea0c8e4
downscope: refactor main functionality into a method on a tokenSource, update examples accordingly, and test for maximum boundary rule violations
2021-06-17 14:58:26 -07:00
Patrick Jones
cbbc506128
downscope: fixing nits and renaming
2021-06-17 11:06:20 -07:00
Patrick Jones
b594a6032e
downscope: minor tweaks
2021-06-16 12:14:24 -07:00
Shin Fan
d04028783c
google: support scopes for JWT access token
...
Change-Id: I11acd87a56cd003fdb68a5a687e37df450c400d1
GitHub-Last-Rev: efb2e8a08a
GitHub-Pull-Request: golang/oauth2#504
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/327929
Trust: Shin Fan <shinfan@google.com >
Trust: Cody Oss <codyoss@google.com >
Run-TryBot: Shin Fan <shinfan@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Cody Oss <codyoss@google.com >
2021-06-15 19:07:21 +00:00
Patrick Jones
776a9ed8a3
downscope: move example files to a separate file & package
2021-06-14 13:51:56 -07:00
Patrick Jones
c4c64d51bc
downscope: add some context to returned error
2021-06-14 10:55:04 -07:00
Patrick Jones
be467eec8b
downscope: update comment formatting
2021-06-11 11:43:37 -07:00
Patrick Jones
69736ff94b
downscope: make changes related to comments, including adding another example and touching up comment formatting.
2021-06-11 11:40:45 -07:00
Patrick Jones
e035bf9673
go fmt
2021-06-10 14:55:56 -07:00
Patrick Jones
add9801363
Add exmaple showing how NewTokenSource should be called.
2021-06-10 14:55:41 -07:00
Patrick Jones
eb57311a00
Add some validity testing for AccessBoundaryRules and add documentation.
2021-06-10 14:11:50 -07:00
Patrick Jones
52684dc091
First set of comment changes.
2021-06-09 14:25:06 -07:00
Patrick Jones
a8e26b9ca4
oauth2/google: implement support for token downscoping to allow for restricted permissions
2021-06-09 10:46:53 -07:00
akay
f6687ab280
endpoints: add Battlenet endpoints
...
OAuth APIs: https://develop.battle.net/documentation/battle-net/oauth-apis
Change-Id: I7c10f68c6ef0cb9b77cffa104e71a7198a599c89
GitHub-Last-Rev: e9596432c8
GitHub-Pull-Request: golang/oauth2#489
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/310249
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
Trust: Brad Fitzpatrick <bradfitz@golang.org >
Trust: Heschi Kreinick <heschi@google.com >
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
2021-05-14 16:43:44 +00:00
Mattias Appelgren
9963728281
endpoints: Add Strava endpoint
...
As per the Strava API auth docs: http://developers.strava.com/docs/authentication/
Change-Id: Ibf6fcca193a1b63bf86830b669849653774a9df9
GitHub-Last-Rev: 296e91e1f2
GitHub-Pull-Request: golang/oauth2#473
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/289829
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
Trust: Brad Fitzpatrick <bradfitz@golang.org >
Trust: Heschi Kreinick <heschi@google.com >
2021-05-14 16:43:25 +00:00
Andy Zhao
81ed05c6b5
google: Add support for CredentialsParams, Client ID json, and JWT Subject
...
*Add support for Google Developers Console client_credentials.json as a TokenSource.
*Add support for JWT Subject (for domain-wide delegation when using service account as credentials source.)
*Add support for non-default AuthURL and TokenURL for authorized user credentials source.
To support this change, two new exported functions FindDefaultCredentialsWithParams and CredentialsFromJSONWithParams are introduced.
Change-Id: Ib467822e2c14e02f8ae68586665c439960cfbd5c
GitHub-Last-Rev: eb92ab4a21
GitHub-Pull-Request: golang/oauth2#490
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/311589
Reviewed-by: Shin Fan <shinfan@google.com >
Reviewed-by: Cody Oss <codyoss@google.com >
Trust: Shin Fan <shinfan@google.com >
Trust: Cody Oss <codyoss@google.com >
2021-04-27 18:04:40 +00:00
Andy Zhao
5e61552d6c
authhandler: Remove example_test.go
...
The example test implementation uses stdin, which does not work in all environments:
https://github.com/golang/go/issues/45523
Removing for now to unblock release.
Change-Id: I49bafa9fe1d973b7c1d7ce00f51f110f9aa4a5a6
GitHub-Last-Rev: baf46329c2
GitHub-Pull-Request: golang/oauth2#488
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/309469
Reviewed-by: Bryan C. Mills <bcmills@google.com >
Run-TryBot: Bryan C. Mills <bcmills@google.com >
Trust: Cody Oss <codyoss@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-04-13 13:46:43 +00:00
Joel Ferrier
2e8d934016
google: Use bytes.Buffer for go 1.9 compatability
...
Update test cases to use const test data file references.
Change-Id: Ic08b6de5a84db7b2ae2c649ee676c5a2c13f4227
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/306749
Reviewed-by: Cody Oss <codyoss@google.com >
Trust: Cody Oss <codyoss@google.com >
Trust: Tyler Bui-Palsulich <tbp@google.com >
Run-TryBot: Cody Oss <codyoss@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-04-02 16:14:24 +00:00
Andy Zhao
22b0adad75
authhandler: Add support for 3-legged-OAuth
...
Added authhandler.go, which implements a TokenSource to support "three-legged OAuth 2.0" via a custom AuthorizationHandler.
Added example_test.go with a sample command line implementation for AuthorizationHandler.
This patch adds support for 3-legged-OAuth flow using an OAuth Client ID file downloaded from Google Cloud Console.
Change-Id: Iefe54494d6f3ee326a6b1b2a81a7d5d1a7ba3331
GitHub-Last-Rev: 48fc0367c2
GitHub-Pull-Request: golang/oauth2#419
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/232238
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com >
Reviewed-by: Shin Fan <shinfan@google.com >
Reviewed-by: Cody Oss <codyoss@google.com >
Trust: Shin Fan <shinfan@google.com >
Trust: Cody Oss <codyoss@google.com >
2021-03-23 18:09:02 +00:00
Shaba Abhiram
cd4f82c27b
endpoints: add Zoom endpoint
...
See #424
Change-Id: I1fa6230082261f60a8e41387ad2bf481df0a1fce
GitHub-Last-Rev: 6fba3dd9d1
GitHub-Pull-Request: golang/oauth2#453
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/271826
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org >
Trust: Brad Fitzpatrick <bradfitz@golang.org >
Trust: Tobias Klauser <tobias.klauser@gmail.com >
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
2021-03-13 18:22:46 +00:00
Ryan Kohler
5366d9dc19
google: Make sure time is always in UTC
...
If times are stored in different time zones, then we occasionally get heisenbugs about expired tokens
Change-Id: I0c117977688d8d6c7b12b211092e5040a41a1f46
GitHub-Last-Rev: 3ff51b34f5
GitHub-Pull-Request: golang/oauth2#482
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/300929
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com >
Trust: Tyler Bui-Palsulich <tbp@google.com >
Trust: Cody Oss <codyoss@google.com >
Run-TryBot: Tyler Bui-Palsulich <tbp@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-03-11 16:31:35 +00:00
Russ Cox
9bb904979d
all: go fmt ./...
...
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).
Not strictly necessary but will avoid spurious changes
as files are edited.
Part of //go:build change (#41184 ).
See https://golang.org/design/draft-gobuild
Change-Id: I22803ea9e936fbb08984a64155302f47e181de27
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/294420
Trust: Russ Cox <rsc@golang.org >
Trust: Cody Oss <codyoss@google.com >
Run-TryBot: Russ Cox <rsc@golang.org >
TryBot-Result: Go Bot <gobot@golang.org >
Reviewed-by: Cody Oss <codyoss@google.com >
2021-02-20 00:06:19 +00:00
Ryan Kohler
ba52d332ba
google: unexport private structs and funcs
...
These structs and funcs cannot be used by the end consumer. Unexporting them helps cleans up our documentation
Change-Id: I2eadb69e87de912ac39f53e83cd9bdfe76a15e3e
GitHub-Last-Rev: 60b58eef75
GitHub-Pull-Request: golang/oauth2#479
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/293752
Reviewed-by: Cody Oss <codyoss@google.com >
Trust: Cody Oss <codyoss@google.com >
Trust: Tyler Bui-Palsulich <tbp@google.com >
Run-TryBot: Cody Oss <codyoss@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-02-18 20:24:05 +00:00
Bassam Ojeil
f145937023
google: update documentation for workload identity federation
...
Document using workload identity federation from non-Google Cloud platforms to access Google Cloud resources.
This covers federation from AWS, Azure and OIDC providers via Application Default Credentials.
Change-Id: I77ee7f6aac5a75d095304f07f3004ec3fb7b9613
GitHub-Last-Rev: 07c9dd0271
GitHub-Pull-Request: golang/oauth2#478
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/293751
Reviewed-by: Cody Oss <codyoss@google.com >
Trust: Cody Oss <codyoss@google.com >
Trust: Tyler Bui-Palsulich <tbp@google.com >
Run-TryBot: Cody Oss <codyoss@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-02-18 20:13:42 +00:00
Patrick Jones
16ff1888fd
google: manual testing fixes
...
I found some errors while manually testing service account impersonation on Azure. This PR includes the fixes that I made.
Change-Id: Ia2b194be6c9a7c843e615f9789c8f8203bcbc151
GitHub-Last-Rev: 5690716363
GitHub-Pull-Request: golang/oauth2#475
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/291209
Reviewed-by: Cody Oss <codyoss@google.com >
Trust: Cody Oss <codyoss@google.com >
Trust: Tyler Bui-Palsulich <tbp@google.com >
Run-TryBot: Cody Oss <codyoss@google.com >
TryBot-Result: Go Bot <gobot@golang.org >
2021-02-16 19:45:17 +00:00