diff --git a/cmd/admin-handlers-users.go b/cmd/admin-handlers-users.go index 50bb48df7..55df8ca99 100644 --- a/cmd/admin-handlers-users.go +++ b/cmd/admin-handlers-users.go @@ -672,8 +672,9 @@ func (a adminAPIHandlers) AddServiceAccount(w http.ResponseWriter, r *http.Reque // It could be a regular user account or the root account. _, isRegularUser := globalIAMSys.GetUser(ctx, targetUser) if !isRegularUser && targetUser != globalActiveCred.AccessKey { - writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, - fmt.Errorf("parent user %s does not exist. Cannot create service account", targetUser)), r.URL) + apiErr := toAdminAPIErr(ctx, errNoSuchUser) + apiErr.Description = fmt.Sprintf("Specified target user %s does not exist", targetUser) + writeErrorResponseJSON(ctx, w, apiErr, r.URL) return } } diff --git a/cmd/bucket-lifecycle.go b/cmd/bucket-lifecycle.go index 17140f5a9..2f6c73959 100644 --- a/cmd/bucket-lifecycle.go +++ b/cmd/bucket-lifecycle.go @@ -374,7 +374,7 @@ func expireTransitionedObject(ctx context.Context, objectAPI ObjectLayer, oi *Ob EventName: eventName, BucketName: oi.Bucket, Object: objInfo, - Host: "Internal: [ILM-EXPIRY]", + Host: "Internal: [ILM-Expiry]", }) case expireRestoredObj: diff --git a/cmd/data-scanner.go b/cmd/data-scanner.go index 04448b564..607a950b5 100644 --- a/cmd/data-scanner.go +++ b/cmd/data-scanner.go @@ -1203,7 +1203,7 @@ func applyExpiryOnNonTransitionedObjects(ctx context.Context, objLayer ObjectLay EventName: eventName, BucketName: obj.Bucket, Object: obj, - Host: "Internal: [ILM-EXPIRY]", + Host: "Internal: [ILM-Expiry]", }) return true diff --git a/cmd/event-notification.go b/cmd/event-notification.go index 914e3cd90..ec7f2c0c2 100644 --- a/cmd/event-notification.go +++ b/cmd/event-notification.go @@ -248,6 +248,7 @@ func (args eventArgs) ToEvent(escape bool) event.Event { respElements := map[string]string{ "x-amz-request-id": args.RespElements["requestId"], + "x-amz-id-2": args.RespElements["nodeId"], "x-minio-origin-endpoint": func() string { if globalMinioEndpoint != "" { return globalMinioEndpoint @@ -255,17 +256,18 @@ func (args eventArgs) ToEvent(escape bool) event.Event { return getAPIEndpoints()[0] }(), // MinIO specific custom elements. } - // Add deployment as part of - if globalDeploymentID != "" { - respElements["x-minio-deployment-id"] = globalDeploymentID - } + + // Add deployment as part of response elements. + respElements["x-minio-deployment-id"] = globalDeploymentID if args.RespElements["content-length"] != "" { respElements["content-length"] = args.RespElements["content-length"] } + keyName := args.Object.Name if escape { keyName = url.QueryEscape(args.Object.Name) } + newEvent := event.Event{ EventVersion: "2.0", EventSource: "minio:s3", @@ -312,12 +314,13 @@ func (args eventArgs) ToEvent(escape bool) event.Event { } func sendEvent(args eventArgs) { - args.Object.Size, _ = args.Object.GetActualSize() - // avoid generating a notification for REPLICA creation event. if _, ok := args.ReqParams[xhttp.MinIOSourceReplicationRequest]; ok { return } + + args.Object.Size, _ = args.Object.GetActualSize() + // remove sensitive encryption entries in metadata. crypto.RemoveSensitiveEntries(args.Object.UserDefined) crypto.RemoveInternalEntries(args.Object.UserDefined) diff --git a/cmd/handler-utils.go b/cmd/handler-utils.go index 99b1eb6ef..99f74a13e 100644 --- a/cmd/handler-utils.go +++ b/cmd/handler-utils.go @@ -242,6 +242,7 @@ func extractRespElements(w http.ResponseWriter) map[string]string { } return map[string]string{ "requestId": w.Header().Get(xhttp.AmzRequestID), + "nodeId": w.Header().Get(xhttp.AmzRequestNodeID), "content-length": w.Header().Get(xhttp.ContentLength), // Add more fields here. } diff --git a/cmd/object-handlers-common.go b/cmd/object-handlers-common.go index d3aa0b600..58a9d6106 100644 --- a/cmd/object-handlers-common.go +++ b/cmd/object-handlers-common.go @@ -374,7 +374,7 @@ func deleteObjectVersions(ctx context.Context, o ObjectLayer, bucket string, toD Name: dobj.ObjectName, VersionID: dobj.VersionID, }, - Host: "Internal: [ILM-EXPIRY]", + Host: "Internal: [ILM-Expiry]", }) } }