From 87ac3c52797d65f1c46e255c937ffd30b8441d35 Mon Sep 17 00:00:00 2001 From: Airat Arifullin Date: Tue, 29 Oct 2024 17:16:21 +0300 Subject: [PATCH] [#1458] object: Make patch not set key before target construction * `SignRequestPrivateKey` field should be initialized either within `newUntrustedTarget` or within `newTrustedTarget`. Otherwise, all requests are signed by local node key that makes impossible to perform patch on non-container node. Signed-off-by: Airat Arifullin --- pkg/services/object/patch/streamer.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/services/object/patch/streamer.go b/pkg/services/object/patch/streamer.go index c8ed6fdbf..677c6610f 100644 --- a/pkg/services/object/patch/streamer.go +++ b/pkg/services/object/patch/streamer.go @@ -113,10 +113,9 @@ func (s *Streamer) init(ctx context.Context, req *objectV2.PatchRequest) error { oV2.GetHeader().SetOwnerID(ownerID) target, err := target.New(objectwriter.Params{ - Config: s.Config, - Common: commonPrm, - Header: objectSDK.NewFromV2(oV2), - SignRequestPrivateKey: s.localNodeKey, + Config: s.Config, + Common: commonPrm, + Header: objectSDK.NewFromV2(oV2), }) if err != nil { return fmt.Errorf("target creation: %w", err)