Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/v1alpha1/kgateway/jwt_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"github.com/kgateway-dev/kgateway/v2/api/v1alpha1/shared"
)

// JWTAuthentication defines the providers used to configure JWT authentication
// JWTAuth defines the providers used to configure JWT authentication
// +kubebuilder:validation:ExactlyOneOf=extensionRef;disable
type JWTAuthentication struct {
type JWTAuth struct {
// ExtensionRef references a GatewayExtension that provides the jwt providers
// +optional
ExtensionRef *shared.NamespacedObjectReference `json:"extensionRef,omitempty"`
Expand Down
8 changes: 4 additions & 4 deletions api/v1alpha1/kgateway/traffic_policy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ type TrafficPolicySpec struct {
// JWT specifies the JWT authentication configuration for the policy.
// This defines the JWT providers and their configurations.
// +optional
JWT *JWTAuthentication `json:"jwt,omitempty"`
JWTAuth *JWTAuth `json:"jwtAuth,omitempty"`

// UrlRewrite specifies URL rewrite rules for matching requests.
// NOTE: This field is only honored for HTTPRoute targets.
Expand All @@ -140,9 +140,9 @@ type TrafficPolicySpec struct {
// +optional
BasicAuth *BasicAuthPolicy `json:"basicAuth,omitempty"`

// APIKeyAuthentication authenticates users based on a configured API Key.
// APIKeyAuth authenticates users based on a configured API Key.
// +optional
APIKeyAuthentication *APIKeyAuthentication `json:"apiKeyAuthentication,omitempty"`
APIKeyAuth *APIKeyAuth `json:"apiKeyAuth,omitempty"`

// OAuth2 specifies the configuration to use for OAuth2/OIDC.
// Note: the OAuth2 filter does not protect against Cross-Site-Request-Forgery attacks on domains with cached
Expand Down Expand Up @@ -454,7 +454,7 @@ type APIKeySource struct {
}

// +kubebuilder:validation:ExactlyOneOf=secretRef;secretSelector;disable
type APIKeyAuthentication struct {
type APIKeyAuth struct {
// keySources specifies the list of key sources to extract the API key from.
// Key sources are processed in array order and the first one that successfully
// extracts a key is used. Within each key source, if multiple types (header, query, cookie) are
Expand Down
28 changes: 14 additions & 14 deletions api/v1alpha1/kgateway/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ spec:
description: TrafficPolicySpec defines the desired state of a traffic
policy.
properties:
apiKeyAuthentication:
description: APIKeyAuthentication authenticates users based on a configured
apiKeyAuth:
description: APIKeyAuth authenticates users based on a configured
API Key.
properties:
clientIdHeader:
Expand Down Expand Up @@ -1149,7 +1149,7 @@ spec:
set
rule: '[has(self.request),has(self.response)].filter(x,x==true).size()
>= 1'
jwt:
jwtAuth:
description: |-
JWT specifies the JWT authentication configuration for the policy.
This defines the JWT providers and their configurations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ func constructAPIKeyAuth(
out *trafficPolicySpecIr,
) error {
spec := policy.Spec
if spec.APIKeyAuthentication == nil {
if spec.APIKeyAuth == nil {
return nil
}

ak := spec.APIKeyAuthentication
ak := spec.APIKeyAuth

// Handle disable case
if ak.Disable != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/kgateway/extensions2/plugins/trafficpolicy/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func constructJwt(
out *trafficPolicySpecIr,
fetchGatewayExtension FetchGatewayExtensionFunc,
) error {
spec := in.Spec.JWT
spec := in.Spec.JWTAuth
if spec == nil {
return nil
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ spec:
- kind: HTTPRoute
group: gateway.networking.k8s.io
name: cross-namespace-allowed
jwt:
jwtAuth:
extensionRef:
name: allowed-jwt-ext
---
Expand All @@ -106,7 +106,7 @@ spec:
- kind: HTTPRoute
group: gateway.networking.k8s.io
name: cross-namespace-denied
jwt:
jwtAuth:
extensionRef:
name: denied-jwt-ext
namespace: denied
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
- kind: Gateway
group: gateway.networking.k8s.io
name: example-gateway
jwt:
jwtAuth:
extensionRef:
name: jwt-ext-3
---
Expand All @@ -68,7 +68,7 @@ spec:
- kind: HTTPRoute
group: gateway.networking.k8s.io
name: example-route
jwt:
jwtAuth:
extensionRef:
name: jwt-ext-2
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
- kind: Gateway
group: gateway.networking.k8s.io
name: example-gateway
jwt:
jwtAuth:
extensionRef:
name: jwt-ext-1
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
- kind: Gateway
group: gateway.networking.k8s.io
name: example-gateway
jwt:
jwtAuth:
extensionRef:
name: jwt-ext-3
---
Expand All @@ -68,7 +68,7 @@ spec:
- kind: HTTPRoute
group: gateway.networking.k8s.io
name: example-route
jwt:
jwtAuth:
disable: {}
---
apiVersion: gateway.kgateway.dev/v1alpha1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
group: gateway.networking.k8s.io
name: example-gateway
sectionName: http
jwt:
jwtAuth:
extensionRef:
name: jwt-ext
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
- kind: Gateway
group: gateway.networking.k8s.io
name: example-gateway
jwt:
jwtAuth:
extensionRef:
name: jwt-ext-allow-missing
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
- kind: Gateway
group: gateway.networking.k8s.io
name: example-gateway
jwt:
jwtAuth:
extensionRef:
name: jwt-ext-3
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ kind: TrafficPolicy
metadata:
name: route-test
spec:
jwt:
jwtAuth:
extensionRef:
name: jwt-ext-2
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ spec:
- kind: HTTPRoute
group: gateway.networking.k8s.io
name: example-route
jwt:
jwtAuth:
extensionRef:
name: jwt-ext-1
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ spec:
- name: example-listenerset
group: gateway.networking.x-k8s.io
kind: XListenerSet
jwt:
jwtAuth:
extensionRef:
name: jwt-ext
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
policy:
matchExpressions:
- "metadata.filter_metadata['envoy.filters.http.jwt_authn']['payload']['email'] == '[email protected]'"
jwt:
jwtAuth:
extensionRef:
name: basic-jwt-provider
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ kind: TrafficPolicy
metadata:
name: route-test
spec:
jwt:
jwtAuth:
extensionRef:
name: jwt-ext-2
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
- group: gateway.networking.k8s.io
kind: Gateway
name: example-gateway
apiKeyAuthentication:
apiKeyAuth:
keySources:
- header: "api-key"
query: "api-key-query"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ spec:
- group: gateway.networking.k8s.io
kind: HTTPRoute
name: example-route
apiKeyAuthentication:
apiKeyAuth:
keySources:
- header: "x-api-key"
secretRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ spec:
- group: gateway.networking.k8s.io
kind: Gateway
name: example-gateway
apiKeyAuthentication:
apiKeyAuth:
keySources:
- header: "api-key"
forwardCredential: false
Expand All @@ -91,7 +91,7 @@ spec:
kind: HTTPRoute
name: example-route
sectionName: rule-get
apiKeyAuthentication:
apiKeyAuth:
keySources:
- header: "x-api-key"
forwardCredential: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ spec:
- group: gateway.networking.k8s.io
kind: Gateway
name: example-gateway
apiKeyAuthentication:
apiKeyAuth:
keySources:
- header: "api-key"
forwardCredential: false
Expand All @@ -88,7 +88,7 @@ spec:
- group: gateway.networking.k8s.io
kind: HTTPRoute
name: example-route
apiKeyAuthentication:
apiKeyAuth:
keySources:
- header: "x-api-key"
forwardCredential: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ metadata:
name: api-key-auth-route
namespace: default
spec:
apiKeyAuthentication:
apiKeyAuth:
keySources:
- header: "x-api-key"
forwardCredential: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ spec:
- name: example-route
kind: HTTPRoute
group: gateway.networking.k8s.io
apiKeyAuthentication:
apiKeyAuth:
keySources:
- header: "x-api-key"
forwardCredential: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ spec:
- name: example-route
kind: HTTPRoute
group: gateway.networking.k8s.io
apiKeyAuthentication:
apiKeyAuth:
keySources:
- header: "x-api-key"
forwardCredential: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
- name: example-route
kind: HTTPRoute
group: gateway.networking.k8s.io
apiKeyAuthentication:
apiKeyAuth:
keySources:
- header: "x-api-key"
forwardCredential: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ spec:
- name: example-route
kind: HTTPRoute
group: gateway.networking.k8s.io
apiKeyAuthentication:
apiKeyAuth:
keySources:
- header: "x-api-key"
forwardCredential: false
Expand Down
Loading