INNER CODE UNIT · Python
redirect_for_host
Kounex/obs_blade · tool/kick_auth_proxy/proxy.py:215
def redirect_for_host(host: str) -> str:
"""The registered callback URL on [host] (the one the browser came
back to), else the default."""
name = host.split(":", 1)[0].strip().lower()
for url in ALLOWED_REDIRECTS:
if url.lower().startswith(f"https://{name}/"):
return url
return ALLOWED_REDIRECT
def accept_callback(
query: dict[str, str],
forward,
now: float | None = None,
redirect: str | None = None,
) -> bool:
"""Exchange the browser redirect. True when the state was known."""
state = query.get("state", "")