-
Notifications
You must be signed in to change notification settings - Fork 587
fix: missing jwt provider when jwt is configured on multiple listeners sharing the same port #7337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ada2812
fix jwt provider missing when jwt is configured at multiple ir listeners
zhaohuabing 941aed8
fix lint
zhaohuabing 4029182
add release note
zhaohuabing 6d06d64
rename
zhaohuabing 336d8a0
Merge branch 'main' into fix-7295
zhaohuabing 1c9af5f
Merge remote-tracking branch 'upstream/main' into fix-7295
zhaohuabing 1180ecc
Merge branch 'main' into fix-7295
zhaohuabing 14bf957
Merge branch 'main' into fix-7295
zirain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
internal/xds/translator/testdata/in/xds-ir/jwt-from-multiple-listeners.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| # This file tests JWT configuration from multiple HTTP listeners sharing the same port won't overlap. | ||
| http: | ||
| - address: 0.0.0.0 | ||
| externalPort: 80 | ||
| hostnames: | ||
| - domain1.example.com | ||
| isHTTP2: false | ||
| metadata: | ||
| kind: Gateway | ||
| name: external-gateway | ||
| namespace: envoy-gateway-system | ||
| sectionName: domain1-example-com-http | ||
| name: envoy-gateway-system/external-gateway/domain1-example-com-http | ||
| path: | ||
| escapedSlashesAction: UnescapeAndRedirect | ||
| mergeSlashes: true | ||
| port: 10080 | ||
| routes: | ||
| - destination: | ||
| metadata: | ||
| kind: HTTPRoute | ||
| name: domain1 | ||
| namespace: ns1 | ||
| name: httproute/ns1/domain1/rule/0 | ||
| settings: | ||
| - addressType: IP | ||
| endpoints: | ||
| - host: 7.7.7.7 | ||
| port: 80 | ||
| metadata: | ||
| kind: Service | ||
| name: app1 | ||
| namespace: ns1 | ||
| sectionName: "80" | ||
| name: httproute/ns1/domain1/rule/0/backend/0 | ||
| protocol: HTTP | ||
| weight: 1 | ||
| hostname: domain1.example.com | ||
| isHTTP2: false | ||
| metadata: | ||
| kind: HTTPRoute | ||
| name: domain1 | ||
| namespace: ns1 | ||
| name: httproute/ns1/domain1/rule/0/match/0/domain1_example_com | ||
| pathMatch: | ||
| distinct: false | ||
| name: "" | ||
| prefix: / | ||
| security: | ||
| jwt: | ||
| allowMissing: true | ||
| providers: | ||
| - extractFrom: | ||
| cookies: | ||
| - AccessTokenDomain1 | ||
| issuer: https://accounts.google.com | ||
| name: jwt1 | ||
| remoteJWKS: | ||
| uri: https://www.googleapis.com/oauth2/v3/certs | ||
| - address: 0.0.0.0 | ||
| externalPort: 80 | ||
| hostnames: | ||
| - domain2.example.com | ||
| isHTTP2: false | ||
| metadata: | ||
| kind: Gateway | ||
| name: external-gateway | ||
| namespace: envoy-gateway-system | ||
| sectionName: domain2-example-com-http | ||
| name: envoy-gateway-system/external-gateway/domain2-example-com-http | ||
| path: | ||
| escapedSlashesAction: UnescapeAndRedirect | ||
| mergeSlashes: true | ||
| port: 10080 | ||
| routes: | ||
| - destination: | ||
| metadata: | ||
| kind: HTTPRoute | ||
| name: domain2 | ||
| namespace: ns2 | ||
| name: httproute/ns2/domain2/rule/0 | ||
| settings: | ||
| - addressType: IP | ||
| endpoints: | ||
| - host: 9.9.9.9 | ||
| port: 80 | ||
| metadata: | ||
| kind: Service | ||
| name: app2 | ||
| namespace: ns2 | ||
| sectionName: "80" | ||
| name: httproute/ns2/domain2/rule/0/backend/0 | ||
| protocol: HTTP | ||
| weight: 1 | ||
| hostname: domain2.example.com | ||
| isHTTP2: false | ||
| metadata: | ||
| kind: HTTPRoute | ||
| name: domain2 | ||
| namespace: ns2 | ||
| name: httproute/ns2/domain2/rule/0/match/0/domain2_example_com | ||
| pathMatch: | ||
| distinct: false | ||
| name: "" | ||
| prefix: / | ||
| security: | ||
| jwt: | ||
| allowMissing: true | ||
| providers: | ||
| - extractFrom: | ||
| cookies: | ||
| - AccessTokenDomain2 | ||
| issuer: https://accounts.google.com | ||
| name: jwt2 | ||
| remoteJWKS: | ||
| uri: https://www.googleapis.com/oauth2/v3/certs | ||
| readyListener: | ||
| address: 0.0.0.0 | ||
| ipFamily: IPv4 | ||
| path: /ready | ||
| port: 19003 |
105 changes: 105 additions & 0 deletions
105
internal/xds/translator/testdata/out/xds-ir/jwt-from-multiple-listeners.clusters.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| - circuitBreakers: | ||
| thresholds: | ||
| - maxRetries: 1024 | ||
| commonLbConfig: {} | ||
| connectTimeout: 10s | ||
| dnsLookupFamily: V4_PREFERRED | ||
| edsClusterConfig: | ||
| edsConfig: | ||
| ads: {} | ||
| resourceApiVersion: V3 | ||
| serviceName: httproute/ns1/domain1/rule/0 | ||
| ignoreHealthOnHostRemoval: true | ||
| lbPolicy: LEAST_REQUEST | ||
| loadBalancingPolicy: | ||
| policies: | ||
| - typedExtensionConfig: | ||
| name: envoy.load_balancing_policies.least_request | ||
| typedConfig: | ||
| '@type': type.googleapis.com/envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest | ||
| localityLbConfig: | ||
| localityWeightedLbConfig: {} | ||
| metadata: | ||
| filterMetadata: | ||
| envoy-gateway: | ||
| resources: | ||
| - kind: HTTPRoute | ||
| name: domain1 | ||
| namespace: ns1 | ||
| name: httproute/ns1/domain1/rule/0 | ||
| perConnectionBufferLimitBytes: 32768 | ||
| type: EDS | ||
| - circuitBreakers: | ||
| thresholds: | ||
| - maxRetries: 1024 | ||
| commonLbConfig: {} | ||
| connectTimeout: 10s | ||
| dnsLookupFamily: V4_PREFERRED | ||
| dnsRefreshRate: 30s | ||
| ignoreHealthOnHostRemoval: true | ||
| lbPolicy: LEAST_REQUEST | ||
| loadAssignment: | ||
| clusterName: www_googleapis_com_443 | ||
| endpoints: | ||
| - lbEndpoints: | ||
| - endpoint: | ||
| address: | ||
| socketAddress: | ||
| address: www.googleapis.com | ||
| portValue: 443 | ||
| loadBalancingWeight: 1 | ||
| loadBalancingWeight: 1 | ||
| locality: | ||
| region: www_googleapis_com_443/backend/-1 | ||
| loadBalancingPolicy: | ||
| policies: | ||
| - typedExtensionConfig: | ||
| name: envoy.load_balancing_policies.least_request | ||
| typedConfig: | ||
| '@type': type.googleapis.com/envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest | ||
| localityLbConfig: | ||
| localityWeightedLbConfig: {} | ||
| name: www_googleapis_com_443 | ||
| perConnectionBufferLimitBytes: 32768 | ||
| respectDnsTtl: true | ||
| transportSocket: | ||
| name: envoy.transport_sockets.tls | ||
| typedConfig: | ||
| '@type': type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.UpstreamTlsContext | ||
| commonTlsContext: | ||
| validationContext: | ||
| trustedCa: | ||
| filename: /etc/ssl/certs/ca-certificates.crt | ||
| sni: www.googleapis.com | ||
| type: STRICT_DNS | ||
| - circuitBreakers: | ||
| thresholds: | ||
| - maxRetries: 1024 | ||
| commonLbConfig: {} | ||
| connectTimeout: 10s | ||
| dnsLookupFamily: V4_PREFERRED | ||
| edsClusterConfig: | ||
| edsConfig: | ||
| ads: {} | ||
| resourceApiVersion: V3 | ||
| serviceName: httproute/ns2/domain2/rule/0 | ||
| ignoreHealthOnHostRemoval: true | ||
| lbPolicy: LEAST_REQUEST | ||
| loadBalancingPolicy: | ||
| policies: | ||
| - typedExtensionConfig: | ||
| name: envoy.load_balancing_policies.least_request | ||
| typedConfig: | ||
| '@type': type.googleapis.com/envoy.extensions.load_balancing_policies.least_request.v3.LeastRequest | ||
| localityLbConfig: | ||
| localityWeightedLbConfig: {} | ||
| metadata: | ||
| filterMetadata: | ||
| envoy-gateway: | ||
| resources: | ||
| - kind: HTTPRoute | ||
| name: domain2 | ||
| namespace: ns2 | ||
| name: httproute/ns2/domain2/rule/0 | ||
| perConnectionBufferLimitBytes: 32768 | ||
| type: EDS |
40 changes: 40 additions & 0 deletions
40
internal/xds/translator/testdata/out/xds-ir/jwt-from-multiple-listeners.endpoints.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| - clusterName: httproute/ns1/domain1/rule/0 | ||
| endpoints: | ||
| - lbEndpoints: | ||
| - endpoint: | ||
| address: | ||
| socketAddress: | ||
| address: 7.7.7.7 | ||
| portValue: 80 | ||
| loadBalancingWeight: 1 | ||
| loadBalancingWeight: 1 | ||
| locality: | ||
| region: httproute/ns1/domain1/rule/0/backend/0 | ||
| metadata: | ||
| filterMetadata: | ||
| envoy-gateway: | ||
| resources: | ||
| - kind: Service | ||
| name: app1 | ||
| namespace: ns1 | ||
| sectionName: "80" | ||
| - clusterName: httproute/ns2/domain2/rule/0 | ||
| endpoints: | ||
| - lbEndpoints: | ||
| - endpoint: | ||
| address: | ||
| socketAddress: | ||
| address: 9.9.9.9 | ||
| portValue: 80 | ||
| loadBalancingWeight: 1 | ||
| loadBalancingWeight: 1 | ||
| locality: | ||
| region: httproute/ns2/domain2/rule/0/backend/0 | ||
| metadata: | ||
| filterMetadata: | ||
| envoy-gateway: | ||
| resources: | ||
| - kind: Service | ||
| name: app2 | ||
| namespace: ns2 | ||
| sectionName: "80" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use policy name as filter name, like we do in other places ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is not changed in this PR - we use the original filter name when only one instance is needed in the HCM.