Skip to content

Commit 7c7dc79

Browse files
committed
Code review changes
1 parent 2d7c5ee commit 7c7dc79

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

docs/proposals/authentication-filter.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ type AuthenticationFilter struct {
9494

9595
// +kubebuilder:object:root=true
9696

97-
// AuthenticationFilterList contains a list of AuthenticationFilter.
97+
// AuthenticationFilterList contains a list of AuthenticationFilter resources.
9898
type AuthenticationFilterList struct {
9999
metav1.TypeMeta `json:",inline"`
100100
metav1.ListMeta `json:"metadata,omitempty"`
@@ -240,16 +240,11 @@ type FileKeySource struct {
240240

241241
// LocalObjectReferenceWithKey specifies a local Kubernetes object
242242
// with a required `key` field to extract data.
243-
// +kubebuilder:validation:XValidation:message="name must be set",rule="self.name != ''"
244243
type LocalObjectReferenceWithKey struct {
245244
// Inline the core LocalObjectReference so `name` sits at the same JSON level
246245
// (optional, but avoids nesting)
247246
v1.LocalObjectReference `json:",inline"`
248247

249-
// Key must be provided and non-empty.
250-
// This makes the field required in the OpenAPI schema.
251-
// +kubebuilder:validation:MinLength=1
252-
// +kubebuilder:validation:XValidation:rule="self != ''",message="key must be non-empty"
253248
Key string `json:"key"`
254249
}
255250

@@ -475,6 +470,8 @@ http {
475470
location /v2 {
476471
# Injected by BasicAuthFilter "basic-auth"
477472
auth_basic "Restricted";
473+
474+
# Path is generated by NGF using the name and key from the secret
478475
auth_basic_user_file /etc/nginx/secrets/basic-auth-users/htpasswd;
479476

480477
# Optional: customize failure per filter onFailure
@@ -636,7 +633,8 @@ http {
636633
auth_jwt "Restricted";
637634
638635
# File-based JWKS
639-
auth_jwt_key_file /etc/nginx/keys/jwks.json;
636+
# Path is generated by NGF using the name and key from the secret
637+
auth_jwt_key_file /etc/nginx/keys/jwt-keys-secure/jwks.json;
640638
641639
# Optional: key cache duration
642640
auth_jwt_key_cache 10m;
@@ -852,7 +850,7 @@ spec:
852850

853851
#### Attaching a JWT AuthenticationFilter to a route when using NGINX OSS
854852

855-
If a user attempts to attach a JWT tpye AuthenticationFilter while using NGINX OSS, the rule referncing the filter will be `Rejected`.
853+
If a user attempts to attach a JWT type AuthenticationFilter while using NGINX OSS, the rule referencing the filter will be `Rejected`.
856854

857855
This can use the status `RouteConditionPartiallyInvalid` defined in the Gateway API here: https://github.com/nginx/nginx-gateway-fabric/blob/main/internal/controller/state/conditions/conditions.go#L402
858856

@@ -994,6 +992,7 @@ spec:
994992
```
995993
996994
AuthenticationFilter referencing the cross-namespace Secret
995+
997996
```yaml
998997
apiVersion: gateway.nginx.org/v1alpha1
999998
kind: AuthenticationFilter

0 commit comments

Comments
 (0)