-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: huabing zhao <zhaohuabing@gmail.com>
- Loading branch information
1 parent
4c57d8f
commit ad198e2
Showing
18 changed files
with
1,192 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright Envoy Gateway Authors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// The full text of the Apache license is available in the LICENSE file at | ||
// the root of the repo. | ||
|
||
package v1alpha1 | ||
|
||
import ( | ||
gwapiv1b1 "sigs.k8s.io/gateway-api/apis/v1beta1" | ||
) | ||
|
||
const OIDCClientSecretKey = "client_secret" | ||
|
||
// OIDC defines the configuration for the OpenID Connect (OIDC) authentication. | ||
type OIDC struct { | ||
// The OIDC Provider configuration. | ||
Provider OIDCProvider `json:"provider"` | ||
|
||
// The OIDC client ID assigned to the filter to be used in the | ||
// [Authentication Request](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest). | ||
// | ||
// +kubebuilder:validation:MinLength=1 | ||
ClientID string `json:"clientID"` | ||
|
||
// The Kubernetes secret which contains the OIDC client secret assigned to the filter to be used in the | ||
// [Authentication Request](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest). | ||
// | ||
// This is an Opaque secret. The client secret should be stored in the key "client_secret". | ||
// +kubebuilder:validation:Required | ||
ClientSecret gwapiv1b1.SecretObjectReference `json:"clientSecret"` | ||
|
||
// The OIDC scopes to be used in the | ||
// [Authentication Request](https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest). | ||
// If not specified, "openid" is used. | ||
// | ||
// +optional | ||
Scopes []string `json:"scopes,omitempty"` | ||
} | ||
|
||
// OIDCProvider defines the OIDC Provider configuration. | ||
type OIDCProvider struct { | ||
// The OIDC Provider's [issuer identifier](https://openid.net/specs/openid-connect-discovery-1_0.html#IssuerDiscovery). | ||
// Issuer MUST be a URI RFC 3986 [RFC3986] with a scheme component that MUST | ||
// be https, a host component, and optionally, port and path components and | ||
// no query or fragment components. //TODO zhaohuabing xvalidate | ||
// +kubebuilder:validation:MinLength=1 | ||
Issuer string `json:"issuer"` | ||
|
||
// The OIDC Provider's [authorization endpoint](https://openid.net/specs/openid-connect-core-1_0.html#AuthorizationEndpoint). | ||
// If not provided, EG will try to discover it from the provider's [Well-Known Configuration Endpoint](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationResponse). | ||
// | ||
// +optional | ||
AuthorizationEndpoint string `json:"authorizationEndpoint,omitempty"` | ||
|
||
// The OIDC Provider's [token endpoint](https://openid.net/specs/openid-connect-core-1_0.html#TokenEndpoint). | ||
// If not provided, EG will try to discover it from the provider's [Well-Known Configuration Endpoint](https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderConfigurationResponse). | ||
// | ||
// +optional | ||
TokenEndpoint string `json:"tokenEndpoint,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.