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.
master
Aditya Manthramurthy 5 years ago committed by kannappanr
parent 55d4eee6f1
commit 7bdaf9bc50
  1. 2
      cmd/admin-handlers.go
  2. 1169
      cmd/iam.go
  3. 2
      cmd/sts-handlers.go

@ -1253,7 +1253,7 @@ func (a adminAPIHandlers) SetUserPolicy(w http.ResponseWriter, r *http.Request)
return 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) writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
} }

File diff suppressed because it is too large Load Diff

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

Loading…
Cancel
Save