feat(relay): OAuth authorization endpoint + neobrutal consent UI (MM-76)
Implements GET /oauth/authorize and POST /oauth/authorize for the
authorization code flow with PKCE enforcement and a server-rendered
consent screen.
GET validates client_id, redirect_uri, response_type=code, and
code_challenge_method=S256; renders a neobrutal HTML consent page
showing the client name and requested scopes. Errors that make
redirecting unsafe (unknown client, mismatched redirect_uri) return
an HTML error page instead of a redirect.
POST re-validates all parameters against the DB (hidden form fields
could be tampered with), generates a 43-char base64url authorization
code, stores it in oauth_authorization_codes with a 60-second TTL,
and redirects to redirect_uri?code=...&state=.... Denial redirects
with error=access_denied.
Also adds store_authorization_code and get_single_account_did to
db/oauth.rs; 21 new tests across the DB and route layers.
authored by
malpercio.dev
and committed by