From c3b404bab004ef84d163a7f0eefc1aa1a0e531bb Mon Sep 17 00:00:00 2001 From: Ben Toogood Date: Tue, 26 May 2020 17:35:06 +0100 Subject: [PATCH] Fix server calling across namespace --- util/wrapper/wrapper.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/wrapper/wrapper.go b/util/wrapper/wrapper.go index 5149299b..9f3d1faa 100644 --- a/util/wrapper/wrapper.go +++ b/util/wrapper/wrapper.go @@ -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) }