Skip to content

Part A: hosted login, app registry and forward auth (nginx, Traefik, … - #4

Merged
downlevel merged 1 commit into
mainfrom
sso-a
Oct 22, 2026
Merged

downlevel merged 1 commit into
mainfrom
sso-a

Conversation

@downlevel

Copy link
Copy Markdown
Owner

…Caddy)

TeleLogin can now protect any app behind a reverse proxy with no app code:

  • Hosted browser login (/login, /sso/start, /sso/complete, /logout) with a revocable SSO session created at Telegram approval and an HttpOnly cookie delivered once; optional SSO_COOKIE_DOMAIN for sibling subdomains (public suffixes rejected offline via tldextract).
  • /sso/verify forward-auth endpoint (401 + X-TeleLogin-Login for nginx, redirect=1 for Traefik/Caddy) returning percent-encoded X-TeleLogin-User and a stable X-TeleLogin-User-Id (new users.public_id).
  • App registry with per-app access policy (allowlist|all), allowlist and trusted return origins; app-scoped redirect validation.
  • Operator CLI (python -m src.admin): app add/list/show/remove/policy/ allow/disallow/origin, user invite/list/remove, gen-secrets.
  • REGISTRATION_MODE=open|closed; API port now bound to 127.0.0.1.
  • Proxy examples for nginx, Traefik and Caddy (prefix and subdomain shapes), docs/INTEGRATION.md, and a real-proxy e2e suite run in CI.

Built by Codex from the reviewed plan (Codex plan review, 5 rounds). Inspected twice by fresh Claude sessions; findings of the first inspection fixed by Codex. The three findings of the second inspection were fixed by Claude and are NOT covered by an independent inspection (budget exhausted, user decision): FORWARDED_ALLOW_IPS default '*' for the loopback-bound Compose port, stripping underscore identity-header variants in all proxy examples (+ e2e check), and /sso/complete persisting 'denied' after a pre-collection revoke (+ test).

Verification: 119 tests pass, ruff clean, no deprecation warnings; e2e passes for nginx, Traefik and Caddy in prefix and subdomain shapes.

…Caddy)

TeleLogin can now protect any app behind a reverse proxy with no app code:
- Hosted browser login (/login, /sso/start, /sso/complete, /logout) with a
  revocable SSO session created at Telegram approval and an HttpOnly cookie
  delivered once; optional SSO_COOKIE_DOMAIN for sibling subdomains (public
  suffixes rejected offline via tldextract).
- /sso/verify forward-auth endpoint (401 + X-TeleLogin-Login for nginx,
  redirect=1 for Traefik/Caddy) returning percent-encoded X-TeleLogin-User
  and a stable X-TeleLogin-User-Id (new users.public_id).
- App registry with per-app access policy (allowlist|all), allowlist and
  trusted return origins; app-scoped redirect validation.
- Operator CLI (python -m src.admin): app add/list/show/remove/policy/
  allow/disallow/origin, user invite/list/remove, gen-secrets.
- REGISTRATION_MODE=open|closed; API port now bound to 127.0.0.1.
- Proxy examples for nginx, Traefik and Caddy (prefix and subdomain shapes),
  docs/INTEGRATION.md, and a real-proxy e2e suite run in CI.

Built by Codex from the reviewed plan (Codex plan review, 5 rounds).
Inspected twice by fresh Claude sessions; findings of the first inspection
fixed by Codex. The three findings of the second inspection were fixed by
Claude and are NOT covered by an independent inspection (budget exhausted,
user decision): FORWARDED_ALLOW_IPS default '*' for the loopback-bound
Compose port, stripping underscore identity-header variants in all proxy
examples (+ e2e check), and /sso/complete persisting 'denied' after a
pre-collection revoke (+ test).

Verification: 119 tests pass, ruff clean, no deprecation warnings; e2e
passes for nginx, Traefik and Caddy in prefix and subdomain shapes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@downlevel
downlevel merged commit 7e7632d into main Oct 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant