@@ -155,13 +155,13 @@ type BasicAuth struct {
155155 OnFailure *AuthFailureResponse ` json:"onFailure,omitempty"`
156156}
157157
158- // JWTKeyMode selects where JWT keys come from.
158+ // KeyMode selects where JWT keys come from.
159159// +kubebuilder:validation:Enum=File;Remote
160- type JWTKeyMode string
160+ type KeyMode string
161161
162162const (
163- JWTKeyModeFile JWTKeyMode = " File"
164- JWTKeyModeRemote JWTKeyMode = " Remote"
163+ KeyModeFile KeyMode = " File"
164+ KeyModeRemote KeyMode = " Remote"
165165)
166166
167167// JWTAuth configures JWT-based authentication (NGINX Plus).
@@ -179,19 +179,19 @@ type JWTAuth struct {
179179 Realm *string ` json:"realm,omitempty"`
180180
181181 // Mode selects how JWT keys are provided: local file or remote JWKS.
182- Mode JWTKeyMode ` json:"mode,omitempty"`
182+ Mode KeyMode ` json:"mode,omitempty"`
183183
184184 // File specifies local JWKS configuration.
185185 // Required when Mode == File.
186186 //
187187 // +optional
188- File *JWTFileKeySource ` json:"file,omitempty"`
188+ File *FileKeySource ` json:"file,omitempty"`
189189
190190 // Remote specifies remote JWKS configuration.
191191 // Required when Mode == Remote.
192192 //
193193 // +optional
194- Remote *JWTRemoteKeySource ` json:"remote,omitempty"`
194+ Remote *RemoteKeySource ` json:"remote,omitempty"`
195195
196196 // Leeway is the acceptable clock skew for exp/nbf checks.
197197 // Configures `auth_jwt_leeway` directive.
@@ -210,7 +210,7 @@ type JWTAuth struct {
210210 //
211211 // +optional
212212 // +kubebuilder:default=signed
213- Type *JWTTokenType ` json:"type,omitempty"`
213+ Type *TokenType ` json:"type,omitempty"`
214214
215215 // KeyCache is the cache duration for keys.
216216 // Configures auth_jwt_key_cache directive.
@@ -250,16 +250,16 @@ type JWTAuth struct {
250250 // Defaults to reading from Authorization header.
251251 //
252252 // +optional
253- TokenSource *JWTTokenSource ` json:"tokenSource,omitempty"`
253+ TokenSource *TokenSource ` json:"tokenSource,omitempty"`
254254
255255 // Propagation controls identity header propagation to upstream and header stripping.
256256 //
257257 // +optional
258258 Propagation *JWTPropagation ` json:"propagation,omitempty"`
259259}
260260
261- // JWTFileKeySource specifies local JWKS key configuration.
262- type JWTFileKeySource struct {
261+ // FileKeySource specifies local JWKS key configuration.
262+ type FileKeySource struct {
263263 // SecretRef references a Secret containing the JWKS.
264264 SecretRef SecretObjectReference ` json:"secretRef,omitempty"`
265265
@@ -272,8 +272,8 @@ type JWTFileKeySource struct {
272272 KeyCache *v1alpha1.Duration ` json:"keyCache,omitempty"`
273273}
274274
275- // JWTRemoteKeySource specifies remote JWKS configuration.
276- type JWTRemoteKeySource struct {
275+ // RemoteKeySource specifies remote JWKS configuration.
276+ type RemoteKeySource struct {
277277 // URL is the JWKS endpoint, e.g. "https://issuer.example.com/.well-known/jwks.json".
278278 URL string ` json:"url"`
279279
@@ -325,14 +325,14 @@ type JWKSCache struct {
325325 UseTempPath *bool ` json:"useTempPath,omitempty"`
326326}
327327
328- // JWTTokenType represents NGINX auth_jwt_type.
328+ // TokenType represents NGINX auth_jwt_type.
329329// +kubebuilder:validation:Enum=signed;encrypted;nested
330- type JWTTokenType string
330+ type TokenType string
331331
332332const (
333- JWTTokenTypeSigned JWTTokenType = " signed"
334- JWTTokenTypeEncrypted JWTTokenType = " encrypted"
335- JWTTokenTypeNested JWTTokenType = " nested"
333+ TokenTypeSigned TokenType = " signed"
334+ TokenTypeEncrypted TokenType = " encrypted"
335+ TokenTypeNested TokenType = " nested"
336336)
337337
338338// JWTRequiredClaims specifies exact-match requirements for claims.
@@ -350,22 +350,22 @@ type JWTRequiredClaims struct {
350350
351351// JWTTokenSourceType selects where the JWT token is read from.
352352// +kubebuilder:validation:Enum=Header;Cookie;QueryArg
353- type JWTTokenSourceType string
353+ type TokenSourceType string
354354
355355const (
356356 // Read from Authorization header (Bearer). Default.
357- JWTTokenSourceModeHeader JWTTokenSourceMode = " Header"
357+ TokenSourceModeHeader TokenSourceMode = " Header"
358358 // Read from a cookie named tokenName.
359- JWTTokenSourceModeCookie JWTTokenSourceMode = " Cookie"
359+ TokenSourceModeCookie TokenSourceMode = " Cookie"
360360 // Read from a query arg named tokenName.
361- JWTTokenSourceModeQueryArg JWTTokenSourceMode = " QueryArg"
361+ TokenSourceModeQueryArg TokenSourceMode = " QueryArg"
362362)
363363
364364// JWTTokenSource specifies where tokens may be read from and the name when required.
365- type JWTTokenSource struct {
365+ type TokenSource struct {
366366 // Mode selects the token source.
367367 // +kubebuilder:default=Header
368- Type JWTTokenSourceType ` json:"mode"`
368+ Type TokenSourceType ` json:"mode"`
369369
370370 // TokenName is the cookie or query parameter name when Mode=Cookie or Mode=QueryArg.
371371 // Ignored when Mode=Header.
@@ -848,7 +848,7 @@ http {
848848
849849# ### Additional Optional Fields
850850
851- ` require` , `tokenSource` and `propagation` are some additioanl fields we may choose to include.
851+ ` require` , `tokenSource` and `propagation` are some additional fields we may choose to include.
852852
853853` ` ` yaml
854854apiVersion: gateway.nginx.org/v1alpha1
0 commit comments