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

v24.47.1 - Security authorization patch #648

Merged
merged 2 commits into from
Dec 3, 2024
Merged
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
8 changes: 2 additions & 6 deletions asab/web/auth/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,6 @@ async def _wrap_handlers(self, aiohttp_app):
if not inspect.iscoroutinefunction(route.handler):
continue

# Skip auth for HEAD requests
if route.method == "HEAD":
continue

try:
self._wrap_handler(route)
except Exception as e:
Expand Down Expand Up @@ -762,7 +758,7 @@ def _set_tenant_context_from_url_query(handler):
@functools.wraps(handler)
async def wrapper(*args, **kwargs):
request = args[-1]
header_tenant = Tenant.get(None)
header_tenant = request.headers.get("X-Tenant")
tenant = request.query.get("tenant")

if tenant is None:
Expand Down Expand Up @@ -797,7 +793,7 @@ def _set_tenant_context_from_url_path(handler):
@functools.wraps(handler)
async def wrapper(*args, **kwargs):
request = args[-1]
header_tenant = Tenant.get(None)
header_tenant = request.headers.get("X-Tenant")
tenant = request.match_info.get("tenant")

if header_tenant is not None:
Expand Down
Loading