From ab489265b3f27435a8a6e013fd2074319d9bf3e0 Mon Sep 17 00:00:00 2001 From: Anton Nikiforov Date: Wed, 21 Jun 2023 14:18:09 +0300 Subject: [PATCH] [#449] cli: Allow to exec `tree get-by-path` without bearer token Signed-off-by: Anton Nikiforov --- cmd/frostfs-cli/modules/tree/get_by_path.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/frostfs-cli/modules/tree/get_by_path.go b/cmd/frostfs-cli/modules/tree/get_by_path.go index 6f6fc7ff9d..69a3dc7ea9 100644 --- a/cmd/frostfs-cli/modules/tree/get_by_path.go +++ b/cmd/frostfs-cli/modules/tree/get_by_path.go @@ -71,7 +71,9 @@ func getByPath(cmd *cobra.Command, _ []string) { Path: strings.Split(path, "/"), LatestOnly: latestOnly, AllAttributes: true, - BearerToken: common.ReadBearerToken(cmd, bearerFlagKey).Marshal(), + } + if btok := common.ReadBearerToken(cmd, bearerFlagKey); btok != nil { + req.Body.BearerToken = btok.Marshal() } commonCmd.ExitOnErr(cmd, "message signing: %w", tree.SignMessage(req, pk))