Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] auth_api_key: Use 401 for unauthorized user #738

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions auth_api_key/models/ir_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

import logging

from werkzeug.exceptions import Unauthorized

from odoo import models
from odoo.exceptions import AccessDenied
from odoo.http import request

_logger = logging.getLogger(__name__)
Expand All @@ -33,4 +34,4 @@
request.auth_api_key_id = auth_api_key.id
return True
_logger.error("Wrong HTTP_API_KEY, access denied")
raise AccessDenied()
raise Unauthorized()

Check warning on line 37 in auth_api_key/models/ir_http.py

View check run for this annotation

Codecov / codecov/patch

auth_api_key/models/ir_http.py#L37

Added line #L37 was not covered by tests
Loading