File tree Expand file tree Collapse file tree 3 files changed +34
-12
lines changed Expand file tree Collapse file tree 3 files changed +34
-12
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,11 @@ type AuthenticationFilterList struct {
4242//
4343//nolint:lll
4444type AuthenticationFilterSpec struct {
45+ // Basic configures HTTP Basic Authentication.
4546 Basic BasicAuth `json:"basic"`
46- Type AuthType `json:"type"`
47+
48+ // Type selects the authentication mechanism.
49+ Type AuthType `json:"type"`
4750}
4851
4952// AuthType defines the authentication mechanism.
@@ -56,9 +59,18 @@ const (
5659
5760// BasicAuth configures HTTP Basic Authentication.
5861type BasicAuth struct {
62+ // OnFailure customizes the 401 response for failed authentication.
63+ //
64+ // +optional
5965 OnFailure * AuthFailureResponse `json:"onFailure,omitempty"`
66+
67+ // SecretRef allows referencing a Secret in the same namespace
6068 SecretRef LocalObjectReference `json:"secretRef"`
61- Realm string `json:"realm"`
69+
70+ // Realm used by NGINX `auth_basic` directive.
71+ // https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html#auth_basic
72+ // Also configures "realm="<realm_value>" in WWW-Authenticate header in error page location.
73+ Realm string `json:"realm"`
6274}
6375
6476// LocalObjectReference specifies a local Kubernetes object.
Original file line number Diff line number Diff line change @@ -51,10 +51,11 @@ spec:
5151 description : Spec defines the desired state of the AuthenticationFilter.
5252 properties :
5353 basic :
54- description : BasicAuth configures HTTP Basic Authentication.
54+ description : Basic configures HTTP Basic Authentication.
5555 properties :
5656 onFailure :
57- description : AuthFailureResponse customizes 401/403 failures.
57+ description : OnFailure customizes the 401 response for failed
58+ authentication.
5859 properties :
5960 bodyPolicy :
6061 default : Unauthorized
@@ -87,10 +88,14 @@ spec:
8788 rule : self in [401, 403]
8889 type : object
8990 realm :
91+ description : |-
92+ Realm used by NGINX `auth_basic` directive.
93+ https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html#auth_basic
94+ Also configures "realm="<realm_value>" in WWW-Authenticate header in error page location.
9095 type : string
9196 secretRef :
92- description : LocalObjectReference specifies a local Kubernetes
93- object.
97+ description : SecretRef allows referencing a Secret in the same
98+ namespace
9499 properties :
95100 name :
96101 type : string
@@ -102,7 +107,7 @@ spec:
102107 - secretRef
103108 type : object
104109 type :
105- description : AuthType defines the authentication mechanism.
110+ description : Type selects the authentication mechanism.
106111 enum :
107112 - Basic
108113 type : string
Original file line number Diff line number Diff line change @@ -50,10 +50,11 @@ spec:
5050 description: Spec defines the desired state of the AuthenticationFilter.
5151 properties:
5252 basic:
53- description: BasicAuth configures HTTP Basic Authentication.
53+ description: Basic configures HTTP Basic Authentication.
5454 properties:
5555 onFailure:
56- description: AuthFailureResponse customizes 401/403 failures.
56+ description: OnFailure customizes the 401 response for failed
57+ authentication.
5758 properties:
5859 bodyPolicy:
5960 default: Unauthorized
@@ -86,10 +87,14 @@ spec:
8687 rule: self in [401, 403]
8788 type: object
8889 realm:
90+ description: |-
91+ Realm used by NGINX `auth_basic` directive.
92+ https://nginx.org/en/docs/http/ngx_http_auth_basic_module.html#auth_basic
93+ Also configures "realm="<realm_value>" in WWW-Authenticate header in error page location.
8994 type: string
9095 secretRef:
91- description: LocalObjectReference specifies a local Kubernetes
92- object.
96+ description: SecretRef allows referencing a Secret in the same
97+ namespace
9398 properties:
9499 name:
95100 type: string
@@ -101,7 +106,7 @@ spec:
101106 - secretRef
102107 type: object
103108 type:
104- description: AuthType defines the authentication mechanism.
109+ description: Type selects the authentication mechanism.
105110 enum:
106111 - Basic
107112 type: string
You can’t perform that action at this time.
0 commit comments