mirror of
https://github.com/hanzoai/id-worker.git
synced 2026-10-30 18:33:58 +00:00
* corona→corona: academic Corona now only in lp-220-p3q-corona
* chore: restore upstream attribution + NOTICE (OSS compliance)
* auth: migrate front-door worker IAM calls to canonical /v1/iam/*
Every IAM-targeted path the hanzo.id/lux.id/zoo.id/pars.id front-door
worker emits now uses the canonical /v1/iam/* surface (HIP-0111), off the
legacy /api/*, /login/oauth/*, and bare /oauth/* shapes. Proven against
the IAM router: PathRewriteFilter collapses /api/<ep>->/v1/iam/<ep> and
the oauth aliases ->/v1/iam/oauth/<ep>; every target route exists.
Emitted-path changes (worker.js):
- inline login JS: /api/get-app-login->/v1/iam/get-app-login;
social ->/v1/iam/oauth/authorize; password+web3 ->/v1/iam/login
- inline signup JS: get-app-login, social ->/v1/iam/oauth/authorize;
web3 ->/v1/iam/login; /api/signup->/v1/iam/signup
- inline forgot JS: get-app-login; /api/send-verification-code
->/v1/iam/send-verification-code
- platform+MPC IAM callback token exchange: /api/login/oauth/access_token
->/v1/iam/oauth/token
- /oauth/{token,introspect,revoke,userinfo,logout} public facades now hop
to /v1/iam/oauth/{token,introspect,revoke,userinfo,logout} internally
- /callback social handler: /api/login->/v1/iam/login
- provider-aware authorize handler now matches the canonical
/v1/iam/oauth/authorize (and legacy /login/oauth/authorize), targets
IAM /v1/iam/oauth/authorize, keeps the _oauth_ctx cookie + branded page
- /logout: /api/logout->/v1/iam/logout
Kept (worker public contract; IAM canonicalizes inbound): the worker own
/oauth/* facade routes, the OIDC discovery rewrite, and IAM_PATHS legacy
inbound tolerance. Untouched (separate concern, flagged): the github.com
platform OAuth bridge.
Verified per brand (hanzo/lux/zoo/pars) with Playwright network
interception against worker.js under workerd (wrangler dev, local):
login renders -> password POST hits /v1/iam/login -> Google button
-> /v1/iam/oauth/authorize?provider=provider-google; zero /api/* and
zero bare /oauth/authorize across the session. /oauth/token facade probe
returns IAM token-endpoint JSON (invalid_client), proving the
/v1/iam/oauth/token hop is live. 36/36 + 7/7 checks pass.
---------
Co-authored-by: zeekay <[email protected]>
23 lines
907 B
TOML
23 lines
907 B
TOML
# PREVIEW-ONLY config — publishes to *.workers.dev with NO production routes.
|
|
# Used to validate the /v1/iam/* canonical-path migration without touching
|
|
# the live hanzo.id / lux.id / zoo.id / pars.id front door.
|
|
# Deploy: wrangler deploy -c wrangler.preview.toml
|
|
# Brand under test is selected via IAM_DEFAULT_ORG (workers.dev host has no
|
|
# tenant-catalog entry, so it falls back to this default).
|
|
name = "hanzo-id-worker-preview"
|
|
main = "src/worker.js"
|
|
compatibility_date = "2024-01-01"
|
|
workers_dev = true
|
|
|
|
# NO `routes` block — this is the whole point. Preview is isolated on
|
|
# workers.dev and can never bind a production hostname.
|
|
|
|
[vars]
|
|
IAM_ORIGIN = "https://iam.hanzo.ai"
|
|
|
|
# Brand selector for the preview. Override per deploy to render each brand:
|
|
# wrangler deploy -c wrangler.preview.toml --var IAM_DEFAULT_ORG:lux
|
|
IAM_DEFAULT_ORG = "hanzo"
|
|
|
|
MARKETING_ORIGIN = "https://hanzo-id.pages.dev"
|