Skip to content

Commit

Permalink
OIDC: add nonce support to the oauth2 filter (envoyproxy#4271)
Browse files Browse the repository at this point in the history
* add nonce support to the oidc

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>

* fix gen

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>

---------

Signed-off-by: Huabing Zhao <zhaohuabing@gmail.com>
Co-authored-by: zirain <zirain2009@gmail.com>
  • Loading branch information
zhaohuabing and zirain authored Sep 18, 2024
1 parent eff9611 commit d00737b
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/extension-server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.23.1

require (
github.com/envoyproxy/gateway v1.0.2
github.com/envoyproxy/go-control-plane v0.13.1-0.20240903155423-c0847bf34c89
github.com/envoyproxy/go-control-plane v0.13.1-0.20240917224354-20d038a70568
github.com/urfave/cli/v2 v2.27.2
google.golang.org/grpc v1.66.2
google.golang.org/protobuf v1.34.2
Expand Down
4 changes: 2 additions & 2 deletions examples/extension-server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/envoyproxy/go-control-plane v0.13.1-0.20240903155423-c0847bf34c89 h1:ZY5uB8jkNV3rhhzDI0+B9g5RISAOwazjjGqkP1sQ2HI=
github.com/envoyproxy/go-control-plane v0.13.1-0.20240903155423-c0847bf34c89/go.mod h1:X45hY0mufo6Fd0KW3rqsGvQMw58jvjymeCzBU3mWyHw=
github.com/envoyproxy/go-control-plane v0.13.1-0.20240917224354-20d038a70568 h1:bUMUmkPtm/z62/8WiVbxtqTK8I7AzXGYn+qB8JAzAXw=
github.com/envoyproxy/go-control-plane v0.13.1-0.20240917224354-20d038a70568/go.mod h1:X45hY0mufo6Fd0KW3rqsGvQMw58jvjymeCzBU3mWyHw=
github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM=
github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4=
github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv5E=
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
github.com/docker/cli v27.2.0+incompatible
github.com/dominikbraun/graph v0.23.0
github.com/envoyproxy/go-control-plane v0.13.1-0.20240903155423-c0847bf34c89
github.com/envoyproxy/go-control-plane v0.13.1-0.20240917224354-20d038a70568
github.com/envoyproxy/ratelimit v1.4.1-0.20230427142404-e2a87f41d3a7
github.com/evanphx/json-patch/v5 v5.9.0
github.com/fatih/color v1.17.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ github.com/emicklei/go-restful/v3 v3.12.1/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRr
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
github.com/envoyproxy/go-control-plane v0.13.1-0.20240903155423-c0847bf34c89 h1:ZY5uB8jkNV3rhhzDI0+B9g5RISAOwazjjGqkP1sQ2HI=
github.com/envoyproxy/go-control-plane v0.13.1-0.20240903155423-c0847bf34c89/go.mod h1:X45hY0mufo6Fd0KW3rqsGvQMw58jvjymeCzBU3mWyHw=
github.com/envoyproxy/go-control-plane v0.13.1-0.20240917224354-20d038a70568 h1:bUMUmkPtm/z62/8WiVbxtqTK8I7AzXGYn+qB8JAzAXw=
github.com/envoyproxy/go-control-plane v0.13.1-0.20240917224354-20d038a70568/go.mod h1:X45hY0mufo6Fd0KW3rqsGvQMw58jvjymeCzBU3mWyHw=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
github.com/envoyproxy/protoc-gen-validate v1.1.0 h1:tntQDh69XqOCOZsDz0lVJQez/2L6Uu2PdjCQwWCJ3bM=
github.com/envoyproxy/protoc-gen-validate v1.1.0/go.mod h1:sXRDRVmzEbkM7CVcM06s9shE/m23dg3wzjl0UWqJ2q4=
Expand Down
1 change: 1 addition & 0 deletions internal/xds/extensions/extensions.gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ import (
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/rbac/matchers/upstream_ip_port/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/regex_engines/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/request_id/uuid/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/resource_monitors/cpu_utilization/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/resource_monitors/downstream_connections/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/resource_monitors/fixed_heap/v3"
_ "github.com/envoyproxy/go-control-plane/envoy/extensions/resource_monitors/injected_resource/v3"
Expand Down
1 change: 1 addition & 0 deletions internal/xds/translator/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ func oauth2Config(oidc *ir.OIDC) (*oauth2v3.OAuth2, error) {
OauthExpires: fmt.Sprintf("OauthExpires-%s", oidc.CookieSuffix),
IdToken: fmt.Sprintf("IdToken-%s", oidc.CookieSuffix),
RefreshToken: fmt.Sprintf("RefreshToken-%s", oidc.CookieSuffix),
OauthNonce: fmt.Sprintf("OauthNonce-%s", oidc.CookieSuffix),
},
},
// every OIDC provider supports basic auth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
idToken: IdToken-5F93C2E4
oauthExpires: OauthExpires-5F93C2E4
oauthHmac: OauthHMAC-5F93C2E4
oauthNonce: OauthNonce-5F93C2E4
refreshToken: RefreshToken-5F93C2E4
hmacSecret:
name: oauth2/hmac_secret/securitypolicy/default/policy-for-gateway-2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
idToken: IdToken-5F93C2E4
oauthExpires: OauthExpires-5F93C2E4
oauthHmac: OauthHMAC-5F93C2E4
oauthNonce: OauthNonce-5F93C2E4
refreshToken: RefreshToken-5F93C2E4
hmacSecret:
name: oauth2/hmac_secret/securitypolicy/default/policy-for-first-route
Expand Down Expand Up @@ -79,6 +80,7 @@
idToken: CustomIdTokenOverride
oauthExpires: OauthExpires-5f93c2e4
oauthHmac: OauthHMAC-5f93c2e4
oauthNonce: OauthNonce-5f93c2e4
refreshToken: RefreshToken-5f93c2e4
hmacSecret:
name: oauth2/hmac_secret/securitypolicy/default/policy-for-second-route
Expand Down

0 comments on commit d00737b

Please sign in to comment.