Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Extends application type hints (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
djperrefort authored Oct 9, 2023
1 parent 5cede02 commit 859b0cb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crc_jupyter_auth/remote_user_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class RemoteUserLoginHandler(BaseHandler):
class for default config values.
"""

def get(self):
def get(self) -> None:
"""Parse an incoming ``get`` request and route users appropriately
Raises:
Expand Down Expand Up @@ -51,7 +51,7 @@ def get(self):
self.set_login_cookie(user)
self.redirect_or_raise(url_path_join(self.hub.server.base_url, 'home'))

def redirect_or_raise(self, url, raise_status=404):
def redirect_or_raise(self, url: str, raise_status: int = 404) -> None:
"""Redirect to the given url
If the URL is None or empty, raise an ``HTTPError``
Expand Down Expand Up @@ -105,7 +105,7 @@ class RemoteUserAuthenticator(AuthenticatorSettings, Authenticator):
authenticated users using the ``RemoteUserLoginHandler``.
"""

def get_handlers(self, app):
def get_handlers(self, app: web.Application) -> list:
"""Return any custom handlers that need to be registered with the parent authenticator
Args:
Expand All @@ -120,7 +120,7 @@ def get_handlers(self, app):
]

@gen.coroutine
def authenticate(self, *args):
def authenticate(self, *args) -> None:
"""Authenticate a user with login form data
See the parent class for requirements on implementing this method.
Expand All @@ -144,7 +144,7 @@ class RemoteUserLocalAuthenticator(AuthenticatorSettings, LocalAuthenticator):
Successfully authenticated users are routed using the ``RemoteUserLoginHandler``.
"""

def get_handlers(self, app):
def get_handlers(self, app: web.Application) -> list:
"""Return any custom handlers that need to be registered with the parent authenticator
Args:
Expand All @@ -159,7 +159,7 @@ def get_handlers(self, app):
]

@gen.coroutine
def authenticate(self, *args):
def authenticate(self, *args) -> None:
"""Authenticate a user with login form data
See the parent class for requirements on implementing this method.
Expand Down

0 comments on commit 859b0cb

Please sign in to comment.