[#390] frostfs-cli: Pass bearer token to Tree srv

* Add --bearer flag for "tree" subcommand

Signed-off-by: Airat Arifullin a.arifullin@yadro.com
This commit is contained in:
Airat Arifullin 2023-06-05 18:54:59 +03:00
parent a770b89fd8
commit 189a367ef2
5 changed files with 11 additions and 4 deletions

View file

@ -5,6 +5,7 @@ import (
"fmt"
"strings"
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/common"
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/commonflags"
"git.frostfs.info/TrueCloudLab/frostfs-node/cmd/frostfs-cli/internal/key"
commonCmd "git.frostfs.info/TrueCloudLab/frostfs-node/cmd/internal/common"
@ -60,7 +61,7 @@ func add(cmd *cobra.Command, _ []string) {
TreeId: tid,
ParentId: pid,
Meta: meta,
BearerToken: nil, // TODO: #1891 add token handling
BearerToken: common.ReadBearerToken(cmd, bearerFlagKey).Marshal(),
}
commonCmd.ExitOnErr(cmd, "message signing: %w", tree.SignMessage(req, pk))