Replace auth account.Namespace with account.Scopes
This commit is contained in:
@@ -197,10 +197,7 @@ func AuthHandler(fn func() auth.Auth) server.HandlerWrapper {
|
||||
}
|
||||
|
||||
// Inspect the token and get the account
|
||||
account, err := a.Inspect(token)
|
||||
if err != nil {
|
||||
account = &auth.Account{Namespace: a.Options().Namespace}
|
||||
}
|
||||
account, _ := a.Inspect(token)
|
||||
|
||||
// construct the resource
|
||||
res := &auth.Resource{
|
||||
@@ -210,7 +207,7 @@ func AuthHandler(fn func() auth.Auth) server.HandlerWrapper {
|
||||
}
|
||||
|
||||
// Verify the caller has access to the resource
|
||||
err = a.Verify(account, res)
|
||||
err := a.Verify(account, res)
|
||||
if err != nil && len(account.ID) > 0 {
|
||||
return errors.Forbidden(req.Service(), "Forbidden call made to %v:%v by %v", req.Service(), req.Endpoint(), account.ID)
|
||||
} else if err != nil {
|
||||
|
Reference in New Issue
Block a user