Commit Graph

414 Commits

Author SHA1 Message Date
Patrick Jones 1aa066dc21 google: resolve merge conflict from dummy commit changes
Change-Id: I0f775143be9f66e80b3a0bc0ecf92952f41a8cd1
2020-12-02 15:43:11 -08:00
Patrick Jones 3178b87fa5 google: dummy commit to trigger Trybot after rebasing
Change-Id: Iefbf394e5aa3bc69b5a82ec861b1b4a2b21c941a
2020-12-02 15:40:09 -08:00
Patrick Jones a17de82d3e google: fix spelling and go fmt
Change-Id: Ifc55814018bf66d2e77752d770a51c716376cabc
2020-12-02 15:37:03 -08:00
Patrick Jones aa7010ab25 google: clean up tests and add godoc comments
Change-Id: I54d2702a149d1eccd64f8ef2ed4b4617429c9358
2020-12-02 15:37:03 -08:00
Patrick Jones b1b1e51616 google: add test to ensure optional field works as intended.
Change-Id: I00cb6cf668073883c96ac0144847fa2693414044
2020-12-02 15:37:03 -08:00
Patrick Jones 97d4314441 google: remove remaining cmp.Diff call
Change-Id: I189302ad4f49a206dd298b767a827b0263df8c43
2020-12-02 15:37:02 -08:00
Patrick Jones ccc73e0caf google: change json decoding layout
Change-Id: Idc322fc66cb93e5d61f0c41d5847a2567a5e1019
2020-12-02 15:37:02 -08:00
Patrick Jones 57d1f928e5 google: update error return format.
Change-Id: Id2cd28484e3724eee98757c2f40cbb237dee2c75
2020-12-02 15:37:02 -08:00
Patrick Jones 5908a54aa5 google: update formatting and code structure
Change-Id: I9c45c7848de4ab2e3a685f761c85b1c9405b6eb1
2020-12-02 15:37:02 -08:00
Patrick Jones 801e5611ae google: fix more nits and return early in one error case.
Change-Id: Idafbe36f4add6998e57878fec84a1080ac962511
2020-12-02 15:37:02 -08:00
Patrick Jones 01ea6373cb google: fix error formatting, add ctx argument
Change-Id: If664a760005cc209c7398f2efce5ff324ebc4746
2020-12-02 15:37:02 -08:00
Patrick Jones 5688b03dbc google: add ExchangeToken unit tests 2020-12-02 15:37:02 -08:00
Patrick Jones 520fe129d2 Fixed import issues and test validity. 2020-12-02 15:37:02 -08:00
Patrick Jones cde1045936 Fixed directory structure. 2020-12-02 15:37:02 -08:00
Patrick Jones da03451c43 Fixed file names. 2020-12-02 15:37:02 -08:00
Patrick Jones 3231799286 Go fmt 2020-12-02 15:37:02 -08:00
Patrick Jones 9f31b34f87 Add testing for ExchangeToken() 2020-12-02 15:37:02 -08:00
Patrick Jones f5cea3e01e temp 2020-12-02 15:37:02 -08:00
Patrick Jones 2522fa4915 Tweaked some internal notes 2020-12-02 15:37:02 -08:00
Patrick Jones 358bcd3d11 Draft showing WIP testing approach. 2020-12-02 15:37:02 -08:00
gIthuriel 532f2dec32
Merge pull request #1 from golang/master
google: add utilities supporting upcoming oauth2 functionality
2020-12-02 15:30:29 -08:00
Patrick Jones c53b048849 google: fix spelling and go fmt
Change-Id: Ifc55814018bf66d2e77752d770a51c716376cabc
2020-11-18 11:03:03 -08:00
Patrick Jones 9432311ec2 google: clean up tests and add godoc comments
Change-Id: I54d2702a149d1eccd64f8ef2ed4b4617429c9358
2020-11-17 16:40:37 -08:00
Patrick Jones 098ad88d02 google: add test to ensure optional field works as intended.
Change-Id: I00cb6cf668073883c96ac0144847fa2693414044
2020-11-16 16:25:35 -08:00
Patrick Jones 0dc8cd7820 google: remove remaining cmp.Diff call
Change-Id: I189302ad4f49a206dd298b767a827b0263df8c43
2020-11-12 14:21:10 -08:00
Patrick Jones 929f793807 google: change json decoding layout
Change-Id: Idc322fc66cb93e5d61f0c41d5847a2567a5e1019
2020-11-12 11:43:19 -08:00
Patrick Jones 87e4e25ded google: update error return format.
Change-Id: Id2cd28484e3724eee98757c2f40cbb237dee2c75
2020-11-10 13:12:37 -08:00
Patrick Jones 74f89b5575 google: update formatting and code structure
Change-Id: I9c45c7848de4ab2e3a685f761c85b1c9405b6eb1
2020-11-10 11:59:17 -08:00
Patrick Jones 9fd604954f google: add utilities supporting upcoming oauth2 functionality
These are used to support some extended utilities to help with STS requests.

