Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 6 additions & 0 deletions api/environments/authentication.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from common.gunicorn.utils import log_extra
from django.conf import settings
from django.core.cache import caches
from rest_framework.authentication import BaseAuthentication
Expand Down Expand Up @@ -38,6 +39,11 @@ def authenticate(self, request): # type: ignore[no-untyped-def]
if api_key.startswith(SERVER_API_KEY_PREFIX)
else RequestOrigin.CLIENT
)
log_extra(
request=request,
key="environment_id",
value=environment.id,
)

# DRF authentication expects a two tuple to be returned containing User, auth
return None, None
16 changes: 10 additions & 6 deletions api/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ pygithub = "2.1.1"
hubspot-api-client = "^8.2.1"
djangorestframework-dataclasses = "^1.3.1"
pyotp = "^2.9.0"
flagsmith-common = "^1.9.0"
flagsmith-common = { git = "https://github.com/flagsmith/flagsmith-common", branch = "feat/log-wsgi-extras" }
django-stubs = "^5.1.3"
tzdata = "^2024.1"
djangorestframework-simplejwt = "^5.3.1"
Expand Down
Loading