From 4935016bf806ce6fcc094eebf32f7cbe6a61d27a Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 3 Mar 2022 11:10:55 +0300 Subject: [PATCH] [#1211] neofs-cli: Set bearer and session token in all object service requests Signed-off-by: Alex Vanin --- cmd/neofs-cli/internal/client/client.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmd/neofs-cli/internal/client/client.go b/cmd/neofs-cli/internal/client/client.go index 0fde595e..80e3f8b9 100644 --- a/cmd/neofs-cli/internal/client/client.go +++ b/cmd/neofs-cli/internal/client/client.go @@ -584,6 +584,14 @@ func HeadObject(prm HeadObjectPrm) (*HeadObjectRes, error) { cliPrm.ByID(*id) } + if prm.sessionToken != nil { + cliPrm.WithinSession(*prm.sessionToken) + } + + if prm.bearerToken != nil { + cliPrm.WithBearerToken(*prm.bearerToken) + } + if prm.raw { cliPrm.MarkRaw() } @@ -817,6 +825,14 @@ func PayloadRange(prm PayloadRangePrm) (*PayloadRangeRes, error) { cliPrm.ByID(*id) } + if prm.sessionToken != nil { + cliPrm.WithinSession(*prm.sessionToken) + } + + if prm.bearerToken != nil { + cliPrm.WithBearerToken(*prm.bearerToken) + } + if prm.raw { cliPrm.MarkRaw() }