Skip to content

Commit e4b5256

Browse files
committed
Add authenticationConfiguration to Ingress Class Params
1 parent d0df42b commit e4b5256

13 files changed

+1256
-299
lines changed

Diff for: apis/elbv2/v1beta1/ingressclassparams_types.go

+90-1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,90 @@ type IPAMConfiguration struct {
114114
IPv4IPAMPoolId *string `json:"ipv4IPAMPoolId,omitempty"`
115115
}
116116

117+
type AuthType string
118+
119+
const (
120+
AuthTypeNone AuthType = "none"
121+
AuthTypeCognito AuthType = "cognito"
122+
AuthTypeOIDC AuthType = "oidc"
123+
)
124+
125+
// Amazon Cognito user pools configuration
126+
type AuthIDPConfigCognito struct {
127+
// The Amazon Resource Name (ARN) of the Amazon Cognito user pool.
128+
UserPoolARN string `json:"userPoolARN"`
129+
130+
// The ID of the Amazon Cognito user pool client.
131+
UserPoolClientID string `json:"userPoolClientID"`
132+
133+
// The domain prefix or fully-qualified domain name of the Amazon Cognito user pool.
134+
UserPoolDomain string `json:"userPoolDomain"`
135+
136+
// The query parameters (up to 10) to include in the redirect request to the authorization endpoint.
137+
// +kubebuilder:validation:MinProperties=1
138+
// +kubebuilder:validation:MaxProperties=10
139+
// +optional
140+
AuthenticationRequestExtraParams map[string]string `json:"authenticationRequestExtraParams,omitempty"`
141+
}
142+
143+
// OpenID Connect (OIDC) identity provider (IdP) configuration
144+
type AuthIDPConfigOIDC struct {
145+
// The OIDC issuer identifier of the IdP.
146+
Issuer string `json:"issuer"`
147+
148+
// The authorization endpoint of the IdP.
149+
AuthorizationEndpoint string `json:"authorizationEndpoint"`
150+
151+
// The token endpoint of the IdP.
152+
TokenEndpoint string `json:"tokenEndpoint"`
153+
154+
// The user info endpoint of the IdP.
155+
UserInfoEndpoint string `json:"userInfoEndpoint"`
156+
157+
// The k8s secretName. Secret must be within the same namespace as the Ingress.
158+
SecretName string `json:"secretName"`
159+
160+
// The query parameters (up to 10) to include in the redirect request to the authorization endpoint.
161+
// +kubebuilder:validation:MinProperties=1
162+
// +kubebuilder:validation:MaxProperties=10
163+
// +optional
164+
AuthenticationRequestExtraParams map[string]string `json:"authenticationRequestExtraParams,omitempty"`
165+
}
166+
167+
// Auth config for Service / Ingresses
168+
type AuthConfig struct {
169+
// The authentication type on targets.
170+
// +kubebuilder:validation:Enum=none;oidc;cognito
171+
Type AuthType `json:"type"`
172+
173+
// The Cognito IfP configuration.
174+
// +optional
175+
IDPConfigCognito *AuthIDPConfigCognito `json:"idpCognitoConfiguration,omitempty"`
176+
177+
// The OIDC IdP configuration.
178+
// +optional
179+
IDPConfigOIDC *AuthIDPConfigOIDC `json:"idpOidcConfiguration,omitempty"`
180+
181+
// The behavior if the user is not authenticated.
182+
// +kubebuilder:validation:Enum=authenticate;deny;allow
183+
// +optional
184+
OnUnauthenticatedRequest string `json:"onUnauthenticatedRequest,omitempty"`
185+
186+
// The set of user claims to be requested from the Cognito IdP or OIDC IdP, in a space-separated list.
187+
// * Options: phone, email, profile, openid, aws.cognito.signin.user.admin
188+
// * Ex. 'email openid'
189+
// +optional
190+
Scope string `json:"scope,omitempty"`
191+
192+
// The name of the cookie used to maintain session information.
193+
// +optional
194+
SessionCookieName string `json:"sessionCookie,omitempty"`
195+
196+
// The maximum duration of the authentication session, in seconds.
197+
// +optional
198+
SessionTimeout *int64 `json:"sessionTimeout,omitempty"`
199+
}
200+
117201
// IngressClassParamsSpec defines the desired state of IngressClassParams
118202
type IngressClassParamsSpec struct {
119203
// CertificateArn specifies the ARN of the certificates for all Ingresses that belong to IngressClass with this IngressClassParams.
@@ -145,7 +229,7 @@ type IngressClassParamsSpec struct {
145229
// +optional
146230
Subnets *SubnetSelector `json:"subnets,omitempty"`
147231

148-
// IPAddressType defines the ip address type for all Ingresses that belong to IngressClass with this IngressClassParams.
232+
// IPAddressType defines the IP address type for all Ingresses that belong to IngressClass with this IngressClassParams.
149233
// +optional
150234
IPAddressType *IPAddressType `json:"ipAddressType,omitempty"`
151235

@@ -169,7 +253,12 @@ type IngressClassParamsSpec struct {
169253
IPAMConfiguration *IPAMConfiguration `json:"ipamConfiguration,omitempty"`
170254

171255
// PrefixListsIDs defines the security group prefix lists for all Ingresses that belong to IngressClass with this IngressClassParams.
256+
// +optional
172257
PrefixListsIDs []string `json:"PrefixListsIDs,omitempty"`
258+
259+
// AuthenticationConfiguration defines the authentication configuration for a Load Balancer. Application Load Balancer supports authentication with Cognito or OIDC.
260+
// +optional
261+
AuthConfig *AuthConfig `json:"authenticationConfiguration,omitempty"`
173262
}
174263

175264
// +kubebuilder:object:root=true

Diff for: apis/elbv2/v1beta1/zz_generated.deepcopy.go

+79
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)