[#449] cli: Allow to exec tree get-by-path without bearer token

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
This commit is contained in:
Anton Nikiforov 2023-06-21 14:18:09 +03:00
parent 71889234b7
commit ab489265b3

View file

@ -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))