1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-11-24 08:02:32 +02:00

Change cross namespace request err level

This commit is contained in:
Ben Toogood 2020-04-07 10:54:27 +01:00
parent b5f5027549
commit f0980e9b30

View File

@ -75,8 +75,8 @@ func (h authHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
// Check the accounts namespace matches the namespace we're operating
// within. If not forbid the request and log the occurance.
if acc.Namespace != namespace {
logger.Warnf("Cross namespace request forbidden: account %v (%v) requested access to %v in the %v namespace", acc.ID, acc.Namespace, req.URL.Path, namespace)
http.Error(w, "Forbidden namespace", 403)
logger.Debugf("Cross namespace request warning: account %v (%v) requested access to %v in the %v namespace", acc.ID, acc.Namespace, req.URL.Path, namespace)
// http.Error(w, "Forbidden namespace", 403)
}
// Determine the name of the service being requested