mirror of
https://github.com/minio/minio.git
synced 2026-11-13 14:44:19 +00:00
feat: create service accounts with same claims as parent (#13357)
allow claims from LDAP/OIDC to be inherited to service accounts as well to allow dynamic policies. fixes #13325
This commit is contained in:
1 parent
3d5750f31c
commit
d7cb6de820
2 files changed
+16
-15
No files matched your search
+7
-5
@@ -1171,8 +1171,7 @@ type newServiceAccountOpts struct {
|
||||
accessKey string
|
||||
secretKey string
|
||||
|
||||
// LDAP username
|
||||
ldapUsername string
|
||||
claims map[string]interface{}
|
||||
}
|
||||
|
||||
// NewServiceAccount - create a new service account
|
||||
@@ -1260,9 +1259,12 @@ func (sys *IAMSys) NewServiceAccount(ctx context.Context, parentUser string, gro
|
||||
m[iamPolicyClaimNameSA()] = "inherited-policy"
|
||||
}
|
||||
|
||||
// For LDAP service account, save the ldap username in the metadata.
|
||||
if opts.ldapUsername != "" {
|
||||
m[ldapUserN] = opts.ldapUsername
|
||||
// Add all the necessary claims for the service accounts.
|
||||
for k, v := range opts.claims {
|
||||
_, ok := m[k]
|
||||
if !ok {
|
||||
m[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
|
||||
Reference in new issue
Block a user