You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -102,6 +103,12 @@ type AuthenticationFilterList struct {
102
103
103
104
// AuthenticationFilterSpec defines the desired configuration.
104
105
// Exactly one of Basic or JWT must be set according to Type.
106
+
// +kubebuilder:validation:XValidation:message="for type=Basic, spec.basic must be set and spec.jwt must be empty; for type=JWT, spec.jwt must be set and spec.basic must be empty",rule="self.type == 'Basic' ? self.basic != null && self.jwt == null : self.type == 'JWT' ? self.jwt != null && self.basic == null : false"
107
+
108
+
// +kubebuilder:validation:XValidation:message="type 'Basic' requires spec.basic to be set. All other spec types must be unset",rule="self.type == 'Basic' ? self.type != null && self.jwt == null : true"
109
+
// +kubebuilder:validation:XValidation:message="type 'JWT' requires spec.jwt to be set. All other spec types must be unset",rule="self.type == 'JWT' ? self.type != null && self.basic == null : true"
110
+
// +kubebuilder:validation:XValidation:message="when spec.basic is set, type must be 'Basic'",rule="self.basic != null ? self.type == 'Basic' : true"
111
+
// +kubebuilder:validation:XValidation:message="when spec.jwt is set, type must be 'JWT'",rule="self.jwt != null ? self.type == 'JWT' : true"
105
112
typeAuthenticationFilterSpecstruct {
106
113
// Type selects the authentication mechanism.
107
114
//
@@ -134,7 +141,6 @@ type BasicAuth struct {
134
141
Secretstring`json:"secret"`
135
142
136
143
// Key is the key within the Secret that contains the htpasswd data.
0 commit comments