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,

View File

@ -22,7 +22,7 @@ const SigningAlgorithmFlagName = "signing-algorithm"
var PrivateKeySigningAlgorithm = &cli.StringFlag{
Name: SigningAlgorithmFlagName,
EnvVars: []string{"STORAGE_SERVER_PRIVATE_KEY_SIGNING_ALGORITHM"},
EnvVars: []string{"STORAGE_SERVER_SIGNING_ALGORITHM"},
Value: jwa.RS256.String(),
}

View File

@ -37,6 +37,7 @@ func Run() *cli.Command {
Flags: []cli.Flag{
&cli.StringFlag{
Name: "address",
EnvVars: []string{"STORAGE_SERVER_ADDRESS"},
Aliases: []string{"addr"},
Value: ":3001",
},