feat(storage-server): add packaging services
All checks were successful
arcad/edge/pipeline/pr-master This commit looks good

This commit is contained in:
2023-10-02 15:05:18 -06:00
parent d2472623f2
commit 9f89c89fb9
10 changed files with 188 additions and 19 deletions

View File

@ -16,7 +16,8 @@ func NewToken() *cli.Command {
Usage: "Generate new authentication token",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "tenant",
Name: "tenant",
Required: true,
},
flag.PrivateKey,
flag.PrivateKeySigningAlgorithm,
@ -28,6 +29,10 @@ func NewToken() *cli.Command {
privateKeyDefaultSize := flag.GetPrivateKeyDefaultSize(ctx)
tenant := ctx.String("tenant")
if tenant == "" {
return errors.New("you must provide a value for --tenant flag")
}
privateKey, err := jwtutil.LoadOrGenerateKey(
privateKeyFile,
privateKeyDefaultSize,