[#311] Change object owner for anonymous put #317

Merged
alexvanin merged 1 commit from mbiryukova/frostfs-s3-gw:bugfix/anonymous_requests into master 2024-02-21 15:03:17 +00:00
Showing only changes of commit cde0c0559e - Show all commits

View file

@ -237,6 +237,12 @@ func (x *FrostFS) CreateObject(ctx context.Context, prm layer.PrmObjectCreate) (
obj.SetAttributes(attrs...)
obj.SetPayloadSize(prm.PayloadSize)
if prm.BearerToken == nil && prm.PrivateKey != nil {
var owner user.ID
user.IDFromKey(&owner, prm.PrivateKey.PublicKey)
obj.SetOwnerID(&owner)
}
if len(prm.Locks) > 0 {
lock := new(object.Lock)
lock.WriteMembers(prm.Locks)