Skip to content
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d91a5f4
Add Implementable Proposal for AuthenticationFilter
shaun-nx Nov 6, 2025
9047c3e
Update auth header code block
shaun-nx Nov 6, 2025
c937366
Fix pre-commit and lint errors
shaun-nx Nov 6, 2025
1b8bac2
Update Golang API with defaults and CEL validation with kubebuilder
shaun-nx Nov 7, 2025
2f143e9
Add additional defaults and CEL validations
shaun-nx Nov 7, 2025
61f479c
Merge branch 'main' into proposal/authentication-filter
shaun-nx Nov 7, 2025
47ff38b
Fix typos
shaun-nx Nov 7, 2025
40b8224
Update comments in GolangAPI to decribe relative NGINX directives
shaun-nx Nov 7, 2025
24966b8
Update API and Security Considerations for ReferenceGrant integration
shaun-nx Nov 7, 2025
ecceb93
Merge branch 'main' into proposal/authentication-filter
shaun-nx Nov 7, 2025
da1b17e
Fix pre-commit errors
shaun-nx Nov 7, 2025
38dd8f7
Fix typos and grammer
shaun-nx Nov 7, 2025
e362745
Update BasicAuth AIP and examples to use `secretRef`
shaun-nx Nov 7, 2025
dd5aaa8
Update KeyCache to use v1alpha1.Duration
shaun-nx Nov 7, 2025
bf3ed2b
Merge branch 'main' into proposal/authentication-filter
shaun-nx Nov 14, 2025
eb49b32
Merge branch 'main' into proposal/authentication-filter
shaun-nx Nov 18, 2025
a86a3ae
Move kubebuilder validation, remove mountpath and configmap options, …
shaun-nx Nov 18, 2025
79b957d
Update jwks_uri internal uri
shaun-nx Nov 19, 2025
e0ec4fb
Fix typos
shaun-nx Nov 19, 2025
d3ebed4
Fix comment indentation
shaun-nx Nov 19, 2025
4f1c893
Adjust struct indentation
shaun-nx Nov 19, 2025
5ff7389
Pre-commit check
shaun-nx Nov 19, 2025
dd24287
Ensure no default for JWT key mode
shaun-nx Nov 19, 2025
14b84a9
Use SecretObjectReference for secretRef, remove references to ConfigM…
shaun-nx Nov 19, 2025
8526c7f
Add references to NGINX directives
shaun-nx Nov 19, 2025
93486eb
Remove `key` from `secretRef`
shaun-nx Nov 19, 2025
d91b389
Remove trailing whitespace
shaun-nx Nov 19, 2025
b6fb76b
Add additional comments
shaun-nx Nov 19, 2025
73594af
Update comments and restructure api
shaun-nx Nov 19, 2025
7aede4c
Update security details on headers
shaun-nx Nov 19, 2025
acbb54c
Merge branch 'main' into proposal/authentication-filter
shaun-nx Nov 19, 2025
4aae8e7
Merge branch 'main' into proposal/authentication-filter
shaun-nx Nov 20, 2025
1029c3e
Remove JWT key word from fields
shaun-nx Nov 20, 2025
c864630
Add default Real for basic auth
shaun-nx Nov 20, 2025
ef57f2a
Fix typo
shaun-nx Nov 20, 2025
22d2726
Update Status section on using NGINX OSS with JWT auth
shaun-nx Nov 20, 2025
9e6b3c9
Set optioanl JWT fields as stretch goals
shaun-nx Nov 20, 2025
21b5611
Add stretch goals
shaun-nx Nov 20, 2025
65c1adc
Update secret ref to use LocalObjectReferenceWithKey struct
shaun-nx Nov 20, 2025
a0c8c04
Fix typo and update validation section
shaun-nx Nov 20, 2025
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
50 changes: 25 additions & 25 deletions docs/proposals/authentication-filter.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,13 @@ type BasicAuth struct {
OnFailure *AuthFailureResponse `json:"onFailure,omitempty"`
}

// JWTKeyMode selects where JWT keys come from.
// KeyMode selects where JWT keys come from.
// +kubebuilder:validation:Enum=File;Remote
type JWTKeyMode string
type KeyMode string
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not opposed to having JWT in the names of these fields. It makes it clear that they are for JWT. My only gripe was having JWTToken, which is redundant.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When I looked over it, while KeyMode was only related to JWT right now, the NGINX OIDC Module lets you specify a local secret, as well as a remote URL. So this could eventually be re-used when we implement OIDC auth

That being said, I'll look back over it and see if other fields where JWT was removed could still keep it.


const (
JWTKeyModeFile JWTKeyMode = "File"
JWTKeyModeRemote JWTKeyMode = "Remote"
KeyModeFile KeyMode = "File"
KeyModeRemote KeyMode = "Remote"
)

