From cde0c0559e94a0a8d71399066f014ebfd2fff114 Mon Sep 17 00:00:00 2001 From: Marina Biryukova Date: Tue, 20 Feb 2024 11:07:28 +0300 Subject: [PATCH] [#311] Change object owner for anonymous put Signed-off-by: Marina Biryukova --- internal/frostfs/frostfs.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/frostfs/frostfs.go b/internal/frostfs/frostfs.go index ab7a1e7..95630ac 100644 --- a/internal/frostfs/frostfs.go +++ b/internal/frostfs/frostfs.go @@ -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) -- 2.45.2