Skip to content

Commit

Permalink
Fix server calling across namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-toogood committed May 26, 2020
1 parent cd28365 commit c3b404b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions util/wrapper/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ func AuthHandler(fn func() auth.Auth) server.HandlerWrapper {
ctx = metadata.Set(ctx, "Micro-Namespace", ns)
}

// Check the issuer matches the services namespace
if account != nil && account.Issuer != ns {
// Check the issuer matches the services namespace. TODO: Stop allowing go.micro to access
// any namespace and instead check for the server issuer.
if account != nil && account.Issuer != ns && account.Issuer != "go.micro" {
return errors.Forbidden(req.Service(), "Account was not issued by %v", ns)
}

Expand Down

0 comments on commit c3b404b

Please sign in to comment.