Skip to content

Commit

Permalink
api: limit length of subject name to 100 in upstream validation
Browse files Browse the repository at this point in the history
* allows the CEL validation rule to get a passing score

Signed-off-by: Clay Kauzlaric <[email protected]>
  • Loading branch information
KauzClay committed Jan 2, 2024
1 parent 455aee2 commit 457ff9c
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion apis/projectcontour/v1/httpproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ type UpstreamValidation struct {
// Key which is expected to be present in the 'subjectAltName' of the presented certificate.
// Deprecated: migrate to using the plural field subjectNames.
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=256
// +kubebuilder:validation:MaxLength=100
SubjectName string `json:"subjectName"`
// List of keys, of which at least one is expected to be present in the 'subjectAltName of the
// presented certificate.
Expand Down
8 changes: 4 additions & 4 deletions examples/contour/01-crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5041,7 +5041,7 @@ spec:
description: 'Key which is expected to be present in the ''subjectAltName''
of the presented certificate. Deprecated: migrate to using the
plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -6689,7 +6689,7 @@ spec:
description: 'Key which is expected to be present
in the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -7102,7 +7102,7 @@ spec:
description: 'Key which is expected to be present in
the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -7443,7 +7443,7 @@ spec:
in the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field
subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down
8 changes: 4 additions & 4 deletions examples/render/contour-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5260,7 +5260,7 @@ spec:
description: 'Key which is expected to be present in the ''subjectAltName''
of the presented certificate. Deprecated: migrate to using the
plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -6908,7 +6908,7 @@ spec:
description: 'Key which is expected to be present
in the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -7321,7 +7321,7 @@ spec:
description: 'Key which is expected to be present in
the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -7662,7 +7662,7 @@ spec:
in the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field
subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down
8 changes: 4 additions & 4 deletions examples/render/contour-gateway-provisioner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5052,7 +5052,7 @@ spec:
description: 'Key which is expected to be present in the ''subjectAltName''
of the presented certificate. Deprecated: migrate to using the
plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -6700,7 +6700,7 @@ spec:
description: 'Key which is expected to be present
in the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -7113,7 +7113,7 @@ spec:
description: 'Key which is expected to be present in
the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -7454,7 +7454,7 @@ spec:
in the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field
subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down
8 changes: 4 additions & 4 deletions examples/render/contour-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5263,7 +5263,7 @@ spec:
description: 'Key which is expected to be present in the ''subjectAltName''
of the presented certificate. Deprecated: migrate to using the
plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -6911,7 +6911,7 @@ spec:
description: 'Key which is expected to be present
in the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -7324,7 +7324,7 @@ spec:
description: 'Key which is expected to be present in
the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -7665,7 +7665,7 @@ spec:
in the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field
subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down
8 changes: 4 additions & 4 deletions examples/render/contour.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5260,7 +5260,7 @@ spec:
description: 'Key which is expected to be present in the ''subjectAltName''
of the presented certificate. Deprecated: migrate to using the
plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -6908,7 +6908,7 @@ spec:
description: 'Key which is expected to be present
in the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -7321,7 +7321,7 @@ spec:
description: 'Key which is expected to be present in
the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down Expand Up @@ -7662,7 +7662,7 @@ spec:
in the ''subjectAltName'' of the presented certificate.
Deprecated: migrate to using the plural field
subjectNames.'
maxLength: 256
maxLength: 100
minLength: 1
type: string
subjectNames:
Expand Down

0 comments on commit 457ff9c

Please sign in to comment.