Skip to content

Conversation

@puertomontt
Copy link
Contributor

@puertomontt puertomontt commented Nov 20, 2025

Description

add support for remote JWKS leveraging envoy.

Change Type

/kind new_feature

Changelog

add support for remote JWKS

Additional Notes

Copilot AI review requested due to automatic review settings November 20, 2025 20:16
@gateway-bot gateway-bot added do-not-merge/description-invalid do-not-merge/kind-invalid Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/release-note-invalid Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 20, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for remote JWKS (JSON Web Key Set) in JWT authentication, allowing JWT validation keys to be fetched from a remote JWKS server instead of only supporting local inline or ConfigMap-based keys.

Key Changes:

  • Added RemoteJWKS API type with URL, backend reference, and optional cache duration
  • Extended JWT translation logic to handle remote JWKS with cluster references and HTTP timeouts
  • Added comprehensive unit tests and an end-to-end test case for remote JWKS

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
api/v1alpha1/jwt_types.go Adds RemoteJWKS struct with URL, BackendRef, and CacheDuration fields; updates JWKS to include optional RemoteJWKS
api/v1alpha1/zz_generated.deepcopy.go Auto-generated DeepCopy methods for RemoteJWKS struct
install/helm/kgateway-crds/templates/gateway.kgateway.dev_gatewayextensions.yaml Adds CRD schema for remote JWKS with validation rules for BackendRef and cacheDuration
internal/kgateway/extensions2/plugins/trafficpolicy/jwt.go Implements remote JWKS translation to Envoy RemoteJwks config with cluster resolution and timeout handling
internal/kgateway/extensions2/plugins/trafficpolicy/jwt_test.go Adds unit tests for remote JWKS translation including success and error cases
internal/kgateway/extensions2/plugins/trafficpolicy/gateway_extension.go Updates JWT provider resolution to pass backend resolver and object source for remote JWKS support
internal/kgateway/translator/gateway/gateway_translator_test.go Adds integration test case for remote JWKS functionality
internal/kgateway/translator/gateway/testutils/inputs/jwt/httproute-remote-jwks.yaml Test input with remote JWKS configuration referencing a service backend
internal/kgateway/translator/gateway/testutils/outputs/jwt/httproute-remote-jwks.yaml Expected Envoy configuration output with remote JWKS cluster reference and cache settings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gateway-bot gateway-bot added kind/feature Categorizes issue or PR as related to a new feature. release-note and removed do-not-merge/description-invalid do-not-merge/kind-invalid Indicates a PR lacks a `kind/foo` label and requires one. do-not-merge/release-note-invalid Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 20, 2025
jwtFilterNamePrefix = "jwt"
jwtConfigMapKey = "jwks"

remoteJWKSTimeoutSecs = 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see an API value for this, is this just hardcoded?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup for now

- rename policySrc to gwExtObj
- remove unneeded nil check for resolver

Signed-off-by: omar <[email protected]>
Signed-off-by: omar <[email protected]>
@puertomontt puertomontt linked an issue Nov 24, 2025 that may be closed by this pull request
Copy link
Contributor

@lgadban lgadban left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +190 to +193
message: Successfully resolved all references
reason: ResolvedRefs
status: "True"
type: ResolvedRefs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't seem correct but is likely existing behavior.
i.e. it's hard for policy to influence the ResolvedRefs condition of the route

@puertomontt puertomontt added this pull request to the merge queue Nov 24, 2025
Merged via the queue into kgateway-dev:main with commit 604c1a9 Nov 24, 2025
30 checks passed
@puertomontt puertomontt deleted the remotejwks branch November 24, 2025 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature Categorizes issue or PR as related to a new feature. release-note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support remote JWKS for envoy data plane

3 participants