Merge pull request #1618 from micro/auth-namespace-flag

Auth Namespace Flag
This commit is contained in:
ben-toogood 2020-05-12 16:45:42 +01:00 committed by GitHub
commit 762a5bc9e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -271,6 +271,11 @@ var (
EnvVars: []string{"MICRO_AUTH_SECRET"},
Usage: "Account secret used for client authentication",
},
&cli.StringFlag{
Name: "auth_namespace",
EnvVars: []string{"MICRO_AUTH_NAMESPACE"},
Usage: "Namespace for the services auth account",
},
&cli.StringFlag{
Name: "auth_public_key",
EnvVars: []string{"MICRO_AUTH_PUBLIC_KEY"},
@ -681,6 +686,10 @@ func (c *cmd) Before(ctx *cli.Context) error {
))
}
if len(ctx.String("auth_namespace")) > 0 {
authOpts = append(authOpts, auth.Namespace(ctx.String("auth_namespace")))
}
if len(ctx.String("auth_public_key")) > 0 {
authOpts = append(authOpts, auth.PublicKey(ctx.String("auth_public_key")))
}