Change-Id: Iafc145b06ca42374cfc2ac6572762a50bcf560f2
GitHub-Last-Rev: 3085fe5703
GitHub-Pull-Request: golang/oauth2#439
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/259777
Trust: Cody Oss <codyoss@google.com>
Run-TryBot: Cody Oss <codyoss@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Tyler Bui-Palsulich <tbp@google.com>
2020-11-09 20:14:03 +00:00
Patrick Jones 4bcf502a22 google: fix more nits and return early in one error case.
Change-Id: Idafbe36f4add6998e57878fec84a1080ac962511
2020-11-03 15:37:42 -08:00
Patrick Jones 717b310560 google: fix error formatting, add ctx argument
Change-Id: If664a760005cc209c7398f2efce5ff324ebc4746
2020-11-03 13:44:17 -08:00
Patrick Jones ed1c7b8858 google: add ExchangeToken unit tests 2020-10-29 12:28:45 -07:00
Patrick Jones 13049afc57 Fixed import issues and test validity. 2020-10-19 15:17:49 -07:00
Patrick Jones c19137f314 Fixed directory structure. 2020-10-19 14:53:45 -07:00
Patrick Jones ddbe2ba342 Fixed file names. 2020-10-19 14:49:46 -07:00
Patrick Jones 7f24b845a5 Go fmt 2020-10-19 14:39:14 -07:00
Patrick Jones b838bbaf4d Add testing for ExchangeToken() 2020-10-19 14:35:44 -07:00
Patrick Jones 58b935b4ea temp 2020-10-19 13:43:51 -07:00
Patrick Jones 8ea360249f Tweaked some internal notes 2020-10-13 12:05:31 -07:00
Patrick Jones 9ed4d33b3a Draft showing WIP testing approach. 2020-10-13 12:02:46 -07:00
Emmanuel T Odeke 5d25da1a8d go.mod: update stale dependencies
Invokes go get -u -v ./... to try to get rid of
stale dependencies cloud.google.com/go@v0.34.0 (released in December 2018)
and that dependency unfortunately imported a stale
version of go.opencensus.io that then transitively
imports another that has a vulnerability.

Change-Id: I0a520e8f979ff3ddcd6197b234cdc0f4154bb735
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/245517
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-09-02 21:34:28 +00:00
Brad Fitzpatrick bf48bf16ab README, endpoints: fix a typo, update README to point people at endpoints
Change-Id: Ic49fabc47eebb932a1a56f1dd3e65dc3af539d59
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/213637
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2020-01-07 19:09:31 +00:00
Mark Wolfe eca82077e2 endpoints: add new package for oauth2.Endpoint values
As per discussion in #401 and gerrit I have built out the proposed endpoint package.

I migrated all the existing endpoints, not sure if you wanted this but it does illustrate the pattern.

