mirror of
https://github.com/minio/minio.git
synced 2025-11-23 11:07:50 -05:00
event: Enhance event message struct to provide origin server. (#3557)
`principalId` i.e user identity is kept as AccessKey in
accordance with S3 spec.
Additionally responseElements{} are added starting with
`x-amz-request-id` is a hexadecimal of the event time itself in nanosecs.
`x-minio-origin-server` - points to the server generating the event.
Fixes #3556
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
@@ -225,5 +226,13 @@ func (n *nsLockMap) deleteLockInfoEntryForOps(param nsParam, opsID string) error
|
||||
|
||||
// Return randomly generated string ID
|
||||
func getOpsID() string {
|
||||
return mustGetRequestID()
|
||||
const opsIDLen = 16
|
||||
opsIDBytes := make([]byte, opsIDLen)
|
||||
if _, err := rand.Read(opsIDBytes); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
for i := 0; i < opsIDLen; i++ {
|
||||
opsIDBytes[i] = alphaNumericTable[opsIDBytes[i]%alphaNumericTableLen]
|
||||
}
|
||||
return string(opsIDBytes)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user