Commit aa1ba2e
CLOUDP-314901 OIDC CRD changes + validation (#50)
# 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
```
1 parent 3b5eec1 commit aa1ba2e
File tree
16 files changed
+1407
-11
lines changed- api/v1
- mdbmulti
- mdb
- config/crd/bases
- helm_chart/crds
- pkg/util
- public
16 files changed
+1407
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
| |||
801 | 807 | | |
802 | 808 | | |
803 | 809 | | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
804 | 817 | | |
805 | 818 | | |
806 | 819 | | |
| |||
878 | 891 | | |
879 | 892 | | |
880 | 893 | | |
881 | | - | |
| 894 | + | |
882 | 895 | | |
883 | 896 | | |
884 | 897 | | |
| |||
912 | 925 | | |
913 | 926 | | |
914 | 927 | | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
915 | 932 | | |
916 | 933 | | |
917 | 934 | | |
| |||
920 | 937 | | |
921 | 938 | | |
922 | 939 | | |
923 | | - | |
| 940 | + | |
924 | 941 | | |
925 | 942 | | |
926 | 943 | | |
| |||
993 | 1010 | | |
994 | 1011 | | |
995 | 1012 | | |
996 | | - | |
| 1013 | + | |
997 | 1014 | | |
998 | 1015 | | |
999 | 1016 | | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
1000 | 1022 | | |
1001 | 1023 | | |
1002 | 1024 | | |
| |||
1033 | 1055 | | |
1034 | 1056 | | |
1035 | 1057 | | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1036 | 1120 | | |
1037 | 1121 | | |
1038 | 1122 | | |
| |||
1142 | 1226 | | |
1143 | 1227 | | |
1144 | 1228 | | |
1145 | | - | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
1146 | 1237 | | |
1147 | 1238 | | |
1148 | 1239 | | |
| |||
1203 | 1294 | | |
1204 | 1295 | | |
1205 | 1296 | | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
1206 | 1301 | | |
1207 | 1302 | | |
1208 | 1303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
64 | 133 | | |
65 | 134 | | |
66 | 135 | | |
| |||
0 commit comments