You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Summary
Adding new `OIDCProviderConfig` struct to `Authentication` struct and
new AuthMode `OIDC`.
```go
type OIDCProviderConfig struct {
// Unique label that identifies this configuration. This label is visible to your Ops Manager users and is used when
// creating users and roles for authorization. It is case-sensitive and can only contain the following characters:
// - alphanumeric characters (combination of a to z and 0 to 9)
// - hyphens (-)
// - underscores (_)
// +kubebuilder:validation:Pattern="^[a-zA-Z0-9-_]+$"
// +kubebuilder:validation:Required
ConfigurationName string `json:"configurationName"`
// Issuer value provided by your registered IdP application. Using this URI, MongoDB finds an OpenID Provider
// Configuration Document, which should be available in the /.wellknown/open-id-configuration endpoint.
// +kubebuilder:validation:Required
IssuerURI string `json:"issuerURI"`
// Entity that your external identity provider intends the token for.
// Enter the audience value from the app you registered with external Identity Provider.
// +kubebuilder:validation:Required
Audience string `json:"audience"`
// Select GroupMembership to grant authorization based on IdP user group membership, or select UserID to grant
// an individual user authorization.
// +kubebuilder:validation:Required
AuthorizationType OIDCAuthorizationType `json:"authorizationType"`
// The identifier of the claim that includes the user principal identity.
// Accept the default value unless your IdP uses a different claim.
// +kubebuilder:default=sub
// +kubebuilder:validation:Required
UserClaim string `json:"userClaim"`
// The identifier of the claim that includes the principal's IdP user group membership information.
// Accept the default value unless your IdP uses a different claim, or you need a custom claim.
// Required when selected GroupMembership as the authorization type, ignored otherwise
// +kubebuilder:default=groups
// +kubebuilder:validation:Optional
GroupsClaim string `json:"groupsClaim,omitempty"`
// Configure single-sign-on for human user access to Ops Manager deployments with Workforce Identity Federation.
// For programmatic, application access to Ops Manager deployments use Workload Identity Federation.
// Only one Workforce Identity Federation IdP can be configured per MongoDB resource
// +kubebuilder:validation:Required
AuthorizationMethod OIDCAuthorizationMethod `json:"authorizationMethod"`
// Unique identifier for your registered application. Enter the clientId value from the app you
// registered with an external Identity Provider.
// Required when selected Workforce Identity Federation authorization method
// +kubebuilder:validation:Optional
ClientId string `json:"clientId,omitempty"`
// Tokens that give users permission to request data from the authorization endpoint.
// Only used for Workforce Identity Federation authorization method
// +kubebuilder:validation:Optional
RequestedScopes []string `json:"requestedScopes,omitempty"`
}
// +kubebuilder:validation:Enum=GroupMembership;UserID
type OIDCAuthorizationType string
// +kubebuilder:validation:Enum=WorkforceIdentityFederation;WorkloadIdentityFederation
type OIDCAuthorizationMethod string
```
⚠️ Because `Security.Authentication` struct is reused also in AppDBSpec
it will be available there as well. It will be as usual overridden in
https://github.com/mongodb/mongodb-kubernetes/blob/f0050b8942545701e8cb9e42d54d14f0cb58ee6a/api/v1/om/opsmanager_types.go#L622
I believe it is worth noting this behaviour, but not change it as part
of this project.
## Proof of Work
New Unit test that verify validation and another set of webhook tests
are under way.
## Next steps
- [ ] Add release notes
- [ ] Add validation tests based on webhooks
- [ ] Start discussion with docs team
## Checklist
- [x] Have you linked a jira ticket and/or is the ticket in the title?
- [ ] Have you checked whether your jira ticket required DOCSP changes?
- [ ] Have you checked for release_note changes?
---------
Co-authored-by: Lucian Tosa <[email protected]>
Co-authored-by: Anand <[email protected]>
Co-authored-by: Lucian Tosa <[email protected]>
0 commit comments