selector: use custom domain (#1760)

* util/wrapper: improve auth errors

* client: add network call option

* client/selector: add domain select option

* client/grpc: pass network option to selector
This commit is contained in:
ben-toogood
2020-06-30 10:07:52 +01:00
committed by GitHub
parent deea8fecf4
commit 0f5c53b6e4
5 changed files with 42 additions and 7 deletions

View File

@@ -222,10 +222,10 @@ func AuthHandler(fn func() auth.Auth) server.HandlerWrapper {
ctx = metadata.Set(ctx, "Micro-Namespace", ns)
}
// Check the issuer matches the services namespace. TODO: Stop allowing go.micro to access
// Check the issuer matches the services namespace. TODO: Stop allowing micro to access
// any namespace and instead check for the server issuer.
if account != nil && account.Issuer != ns && account.Issuer != "micro" {
return errors.Forbidden(req.Service(), "Account was not issued by %v", ns)
return errors.Forbidden(req.Service(), "Account was issued by %v, not %v", account.Issuer, ns)
}
// construct the resource