typestubs/asfquart/generics.pyi (7 lines of code) (raw):
"""
This type stub file was generated by pyright.
"""
"""Generic endpoints for ASFQuart"""
OAUTH_URL_INIT: str = ...
OAUTH_URL_CALLBACK: str = ...
DEFAULT_OAUTH_URI: str = ...
def setup_oauth(app, uri=..., workflow_timeout: int = ...): # -> None:
"""Sets up a generic ASF OAuth endpoint for the given app. The default URI is /auth, and the
default workflow timeout is 900 seconds (15 min), within which the OAuth login must
be completed. The OAuth endpoint handles everything related to logging in and out via OAuth,
and has the following actions:
- /auth?login - Initializes an OAuth login
- /auth?login=/foo - Same as above, but redirects to /foo on successful login
- /auth?logout - Clears a user session, logging them out
- /auth - Shows the user's credentials if logged in, 404 otherwise.
This generic route expects the Host: header of the request to be accurate, which means setting
"ProxyPreserveHost On" in your httpd config if proxying.
"""
...
def enforce_login(app, redirect_uri=...): # -> None:
"""Enforces redirect to the auth provider (if enabled) when a client tries to access a restricted page
without being logged in. Only redirects if there is no active user session. On success, the client
is redirected back to the origin page that was restricted. If it is still restricted, the client
will instead see an error message."""
...