forked from TrueCloudLab/frostfs-s3-gw
[#726] Use client time on regular requests
Use `X-Amz-Date` header as `now` when * compute expiration epoch * set Timestamp for object and container * forming locks * send notifications Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
parent
d3702f86d1
commit
094eb12578
19 changed files with 106 additions and 43 deletions
|
@ -197,11 +197,11 @@ func (c *Controller) SendNotifications(topics map[string]string, p *handler.Send
|
|||
return nil
|
||||
}
|
||||
|
||||
func (c *Controller) SendTestNotification(topic, bucketName, requestID, HostID string) error {
|
||||
func (c *Controller) SendTestNotification(topic, bucketName, requestID, HostID string, now time.Time) error {
|
||||
event := &TestEvent{
|
||||
Service: "NeoFS S3",
|
||||
Event: "s3:TestEvent",
|
||||
Time: time.Now(),
|
||||
Time: now,
|
||||
Bucket: bucketName,
|
||||
RequestID: requestID,
|
||||
HostID: HostID,
|
||||
|
@ -222,7 +222,7 @@ func prepareEvent(p *handler.SendNotificationParams) *Event {
|
|||
EventVersion: EventVersion21,
|
||||
EventSource: "neofs:s3",
|
||||
AWSRegion: "",
|
||||
EventTime: time.Now(),
|
||||
EventTime: p.Time,
|
||||
EventName: p.Event,
|
||||
UserIdentity: UserIdentity{
|
||||
PrincipalID: p.User,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue