Use 401 for bad or missing credentials, 403 for forbidden access
This commit is contained in:
parent
4a64ddc86e
commit
35bebf9e99
3 changed files with 26 additions and 26 deletions
|
@ -2,7 +2,7 @@ import logging
|
|||
|
||||
from functools import wraps
|
||||
|
||||
from cnr.exception import UnauthorizedAccess
|
||||
from cnr.exception import Forbidden
|
||||
from flask import Blueprint
|
||||
|
||||
from app import metric_queue
|
||||
|
@ -18,8 +18,8 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
|
||||
def _raise_method(repository, scopes):
|
||||
raise UnauthorizedAccess("Unauthorized access for: %s" % repository,
|
||||
{"package": repository, "scopes": scopes})
|
||||
raise Forbidden("Unauthorized access for: %s" % repository,
|
||||
{"package": repository, "scopes": scopes})
|
||||
|
||||
|
||||
def _get_reponame_kwargs(*args, **kwargs):
|
||||
|
|
Reference in a new issue