Update on-disk storage format for users system (#7949)

- Policy mapping is now at `config/iam/policydb/users/myuser1.json`
  and includes version.

- User identity file is now versioned.

- Migrate old data to the new format.
This commit is contained in:
Aditya Manthramurthy 2019-07-24 17:34:23 -07:00 committed by kannappanr
parent 55d4eee6f1
commit 7bdaf9bc50
3 changed files with 841 additions and 388 deletions

View file

@ -1253,7 +1253,7 @@ func (a adminAPIHandlers) SetUserPolicy(w http.ResponseWriter, r *http.Request)
return
}
if err := globalIAMSys.SetUserPolicy(accessKey, policyName); err != nil {
if err := globalIAMSys.PolicyDBSet(accessKey, policyName); err != nil {
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
}

1225
cmd/iam.go

File diff suppressed because it is too large Load diff

View file

@ -183,7 +183,7 @@ func (sts *stsAPIHandlers) AssumeRole(w http.ResponseWriter, r *http.Request) {
return
}
policyName, err := globalIAMSys.GetUserPolicy(user.AccessKey)
policyName, err := globalIAMSys.PolicyDBGet(user.AccessKey)
if err != nil {
logger.LogIf(ctx, err)
writeSTSErrorResponse(w, stsErrCodes.ToSTSErr(ErrSTSInvalidParameterValue))