// JWTAuth configures JWT-based authentication (NGINX Plus).
Expand All @@ -179,19 +179,19 @@ type JWTAuth struct {
Realm *string `json:"realm,omitempty"`

// Mode selects how JWT keys are provided: local file or remote JWKS.
Mode JWTKeyMode `json:"mode,omitempty"`
Mode KeyMode `json:"mode,omitempty"`

// File specifies local JWKS configuration.
// Required when Mode == File.
//
// +optional
File *JWTFileKeySource `json:"file,omitempty"`
File *FileKeySource `json:"file,omitempty"`

// Remote specifies remote JWKS configuration.
// Required when Mode == Remote.
//
// +optional
Remote *JWTRemoteKeySource `json:"remote,omitempty"`
Remote *RemoteKeySource `json:"remote,omitempty"`

// Leeway is the acceptable clock skew for exp/nbf checks.
// Configures `auth_jwt_leeway` directive.
Expand All @@ -210,7 +210,7 @@ type JWTAuth struct {
//
// +optional
// +kubebuilder:default=signed
Type *JWTTokenType `json:"type,omitempty"`
Type *TokenType `json:"type,omitempty"`

// KeyCache is the cache duration for keys.
// Configures auth_jwt_key_cache directive.
Expand Down Expand Up @@ -250,16 +250,16 @@ type JWTAuth struct {
// Defaults to reading from Authorization header.
//
// +optional
TokenSource *JWTTokenSource `json:"tokenSource,omitempty"`
TokenSource *TokenSource `json:"tokenSource,omitempty"`

// Propagation controls identity header propagation to upstream and header stripping.
//
// +optional
Propagation *JWTPropagation `json:"propagation,omitempty"`
}

// JWTFileKeySource specifies local JWKS key configuration.
type JWTFileKeySource struct {
// FileKeySource specifies local JWKS key configuration.
type FileKeySource struct {
// SecretRef references a Secret containing the JWKS.
SecretRef SecretObjectReference `json:"secretRef,omitempty"`

Expand All @@ -272,8 +272,8 @@ type JWTFileKeySource struct {
KeyCache *v1alpha1.Duration `json:"keyCache,omitempty"`
}

// JWTRemoteKeySource specifies remote JWKS configuration.
type JWTRemoteKeySource struct {
// RemoteKeySource specifies remote JWKS configuration.
type RemoteKeySource struct {
// URL is the JWKS endpoint, e.g. "https://issuer.example.com/.well-known/jwks.json".
URL string `json:"url"`

Expand Down Expand Up @@ -325,14 +325,14 @@ type JWKSCache struct {
UseTempPath *bool `json:"useTempPath,omitempty"`
}

// JWTTokenType represents NGINX auth_jwt_type.
// TokenType represents NGINX auth_jwt_type.
// +kubebuilder:validation:Enum=signed;encrypted;nested
type JWTTokenType string
type TokenType string

const (
JWTTokenTypeSigned JWTTokenType = "signed"
JWTTokenTypeEncrypted JWTTokenType = "encrypted"
JWTTokenTypeNested JWTTokenType = "nested"
TokenTypeSigned TokenType = "signed"
TokenTypeEncrypted TokenType = "encrypted"
TokenTypeNested TokenType = "nested"
)

// JWTRequiredClaims specifies exact-match requirements for claims.
Expand All @@ -350,22 +350,22 @@ type JWTRequiredClaims struct {

// JWTTokenSourceType selects where the JWT token is read from.
// +kubebuilder:validation:Enum=Header;Cookie;QueryArg
type JWTTokenSourceType string
type TokenSourceType string

const (
// Read from Authorization header (Bearer). Default.
JWTTokenSourceModeHeader JWTTokenSourceMode = "Header"
TokenSourceModeHeader TokenSourceMode = "Header"
// Read from a cookie named tokenName.
JWTTokenSourceModeCookie JWTTokenSourceMode = "Cookie"
TokenSourceModeCookie TokenSourceMode = "Cookie"
// Read from a query arg named tokenName.
JWTTokenSourceModeQueryArg JWTTokenSourceMode = "QueryArg"
TokenSourceModeQueryArg TokenSourceMode = "QueryArg"
)

// JWTTokenSource specifies where tokens may be read from and the name when required.
type JWTTokenSource struct {
type TokenSource struct {
// Mode selects the token source.
// +kubebuilder:default=Header
Type JWTTokenSourceType `json:"mode"`
Type TokenSourceType `json:"mode"`

// TokenName is the cookie or query parameter name when Mode=Cookie or Mode=QueryArg.
// Ignored when Mode=Header.
Expand Down Expand Up @@ -848,7 +848,7 @@ http {

#### Additional Optional Fields

`require`, `tokenSource` and `propagation` are some additioanl fields we may choose to include.
`require`, `tokenSource` and `propagation` are some additional fields we may choose to include.

```yaml
apiVersion: gateway.nginx.org/v1alpha1
Expand Down