Skip to content

Commit 99178e8

Browse files
committed
use a CEL validation for URLs
1 parent 43a07db commit 99178e8

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -907,8 +907,9 @@ spec:
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.
909909
minLength: 1
910-
pattern: ^https://.+
911910
type: string
911+
x-kubernetes-validations:
912+
- rule: isURL(self) && url(self).getScheme() == 'https'
912913
requiredClaims:
913914
additionalProperties:
914915
type: string
@@ -3083,8 +3084,9 @@ spec:
30833084
or https://example.com. This URL should point to the level below .well-known/openid-configuration
30843085
and must be publicly accessible over the internet.
30853086
minLength: 1
3086-
pattern: ^https://.+
30873087
type: string
3088+
x-kubernetes-validations:
3089+
- rule: isURL(self) && url(self).getScheme() == 'https'
30883090
requiredClaims:
30893091
additionalProperties:
30903092
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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ type OIDCIdentityProviderConfig struct {
253253
//
254254
// +kubebuilder:validation:Required
255255
// +kubebuilder:validation:MinLength=1
256-
// +kubebuilder:validation:Pattern=`^https://.+`
256+
// +kubebuilder:validation:XValidation:rule="isURL(self) && url(self).getScheme() == 'https'"
257257
IssuerURL string `json:"issuerUrl,omitempty"`
258258

259259
// 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)