You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3dc0dc3
Browse filesBrowse the repository at this point in the historyBrowse files
feat(auth): server-rendered consent and logout pages
auth-service serves its consent and logout pages itself, as Topcoat pages
with plain forms, instead of SvelteKit pages calling JSON endpoints.
- piquel-ui (crates/ui): Topcoat components and layouts that render plain
data and take URLs as props.
- web/: thin page handlers, mounted with route_service on the paths
routes.rs declares. They call the consent and logout logic in-process
and answer 303, or render why they cannot.
- A page security class: forms only from auth's own pages (the shared
same-origin rule), its own rate budget, a per-page CSP whose form-action
names the redirect target (or a link onwards when no policy can), and
Topcoat's body limit set to 64 KiB.
- The shared stylesheet and the SDK, which gains a tsc build step, are
embedded under content-addressed /assets/ paths and cached forever.
The SDK keeps the consent form from posting twice.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,9 +22,9 @@ just build
22
22
```
23
23
24
24
The executable is `target/release/auth-service`. Auth assets are embedded at compile
25
-
time; rebuild Rust after changing `apps/auth-web`. piquel.fr's settings server builds to
26
-
`apps/piquel-web/build` and runs on Node (see its README). Auth needs Node only
27
-
to build its pages.
25
+
time; rebuild Rust after changing `apps/auth-web` or `packages/auth-sdk`. piquel.fr's
26
+
settings server builds to `apps/piquel-web/build` and runs on Node (see its README).
27
+
Auth needs Node only to build its sign-in pages and the SDK script.
28
28
29
29
## Development
30
30
@@ -422,8 +422,10 @@ explains how to choose a requirement and handle the challenge.
422
422
- Browser state and opaque secrets are random, hashed where lookup is needed, and
423
423
bound to the initiating browser. Auth cookies are host-only, Secure and HttpOnly.
424
424
Mutations require an exact allowed origin and CSRF header; OIDC back-channel
425
-
endpoints instead validate their protocol credentials.
426
-
- Request throttling and expiring-state cleanup use PostgreSQL. Throttling uses separate login, token, userinfo and account budgets per client IP, and covers every API route except health probes and discovery.
425
+
endpoints instead validate their protocol credentials. A form posted to one of
426
+
auth's server-rendered pages must come from auth's own pages: `Sec-Fetch-Site:
427
+
same-origin`, or the auth origin when the browser sends no `Sec-Fetch-Site`.
428
+
- Request throttling and expiring-state cleanup use PostgreSQL. Throttling uses separate login, token, userinfo, account and page budgets per client IP, and covers every API route except health probes and discovery.
427
429
By default it uses the direct peer IP; only peers in `AUTH_TRUSTED_PROXIES`
428
430
may supply a single overwritten `X-Forwarded-For`. Configure this when terminating TLS
429
431
at a reverse proxy so users do not share the proxy’s budget. Untrusted headers
0 commit comments