OIDC: add support for account claim maps (#1186)
This commit is contained in:
28 files changed
+1456
-200
No files matched your search
@@ -14,6 +14,7 @@ type OidcAuthMethodAttributes struct {
|
||||
IdpCaCerts []string `json:"idp_ca_certs,omitempty"`
|
||||
AllowedAudiences []string `json:"allowed_audiences,omitempty"`
|
||||
ClaimsScopes []string `json:"claims_scopes,omitempty"`
|
||||
AccountClaimMaps []string `json:"account_claim_maps,omitempty"`
|
||||
DisableDiscoveredConfigValidation bool `json:"disable_discovered_config_validation,omitempty"`
|
||||
DryRun bool `json:"dry_run,omitempty"`
|
||||
}
|
||||
@@ -87,6 +87,30 @@ func WithRecursive(recurse bool) Option {
|
||||
}
|
||||
}
|
||||
|
||||
func WithOidcAuthMethodAccountClaimMaps(inAccountClaimMaps []string) Option {
|
||||
return func(o *options) {
|
||||
raw, ok := o.postMap["attributes"]
|
||||
if !ok {
|
||||
raw = interface{}(map[string]interface{}{})
|
||||
}
|
||||
val := raw.(map[string]interface{})
|
||||
val["account_claim_maps"] = inAccountClaimMaps
|
||||
o.postMap["attributes"] = val
|
||||
}
|
||||
}
|
||||
|
||||
func DefaultOidcAuthMethodAccountClaimMaps() Option {
|
||||
return func(o *options) {
|
||||
raw, ok := o.postMap["attributes"]
|
||||
if !ok {
|
||||
raw = interface{}(map[string]interface{}{})
|
||||
}
|
||||
val := raw.(map[string]interface{})
|
||||
val["account_claim_maps"] = nil
|
||||
o.postMap["attributes"] = val
|
||||
}
|
||||
}
|
||||
|
||||
func WithOidcAuthMethodAllowedAudiences(inAllowedAudiences []string) Option {
|
||||
return func(o *options) {
|
||||
raw, ok := o.postMap["attributes"]
|
||||
|
||||
Reference in new issue
Block a user