Skip to content

fix(auth): nself login works against production auth_server (P7-PROD-27) - #1027

Merged
acamarata merged 2 commits into
mainfrom
feat/p7-prod-27-login-auth-host
Oct 29, 2026
Merged

acamarata merged 2 commits into
mainfrom
feat/p7-prod-27-login-auth-host

Conversation

@acamarata

Copy link
Copy Markdown
Collaborator

P7-PROD-27 (D-0083), code part.

  • Default auth host is https://auth-server.nself.org; NSELF_AUTH_SERVER_URL still overrides.
  • Device flow uses POST /auth/device-code and POST /auth/device-code/token with the server's fields and error codes (authorization_pending, slow_down adds 5 s, expired_token, access_denied).
  • The approved device token has no identity, so the account is read from GET /auth/session; if that fails the login fails and nothing is stored.
  • /account/devices and /account/team return E225 (exit 2) on a 404. E225 has its owner row and its error-codes.md row (generated by wikigen; outside the listed write scope but required by TestErrorCodesPageMatchesRegistry).
  • Contract tests use httptest and fixtures in internal/auth/testdata/auth_server/. No live calls.

Owner checks left (not run here): JWKS probe https://auth-server.nself.org/auth/.well-known/jwks.json returns 200, read-only probe of /account/devices and /account/team on both hosts, and the real production login (P7-PROD-15 recreates auth_server on prod; P7-PROD-99 proves login).

Default auth host is https://auth-server.nself.org (NSELF_AUTH_SERVER_URL
still overrides, trailing slash trimmed). The device flow uses
POST /auth/device-code and POST /auth/device-code/token with the server's
fields (verification_uri, access_token, expires_in) and error codes:
authorization_pending keeps waiting, slow_down adds 5 s, expired_token and
access_denied stop with a remediation. The approved device token carries no
identity, so PollDeviceCode reads GET /auth/session and fails the login if
that lookup fails instead of storing a blank email or a defaulted tier.

/account/devices and /account/team are served by no host: a 404 from either
returns E225 (exit 2) instead of a raw 404. Contract tests run against
fixtures taken from auth_server route shapes; nothing contacts a real host.
E225 gets its owner row and its error-codes.md row.

Fixes D-0083. (P7-PROD-27)
…h error to E225 in the command layer (P7-PROD-27)
@acamarata
acamarata force-pushed the feat/p7-prod-27-login-auth-host branch from 1e6a8a6 to fcaf126 Compare October 29, 2026 17:29
@acamarata
acamarata merged commit 10971d0 into main Oct 29, 2026
29 of 35 checks passed
@acamarata
acamarata deleted the feat/p7-prod-27-login-auth-host branch October 29, 2026 19:47
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