mirror of
https://github.com/go-micro/go-micro.git
synced 2025-02-04 18:21:53 +02:00
Add jwt auth automatically discover (#2242)
* Add grpc,memory,quic transport automatically discover * Add grpc,memory,quic transport automatically discover * Add jwt auth automatically discover * Add jwt auth automatically discover
This commit is contained in:
parent
f444dadd50
commit
80dbe51077
@ -408,6 +408,14 @@ 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 name := ctx.String("auth"); len(name) > 0 {
|
||||
r, ok := c.opts.Auths[name]
|
||||
if !ok {
|
||||
return fmt.Errorf("Unsupported auth: %s", name)
|
||||
}
|
||||
|
||||
*c.opts.Auth = r(authOpts...)
|
||||
}
|
||||
|
||||
// Set the registry
|
||||
if name := ctx.String("registry"); len(name) > 0 && (*c.opts.Registry).String() != name {
|
||||
|
Loading…
x
Reference in New Issue
Block a user