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

Signed-off-by: Anton Nikiforov <an.nikiforov@yadro.com>
fix/notary_prep_logger
Anton Nikiforov 2023-06-21 14:18:09 +03:00
parent 71889234b7
commit ab489265b3
1 changed files with 3 additions and 1 deletions

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