Skip to content

Commit

Permalink
validate accessTokenInactivityTimeout >= 300s
Browse files Browse the repository at this point in the history
  • Loading branch information
muraee authored and openshift-cherrypick-robot committed Oct 24, 2023
1 parent 34d364c commit 4c5c718
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions api/v1beta1/hostedcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -2096,6 +2096,7 @@ type ClusterConfiguration struct {
// It is used to configure the integrated OAuth server.
// This configuration is only honored when the top level Authentication config has type set to IntegratedOAuth.
// +optional
// +kubebuilder:validation:XValidation:rule="!has(self.tokenConfig.accessTokenInactivityTimeout) || duration(self.tokenConfig.accessTokenInactivityTimeout).getSeconds() >= 300", message="spec.configuration.oauth.tokenConfig.accessTokenInactivityTimeout minimum acceptable token timeout value is 300 seconds"
OAuth *configv1.OAuthSpec `json:"oauth,omitempty"`

// Scheduler holds cluster-wide config information to run the Kubernetes Scheduler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5614,6 +5614,12 @@ spec:
type: integer
type: object
type: object
x-kubernetes-validations:
- message: spec.configuration.oauth.tokenConfig.accessTokenInactivityTimeout
minimum acceptable token timeout value is 300 seconds
rule: '!has(self.tokenConfig.accessTokenInactivityTimeout) ||
duration(self.tokenConfig.accessTokenInactivityTimeout).getSeconds()
>= 300'
proxy:
description: Proxy holds cluster-wide information on how to configure
default proxies for the cluster.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5594,6 +5594,12 @@ spec:
type: integer
type: object
type: object
x-kubernetes-validations:
- message: spec.configuration.oauth.tokenConfig.accessTokenInactivityTimeout
minimum acceptable token timeout value is 300 seconds
rule: '!has(self.tokenConfig.accessTokenInactivityTimeout) ||
duration(self.tokenConfig.accessTokenInactivityTimeout).getSeconds()
>= 300'
proxy:
description: Proxy holds cluster-wide information on how to configure
default proxies for the cluster.
Expand Down
12 changes: 12 additions & 0 deletions hack/app-sre/saas_template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35589,6 +35589,12 @@ objects:
type: integer
type: object
type: object
x-kubernetes-validations:
- message: spec.configuration.oauth.tokenConfig.accessTokenInactivityTimeout
minimum acceptable token timeout value is 300 seconds
rule: '!has(self.tokenConfig.accessTokenInactivityTimeout)
|| duration(self.tokenConfig.accessTokenInactivityTimeout).getSeconds()
>= 300'
proxy:
description: Proxy holds cluster-wide information on how to
configure default proxies for the cluster.
Expand Down Expand Up @@ -43318,6 +43324,12 @@ objects:
type: integer
type: object
type: object
x-kubernetes-validations:
- message: spec.configuration.oauth.tokenConfig.accessTokenInactivityTimeout
minimum acceptable token timeout value is 300 seconds
rule: '!has(self.tokenConfig.accessTokenInactivityTimeout)
|| duration(self.tokenConfig.accessTokenInactivityTimeout).getSeconds()
>= 300'
proxy:
description: Proxy holds cluster-wide information on how to
configure default proxies for the cluster.
Expand Down

0 comments on commit 4c5c718

Please sign in to comment.