@@ -4,15 +4,16 @@ package v1beta2
44type ExternalAuthProvider struct {
55 // Name of the OIDC provider
66 //
7- // +kubebuilder:validation:MinLength=1
87 // +kubebuilder:validation:Required
8+ // +kubebuilder:validation:MinLength=1
99 // +required
10- Name string `json:"name"`
10+ Name string `json:"name,omitempty "`
1111 // Issuer describes attributes of the OIDC token issuer
1212 //
1313 // +kubebuilder:validation:Required
14+ // +kubebuilder:validation:MinLength=1
1415 // +required
15- Issuer TokenIssuer `json:"issuer"`
16+ Issuer TokenIssuer `json:"issuer,omitzero "`
1617
1718 // OIDCClients contains configuration for the platform's clients that
1819 // need to request tokens from the issuer
@@ -46,9 +47,10 @@ type TokenIssuer struct {
4647 // Must use the https:// scheme.
4748 //
4849 // +kubebuilder:validation:Pattern=`^https:\/\/[^\s]`
50+ // +kubebuilder:validation:MinLength=1
4951 // +kubebuilder:validation:Required
5052 // +required
51- URL string `json:"issuerURL"`
53+ URL string `json:"issuerURL,omitempty "`
5254
5355 // Audiences is an array of audiences that the token was issued for.
5456 // Valid tokens must include at least one of these values in their
@@ -60,7 +62,7 @@ type TokenIssuer struct {
6062 // +kubebuilder:validation:MinItems=1
6163 // +kubebuilder:validation:MaxItems=10
6264 // +required
63- Audiences []TokenAudience `json:"audiences"`
65+ Audiences []TokenAudience `json:"audiences,omitempty "`
6466
6567 // CertificateAuthority is a reference to a config map in the
6668 // configuration namespace. The .data of the configMap must contain
@@ -79,23 +81,24 @@ type OIDCClientConfig struct {
7981 // +kubebuilder:validation:MaxLength=256
8082 // +kubebuilder:validation:Required
8183 // +required
82- ComponentName string `json:"componentName"`
84+ ComponentName string `json:"componentName,omitempty "`
8385
8486 // ComponentNamespace is the namespace of the component that is supposed to consume this
8587 // client configuration
8688 //
8789 // +kubebuilder:validation:MinLength=1
8890 // +kubebuilder:validation:MaxLength=63
8991 // +kubebuilder:validation:Required
92+ // +kubebuilder:validation:Pattern=^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
9093 // +required
91- ComponentNamespace string `json:"componentNamespace"`
94+ ComponentNamespace string `json:"componentNamespace,omitempty "`
9295
9396 // ClientID is the identifier of the OIDC client from the OIDC provider
9497 //
9598 // +kubebuilder:validation:MinLength=1
9699 // +kubebuilder:validation:Required
97100 // +required
98- ClientID string `json:"clientID"`
101+ ClientID string `json:"clientID,omitempty "`
99102
100103 // ClientSecret refers to a secret that
101104 // contains the client secret in the `clientSecret` key of the `.data` field
@@ -130,8 +133,9 @@ type PrefixedClaimMapping struct {
130133 // Claim is a JWT token claim to be used in the mapping
131134 //
132135 // +kubebuilder:validation:Required
136+ // +kubebuilder:validation:MinLength=1
133137 // +required
134- Claim string `json:"claim"`
138+ Claim string `json:"claim,omitempty "`
135139
136140 // Prefix is a string to prefix the value from the token in the result of the
137141 // claim mapping.
@@ -151,8 +155,9 @@ type UsernameClaimMapping struct {
151155 // Claim is a JWT token claim to be used in the mapping
152156 //
153157 // +kubebuilder:validation:Required
158+ // +kubebuilder:validation:MinLength=1
154159 // +required
155- Claim string `json:"claim"`
160+ Claim string `json:"claim,omitempty "`
156161
157162 // PrefixPolicy specifies how a prefix should apply.
158163 //
@@ -218,7 +223,8 @@ type TokenClaimValidationRule struct {
218223
219224 // RequiredClaim allows configuring a required claim name and its expected value
220225 // +kubebuilder:validation:Required
221- RequiredClaim TokenRequiredClaim `json:"requiredClaim"`
226+ // +kubebuilder:validation:MinLength=1
227+ RequiredClaim TokenRequiredClaim `json:"requiredClaim,omitzero"`
222228}
223229
224230// TokenRequiredClaim allows configuring a required claim name and its expected value.
@@ -229,21 +235,22 @@ type TokenRequiredClaim struct {
229235 // +kubebuilder:validation:MinLength=1
230236 // +kubebuilder:validation:Required
231237 // +required
232- Claim string `json:"claim"`
238+ Claim string `json:"claim,omitempty "`
233239
234240 // RequiredValue is the required value for the claim.
235241 //
236242 // +kubebuilder:validation:MinLength=1
237243 // +kubebuilder:validation:Required
238244 // +required
239- RequiredValue string `json:"requiredValue"`
245+ RequiredValue string `json:"requiredValue,omitempty "`
240246}
241247
242248// LocalObjectReference references an object in the same namespace.
243249type LocalObjectReference struct {
244250 // Name is the metadata.name of the referenced object.
245251 //
246252 // +kubebuilder:validation:Required
253+ // +kubebuilder:validation:MinLength=1
247254 // +required
248- Name string `json:"name"`
255+ Name string `json:"name,omitempty "`
249256}
0 commit comments