Skip to content

Commit

Permalink
API: api for setting OIDC token cookie domain (envoyproxy#4093)
Browse files Browse the repository at this point in the history
* api for oidc token cookie domain

Signed-off-by: Huabing Zhao <[email protected]>

* minor wording

Signed-off-by: Huabing Zhao <[email protected]>

* add regex validation

Signed-off-by: Huabing Zhao <[email protected]>

---------

Signed-off-by: Huabing Zhao <[email protected]>
  • Loading branch information
zhaohuabing authored Aug 26, 2024
1 parent 8efec5e commit 8ae9b09
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
9 changes: 9 additions & 0 deletions api/v1alpha1/oidc_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ type OIDC struct {
// +optional
CookieNames *OIDCCookieNames `json:"cookieNames,omitempty"`

// The optional domain to set the access and ID token cookies on.
// If not set, the cookies will default to the host of the request, not including the subdomains.
// If set, the cookies will be set on the specified domain and all subdomains.
// This means that requests to any subdomain will not require reauthentication after users log in to the parent domain.
// +optional
// +notImplementedHide
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9]))*$`
CookieDomain *string `json:"cookieDomain,omitempty"`

// The OIDC scopes to be used in the
// [Authentication Request](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest).
// The "openid" scope is always added to the list of scopes if not already
Expand Down
5 changes: 5 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -2049,6 +2049,14 @@ spec:
required:
- name
type: object
cookieDomain:
description: |-
The optional domain to set the access and ID token cookies on.
If not set, the cookies will default to the host of the request, not including the subdomains.
If set, the cookies will be set on the specified domain and all subdomains.
This means that requests to any subdomain will not require reauthentication after users log in to the parent domain.
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9]))*$
type: string
cookieNames:
description: |-
The optional cookie name overrides to be used for Bearer and IdToken cookies in the
Expand Down

0 comments on commit 8ae9b09

Please sign in to comment.