Change-Id: I53f56a06207633b2380b7cd7332cd56f9ef6578f
GitHub-Last-Rev: fde9e7bb75
GitHub-Pull-Request: golang/oauth2#402
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/212223
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2020-01-07 16:08:58 +00:00
Tim Cooper 858c2ad4c8 oauth2: turn Transport.CancelRequest into a no-op
Request cancellation should be done via http.Request.Context.

Fixes #271

Change-Id: Ia6251898e55bd15b27968504fc6efe14f05b1def
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/121438
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2019-12-02 22:59:59 +00:00
Shaun Dunning 5d9234df09 jira: update jira JWT subject per Atlassian's recent GDPR changes
Recently, Atlassian decided to remove `userKey` from JWT construction b/c they determined that it could contain personally identifiable information. They've since switched to the user account ID. This change updates the jira JWT to reflect these recent change.

Fixes golang/oauth2#312

Change-Id: I4bd66cf925fdf38e02dd665befb5ab5f19f14ee7
GitHub-Last-Rev: 344bb6046c
GitHub-Pull-Request: golang/oauth2#389
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/185081
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-11-22 20:06:57 +00:00
Chris Broadfoot 0f29369cfe google: add some metadata to GCE tokens to identify the token's source
This is required for the direct path feature, which only works with this
token source. It's not currently possible to determine the token source
type from the return value of FindDefaultCredentials.

Another option is to add another field to the Credentials struct, which
we could still do later, but direct path is currently pretty experimental
and whitelisted/opt-in, so I don't want to add to the public API surface
unnecessarily.

This CL functionally blocks
https://code-review.googlesource.com/c/google-api-go-client/+/40950

Change-Id: Ifb5fe9c6e5c6b33eebb87b45d3c70eebfca691b3
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/175877
Reviewed-by: Chris Broadfoot <cbro@golang.org>
2019-06-04 05:34:49 +00:00
Bobby DeSimone aaccbc9213 google: update ApprovalForce to use openid connect friendly prompt=consent
It looks like in 2016 or so` approval_prompt=force` was replaced with the open id connect friendly `prompt=consent`.

See:
- https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
- https://developers.google.com/identity/sign-in/web/reference#gapiauth2offlineaccessoptions
- https://github.com/googleapis/oauth2client/issues/453
- https://github.com/pomerium/pomerium/pull/82

Change-Id: Iad2d533f451a70b2941aafd11c9b7272026a2f16
GitHub-Last-Rev: d6d10ceec8
GitHub-Pull-Request: golang/oauth2#379
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/171123
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-05-23 18:27:46 +00:00
Wenlei (Frank) He 950ef44c6e jwt: support PrivateClaims in Config
This would help add extra claim for certain 2-leg JWT exchange.

For example, Google service account key can be used to generate an OIDC token, but Google TokenURL requires "target_audience" claims set.

See this example usage:
https://gist.github.com/wlhee/64bc518190053e2122ca1909c2977c67#file-exmaple-go-L29

Change-Id: Ic10b006e45a34210634c5a76261a7e3706066965
GitHub-Last-Rev: 7a6e247e68
GitHub-Pull-Request: golang/oauth2#374
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/166220
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-05-17 18:12:55 +00:00
Steven Buss 9f3314589c google: Support scopes for ComputeTokenSource
Scopes have been added as a query parameter to the metadata server.

Change-Id: Ife68db01beeca386e558edd424fa11da508b7287
GitHub-Last-Rev: 1cb4a6ec12
GitHub-Pull-Request: golang/oauth2#376
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/170106
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-02 18:19:05 +00:00
Ggicci c85d3e98c9 internal: remove fallback parsing for expires_in
Facebook has correctted its OAuth2 implementation. The code as
a fallback can be removed now.

Updates golang/oauth2#51, golang/oauth2#239

Change-Id: Ib5f84bc35c0c4ecbdd25d4169f950410d4ae79a2
Reviewed-on: https://go-review.googlesource.com/c/oauth2/+/168017
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: JBD <jbd@google.com>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-03-19 18:23:50 +00:00