Skip to content

Commit

Permalink
ref: match signature of authenticate_credentials (#74974)
Browse files Browse the repository at this point in the history
pointed out by mypy 1.11

<!-- Describe your PR here. -->
  • Loading branch information
asottile-sentry authored Jul 25, 2024
1 parent ba2f759 commit a01759a
Showing 1 changed file with 7 additions and 2 deletions.
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

0 comments on commit a01759a

Please sign in to comment.