mirror of
https://github.com/minio/minio.git
synced 2025-01-25 21:53:16 -05:00
parent
18dee6a333
commit
f60eaabfcd
@ -233,10 +233,15 @@ func extractReqParams(r *http.Request) map[string]string {
|
|||||||
region := globalServerRegion
|
region := globalServerRegion
|
||||||
cred := getReqAccessCred(r, region)
|
cred := getReqAccessCred(r, region)
|
||||||
|
|
||||||
|
principalID := cred.AccessKey
|
||||||
|
if cred.ParentUser != "" {
|
||||||
|
principalID = cred.ParentUser
|
||||||
|
}
|
||||||
|
|
||||||
// Success.
|
// Success.
|
||||||
m := map[string]string{
|
m := map[string]string{
|
||||||
"region": region,
|
"region": region,
|
||||||
"accessKey": cred.AccessKey,
|
"principalId": principalID,
|
||||||
"sourceIPAddress": handlers.GetSourceIP(r),
|
"sourceIPAddress": handlers.GetSourceIP(r),
|
||||||
// Add more fields here.
|
// Add more fields here.
|
||||||
}
|
}
|
||||||
|
@ -1368,7 +1368,7 @@ func (args eventArgs) ToEvent(escape bool) event.Event {
|
|||||||
AwsRegion: args.ReqParams["region"],
|
AwsRegion: args.ReqParams["region"],
|
||||||
EventTime: eventTime.Format(event.AMZTimeFormat),
|
EventTime: eventTime.Format(event.AMZTimeFormat),
|
||||||
EventName: args.EventName,
|
EventName: args.EventName,
|
||||||
UserIdentity: event.Identity{PrincipalID: args.ReqParams["accessKey"]},
|
UserIdentity: event.Identity{PrincipalID: args.ReqParams["principalId"]},
|
||||||
RequestParameters: args.ReqParams,
|
RequestParameters: args.ReqParams,
|
||||||
ResponseElements: respElements,
|
ResponseElements: respElements,
|
||||||
S3: event.Metadata{
|
S3: event.Metadata{
|
||||||
@ -1376,7 +1376,7 @@ func (args eventArgs) ToEvent(escape bool) event.Event {
|
|||||||
ConfigurationID: "Config",
|
ConfigurationID: "Config",
|
||||||
Bucket: event.Bucket{
|
Bucket: event.Bucket{
|
||||||
Name: args.BucketName,
|
Name: args.BucketName,
|
||||||
OwnerIdentity: event.Identity{PrincipalID: args.ReqParams["accessKey"]},
|
OwnerIdentity: event.Identity{PrincipalID: args.ReqParams["principalId"]},
|
||||||
ARN: policy.ResourceARNPrefix + args.BucketName,
|
ARN: policy.ResourceARNPrefix + args.BucketName,
|
||||||
},
|
},
|
||||||
Object: event.Object{
|
Object: event.Object{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user