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

ref: match signature of authenticate_credentials #74974

Merged
merged 1 commit into from
Jul 25, 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
9 changes: 7 additions & 2 deletions src/sentry/api/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def is_static_relay(request):
return relay_info is not None


def relay_from_id(request, relay_id) -> tuple[Relay | None, bool]:
def relay_from_id(request: Request, relay_id: str) -> tuple[Relay | None, bool]:
"""
Tries to find a Relay for a given id
If the id is statically registered than no DB access will be done.
Expand Down Expand Up @@ -210,9 +210,14 @@ def authenticate(self, request: Request):
raise AuthenticationFailed("Missing relay signature")
return self.authenticate_credentials(relay_id, relay_sig, request)

def authenticate_credentials(self, relay_id, relay_sig, request):
def authenticate_credentials(
self, relay_id: str, relay_sig: str, request=None
) -> tuple[AnonymousUser, None]:
Scope.get_isolation_scope().set_tag("relay_id", relay_id)

if request is None:
raise AuthenticationFailed("missing request")

relay, static = relay_from_id(request, relay_id)

if relay is None:
Expand Down
Loading