Gateway-hosted auth flows: client registry + origin allowlist prerequisites

Open
#1,291 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
12/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
flask, google-cloud, python

Research direction

Start in campus.auth's OAuth client registry and the CORS/origin allowlist config, which the issue does not name by file, so locate them first. Do not edit until the blocking app-side conditions (namespaced /login routes and the campus_*_session cookie names) are merged. Done when each downstream client lists its gateway redirect_uri additively, the Google federated client has the gateway callback, and PUBLIC_URL is untouched.

Written by the indexing model from the issue text.

Description

Gateway single-hostname intent (umbrella to follow; routing shipped on dev via campus#1274/#1275): once each downstream app serves its auth flow under the gateway hostname, several campus.auth-side registrations and origin checks must know the gateway origin. This issue collects that platform work. Blocked until the app-side conditions below are in place — the registry entries must reference routes that actually exist.

Unblock conditions (all required before starting)

  1. Namespaced auth surfaces per app — flask_campus ships a configurable login-blueprint mount prefix (flask-campus issue, filed 2026-11-25) and each downstream app mounts /login + /finalize_login + /logout under its namespace (/<ns>/login, …) on dev: campus-classroom (+apphost), campus-admin, campus-profile, nyxchange-timetable-v2.
  2. Distinct session cookie names shipped per campus docs/development-guidelines.md "Session Cookie Naming" (PR #1290): campus_{classroom,apphost,admin,profile,timetable}_session — without them, working gateway flows would still thrash across apps on the shared host.
  3. Sequencing note: the mesh-bind fixes in the four downstream repos (campus-classroom#152, campus-admin#94, campus-profile#58, nyxchange-timetable-v2#179) are planned to land first (operator decision) — not strictly blocking for registry edits, but they should precede any gateway-anchored flow verification.

The work itself (once unblocked)

  • campus.auth OAuth client registry (dev): add gateway-hosted redirect_uris to each downstream client — https://campus-development.up.railway.app/<ns>/finalize_login:
    • classroom + apphost share uid-client-ef56f01c
    • admin uid-client-f293a42a
    • profile uid-client-f2ca6010
    • timetable uid-client-cd3ef100-afe
      (Additive: keep the existing origin URIs so origin flows keep working until each app flips.)
  • post_logout_redirect_uri origins: the logout flow carries app-anchored post-logout targets; campus.auth honors them only when the origin matches a registered client redirect_uri (#788) — the same additive registry edit covers this.
  • Google federated client (GCP): add the gateway origin's authorized redirect URI. This is the oldest #995 cutover item — it blocks core-trio federated logins through the gateway hostname too, not just the downstream apps.
  • Origin checks/allowlists: consumers of exact-match host validation (#651) and the CORS rule set (#1096) need the gateway origin allowlisted where rules are explicit.
  • campus.audit AUDIT_UI_URL (dev): re-point to the gateway-hosted audit UI path once campus-admin's remap lands it at /admin/audit (otherwise audit's /audit/* UI redirects keep escaping to admin's own domain).

Per-app flip ordering (agreed)

For each app: additive steps first (namespaced routes, cookie name, registry entries), then the switch — PUBLIC_URL → gateway origin (and any UI links) as the last step per app, verified per app. Never flip PUBLIC_URL before its registry entry exists: full_url_for builds the OAuth callback from PUBLIC_URL, so the flip and the registry entry are one atomic cutover per app.

Dominant language
Python
Stars
0
Forks
2
Avg merge
39m
Merged PRs (30d)
235

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nyjc-computing/campus

All issues in nyjc-computing/campus

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.