mirror of
https://github.com/minio/minio.git
synced 2025-11-21 02:09:08 -05:00
Properly replicate policy mapping for virtual users (#15558)
Currently, replicating policy mapping for STS users does not work. Fix it is by passing user type to PolicyDBSet.
This commit is contained in:
@@ -125,8 +125,15 @@ func (s *peerRESTServer) LoadPolicyMappingHandler(w http.ResponseWriter, r *http
|
||||
return
|
||||
}
|
||||
|
||||
userType := -1
|
||||
userTypeStr, err := strconv.Atoi(vars[peerRESTUserType])
|
||||
if err != nil {
|
||||
s.writeErrorResponse(w, fmt.Errorf("user-type `%d` is invalid: %w", userTypeStr, err))
|
||||
return
|
||||
}
|
||||
|
||||
_, isGroup := r.Form[peerRESTIsGroup]
|
||||
if err := globalIAMSys.LoadPolicyMapping(r.Context(), objAPI, userOrGroup, isGroup); err != nil {
|
||||
if err := globalIAMSys.LoadPolicyMapping(r.Context(), objAPI, userOrGroup, IAMUserType(userType), isGroup); err != nil {
|
||||
s.writeErrorResponse(w, err)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user