Fix clientauth verifier registering
continuous-integration/drone/tag Build is passing Details

master v0.4.10
René Jochum 1 year ago
parent 6a8ee816af
commit 8775bdccc2

@ -15,8 +15,8 @@ require (
github.com/urfave/cli/v2 v2.16.3
go-micro.dev/v4 v4.8.1
google.golang.org/protobuf v1.28.1
jochum.dev/jo-micro/auth2 v0.5.3
jochum.dev/jo-micro/components v0.3.0
jochum.dev/jo-micro/auth2 v0.5.4
jochum.dev/jo-micro/components v0.3.2
jochum.dev/jo-micro/logruscomponent v0.0.4
)
@ -68,7 +68,6 @@ require (
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pelletier/go-toml/v2 v2.0.5 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/sirupsen/logrus v1.9.0 // indirect

@ -170,7 +170,6 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE=
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
@ -309,11 +308,11 @@ gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C
gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
jochum.dev/jo-micro/auth2 v0.5.2 h1:WstP5wQ+escaf8mrpHvIb7Litr2cfcy5Fn/6wxR2AHE=
jochum.dev/jo-micro/auth2 v0.5.2/go.mod h1:jXoqG9aK9CzRbxdSw0n7P9mmqZJwCqpewgWiM7EDGnY=
jochum.dev/jo-micro/auth2 v0.5.3 h1:rkYcGrn6xMoE4/0l19yyQ8sYHg6tHOuZVyKlzkEaNt4=
jochum.dev/jo-micro/auth2 v0.5.3/go.mod h1:7NTjyywV3g6u8XdXpq8TcAQKuWFnpzBf3TYVD3xL4hQ=
jochum.dev/jo-micro/components v0.3.0 h1:mo9IzK6UVbQuIit+vp74RFeT/VtS5mVv0ggBZ9q0tiE=
jochum.dev/jo-micro/components v0.3.0/go.mod h1:Yvn0Qz1zctUQUI6WIjq7PbfLY87Qvywpw+KxnVZeCvA=
jochum.dev/jo-micro/auth2 v0.5.4 h1:gHF84nYpFBUBYiQy/2411QeRRSlskXkK45+NgNypt5s=
jochum.dev/jo-micro/auth2 v0.5.4/go.mod h1:2tJTA5Hy5/A9XBsaKQuFsSM+ukrSRuJ1uTNU77Rir7A=
jochum.dev/jo-micro/components v0.3.2 h1:Z6Od76Uh2C2+bKhfZvaDLbry8vWGe4Ie/rDfrObE1pg=
jochum.dev/jo-micro/components v0.3.2/go.mod h1:MXpsIY5Gut4/wDNquiCN+e4zYtATVwn+7uiNKj4nlKk=
jochum.dev/jo-micro/logruscomponent v0.0.4 h1:KkJhLIM0mm2tlk+z+gZdpb5vCeuBs6bhG3bncGhCqoQ=
jochum.dev/jo-micro/logruscomponent v0.0.4/go.mod h1:NVy+eN3Xm2SlzdsQGuC/9/+MwU+8BwxFZuaTprmLguU=

@ -54,7 +54,7 @@ func (h *Handler) Init(r *components.Registry, cli *cli.Context) error {
h.routerURI = cli.String(fmt.Sprintf("%s_router_basepath", strings.ToLower(r.FlagPrefix())))
logger := logruscomponent.MustReg(r).Logger()
if _, err := r.Get(auth2.ClientAuthName); err != nil {
if err := auth2.RegHasClientAuth(r); err == nil {
authVerifier := endpointroles.NewVerifier(
endpointroles.WithLogrus(logger),
)
@ -66,7 +66,7 @@ func (h *Handler) Init(r *components.Registry, cli *cli.Context) error {
)
auth2.ClientAuthMustReg(r).Plugin().AddVerifier(authVerifier)
} else {
logger.Warnf("cant register a rule for RouterClientService, component %s not found", auth2.ClientAuthName)
logger.Warnf("cant register a rule for RouterClientService: %v", err)
}
h.RegisterWithServer(r.Service().Server())

Loading…
Cancel
Save