1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-12-24 10:07:04 +02:00

minor tweak add log line to proxy and basic auth provider by default (#1513)

This commit is contained in:
Asim Aslam 2020-04-09 14:10:17 +01:00 committed by GitHub
parent bf65dc71c7
commit 29cccd0b4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -2,6 +2,7 @@ package auth
import ( import (
"github.com/google/uuid" "github.com/google/uuid"
"github.com/micro/go-micro/v2/auth/provider/basic"
) )
var ( var (
@ -9,7 +10,17 @@ var (
) )
func NewAuth(opts ...Option) Auth { func NewAuth(opts ...Option) Auth {
return &noop{} options := Options{
Provider: basic.NewProvider(),
}
for _, o := range opts {
o(&options)
}
return &noop{
opts: options,
}
} }
type noop struct { type noop struct {

View File

@ -206,7 +206,7 @@ func (p *Proxy) cacheRoutes(service string) ([]router.Route, error) {
results, err := p.Router.Lookup(router.QueryService(service)) results, err := p.Router.Lookup(router.QueryService(service))
if err != nil { if err != nil {
// assumption that we're ok with stale routes // assumption that we're ok with stale routes
logger.Debugf("Failed to lookup route for %s: %v", service, err)
// otherwise return the error // otherwise return the error
return nil, err return nil, err
} }