-
Notifications
You must be signed in to change notification settings - Fork 532
Basic jwt with GatewayExtension #11445
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
Open
npolshakova
wants to merge
8
commits into
kgateway-dev:main
Choose a base branch
from
npolshakova:basic-jwt-gw-extension
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
387a952
to
b84e961
Compare
Closed
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.
Pull Request Overview
This PR adds JWT authentication support by extending TrafficPolicy and GatewayExtension APIs and CRDs, along with necessary codegen updates.
- Introduce a
jwt
field onTrafficPolicySpec
with CRD schema and API types - Add a
jwtProviders
map toGatewayExtensionSpec
and corresponding CRD validation - Generate deep‐copy, applyconfiguration, OSS compliance, and go.mod updates for new JWT types
Reviewed Changes
Copilot reviewed 20 out of 35 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
install/helm/kgateway-crds/templates/gateway.kgateway.dev_trafficpolicies.yaml | Add jwt object schema to TrafficPolicy CRD |
install/helm/kgateway-crds/templates/gateway.kgateway.dev_gatewayextensions.yaml | Add jwtProviders schema and validation to GatewayExtension CRD |
hack/utils/oss_compliance/osa_provided.md | Include go-jose/v3 in provided OSS compliance |
hack/utils/oss_compliance/osa_included.md | Add hashicorp/go-multierror to included OSS list |
go.mod | Move go-jose/v3 and go-multierror to direct deps |
api/v1alpha1/zz_generated.deepcopy.go | Generate DeepCopy methods for JWT types |
api/v1alpha1/traffic_policy_types.go | Add JWT *JWTValidation to TrafficPolicySpec |
api/v1alpha1/jwt.go | Define JWTValidation , JWTProvider , and related types |
api/v1alpha1/gateway_extensions_types.go | Add JWTProviders to GatewayExtensionSpec |
api/applyconfiguration/utils.go | Register new JWT types in applyconfiguration utils |
api/applyconfiguration/internal/internal.go | Add JWT types to internal schema YAML |
api/applyconfiguration/api/v1alpha1/trafficpolicyspec.go | Add WithJWT builder for TrafficPolicySpec |
api/applyconfiguration/api/v1alpha1/* | Generated applyconfiguration types for JWT and related structs |
Comments suppressed due to low confidence (2)
api/v1alpha1/jwt.go:46
- Update this comment to reference the enum values (
Forward
/Remove
) rather thanfalse
, e.g., "if set toRemove
, the header containing the token will be removed".
// KeepToken configures if the token forwarded upstream. if false, the header containing the token will be removed.
go.mod:266
- [nitpick] This module appears only as an indirect dependency in this PR; consider restoring the
// indirect
comment or removing the direct requirement if it’s not used directly in the code.
github.com/go-jose/go-jose/v3 v3.0.3
install/helm/kgateway-crds/templates/gateway.kgateway.dev_gatewayextensions.yaml
Outdated
Show resolved
Hide resolved
b84e961
to
b756fa8
Compare
jenshu
reviewed
Jun 23, 2025
jenshu
reviewed
Jun 23, 2025
davidjumani
reviewed
Jun 26, 2025
5b236ba
to
cdced23
Compare
Signed-off-by: npolshakova <[email protected]>
Signed-off-by: npolshakova <[email protected]>
Signed-off-by: npolshakova <[email protected]> feedback Signed-off-by: npolshakova <[email protected]>
Signed-off-by: npolshakova <[email protected]>
Signed-off-by: npolshakova <[email protected]>
Signed-off-by: npolshakova <[email protected]> fix test names Signed-off-by: npolshakova <[email protected]> fix name Signed-off-by: npolshakova <[email protected]>
42cafb9
to
fa3c0ef
Compare
Signed-off-by: npolshakova <[email protected]> typo Signed-off-by: npolshakova <[email protected]> typo Signed-off-by: npolshakova <[email protected]>
fa3c0ef
to
b8ca1e5
Compare
Signed-off-by: npolshakova <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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.
Description
Define a basic JWT policy to support configuration of Envoy-based proxies and agentgateway. #11192
Motivation:
We would like to add support for JWT in kgateway for configuring both the upstream
Envoy JWT Authentication filter
and configuring agentgateway JWT authentication.
What changed:
Change Type
Changelog
Additional Notes
See the Enhancement Proposal: #11194
Test locally:
./hack/kind/setup-kind.sh
Works on non-jwt path:
Works with token:
Invalid (Jwt is not in the form of Header.Payload.Signature)
Invalid (missing):
Invalid (fails verification)