Merge pull request #1618 from micro/auth-namespace-flag
Auth Namespace Flag
This commit is contained in:
commit
762a5bc9e8
@ -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")))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user