mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
Implement AssumeRole API for Minio users (#7267)
For actual API reference read here https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html Documentation is added and updated as well at docs/sts/assume-role.md Fixes #6381
This commit is contained in:
committed by
kannappanr
parent
ce588d1489
commit
c3ca954684
23
cmd/iam.go
23
cmd/iam.go
@@ -28,7 +28,7 @@ import (
|
||||
"github.com/minio/minio-go/pkg/set"
|
||||
"github.com/minio/minio/cmd/logger"
|
||||
"github.com/minio/minio/pkg/auth"
|
||||
"github.com/minio/minio/pkg/iam/policy"
|
||||
iampolicy "github.com/minio/minio/pkg/iam/policy"
|
||||
"github.com/minio/minio/pkg/madmin"
|
||||
)
|
||||
|
||||
@@ -326,6 +326,27 @@ func (sys *IAMSys) SetTempUser(accessKey string, cred auth.Credentials, policyNa
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetUserPolicy - returns canned policy name associated with a user.
|
||||
func (sys *IAMSys) GetUserPolicy(accessKey string) (policyName string, err error) {
|
||||
objectAPI := newObjectLayerFn()
|
||||
if objectAPI == nil {
|
||||
return "", errServerNotInitialized
|
||||
}
|
||||
|
||||
sys.RLock()
|
||||
defer sys.RUnlock()
|
||||
|
||||
if _, ok := sys.iamUsersMap[accessKey]; !ok {
|
||||
return "", errNoSuchUser
|
||||
}
|
||||
|
||||
if _, ok := sys.iamPolicyMap[accessKey]; !ok {
|
||||
return "", errNoSuchUser
|
||||
}
|
||||
|
||||
return sys.iamPolicyMap[accessKey], nil
|
||||
}
|
||||
|
||||
// ListUsers - list all users.
|
||||
func (sys *IAMSys) ListUsers() (map[string]madmin.UserInfo, error) {
|
||||
objectAPI := newObjectLayerFn()
|
||||
|
||||
Reference in New Issue
Block a user