Skip to content

Commit 9781f5b

Browse files
committed
use a CEL validation for URLs
1 parent 43a07db commit 9781f5b

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanes.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -906,9 +906,9 @@ spec:
906906
not. Typically the URL consists of only a hostname, like https://server.example.org
907907
or https://example.com. This URL should point to the level below .well-known/openid-configuration
908908
and must be publicly accessible over the internet.
909-
minLength: 1
910-
pattern: ^https://.+
911909
type: string
910+
x-kubernetes-validations:
911+
- rule: isURL(self) && url(self).getScheme() == 'https'
912912
requiredClaims:
913913
additionalProperties:
914914
type: string
@@ -3083,8 +3083,9 @@ spec:
30833083
or https://example.com. This URL should point to the level below .well-known/openid-configuration
30843084
and must be publicly accessible over the internet.
30853085
minLength: 1
3086-
pattern: ^https://.+
30873086
type: string
3087+
x-kubernetes-validations:
3088+
- rule: isURL(self) && url(self).getScheme() == 'https'
30883089
requiredClaims:
30893090
additionalProperties:
30903091
type: string

config/crd/bases/controlplane.cluster.x-k8s.io_awsmanagedcontrolplanetemplates.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,9 @@ spec:
909909
or https://example.com. This URL should point to the level below .well-known/openid-configuration
910910
and must be publicly accessible over the internet.
911911
minLength: 1
912-
pattern: ^https://.+
913912
type: string
913+
x-kubernetes-validations:
914+
- rule: isURL(self) && url(self).getScheme() == 'https'
914915
requiredClaims:
915916
additionalProperties:
916917
type: string

controlplane/eks/api/v1beta1/types.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,7 @@ type OIDCIdentityProviderConfig struct {
252252
// and must be publicly accessible over the internet.
253253
//
254254
// +kubebuilder:validation:Required
255-
// +kubebuilder:validation:MinLength=1
256-
// +kubebuilder:validation:Pattern=`^https://.+`
255+
// +kubebuilder:validation:XValidation:rule="isURL(self) && url(self).getScheme() == 'https'"
257256
IssuerURL string `json:"issuerUrl,omitempty"`
258257

259258
// The key value pairs that describe required claims in the identity token.

controlplane/eks/api/v1beta2/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ type OIDCIdentityProviderConfig struct {
257257
//
258258
// +kubebuilder:validation:Required
259259
// +kubebuilder:validation:MinLength=1
260-
// +kubebuilder:validation:Pattern=`^https://.+`
260+
// +kubebuilder:validation:XValidation:rule="isURL(self) && url(self).getScheme() == 'https'"
261261
IssuerURL string `json:"issuerUrl,omitempty"`
262262

263263
// The key value pairs that describe required claims in the identity token.

0 commit comments

Comments
 (0)