aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/auth_credentials.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/s3api/auth_credentials.go')
-rw-r--r--weed/s3api/auth_credentials.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/weed/s3api/auth_credentials.go b/weed/s3api/auth_credentials.go
index 289fbd556..0d99e43eb 100644
--- a/weed/s3api/auth_credentials.go
+++ b/weed/s3api/auth_credentials.go
@@ -421,8 +421,10 @@ func (iam *IdentityAccessManagement) Auth(f http.HandlerFunc, action Action) htt
glog.V(3).Infof("auth error: %v", errCode)
if errCode == s3err.ErrNone {
+ // Store the authenticated identity in request context (secure, cannot be spoofed)
if identity != nil && identity.Name != "" {
- r.Header.Set(s3_constants.AmzIdentityId, identity.Name)
+ ctx := s3_constants.SetIdentityNameInContext(r.Context(), identity.Name)
+ r = r.WithContext(ctx)
}
f(w, r)
return