Repository navigation
Releases
Releases · togo-framework/dashboard
Dashboard v0.10.1
Security hardening from the v0.9.0 gate backlog (#4, PR #7).
- Outbound SMTP is time-bounded (10s dial, 30s overall) and
POST /api/dashboard/admin/mail/testis limited to 5 requests per minute (429 with Retry-After). - SMTP test failures report a fixed message per stage (connect, tls, auth, send) and a
stagefield; detail stays in the server log. 5xx responses show generic text in the UI. - The generic admin client sends the CSRF token on mutations, accepts only resources listed in
NEXT_PUBLIC_TOGO_RESOURCESand encodes ids. Apps must list their admin tables in that variable (it already drove the resource list). - Host comparison is ASCII-only, host and username are trimmed on save, and omitting
usernameon PUT keeps the stored login.
The known limitations listed in v0.10.0 still apply.
Dashboard v0.10.0
⚠️ Known limitations: read before upgrading
- Split-origin login regression.
- The dashboard page guard reads the
togo_sessioncookie from the request that reaches Next.js. The default same-origin/apirewrite provides that cookie. - With a cross-origin
NEXT_PUBLIC_API_ORIGIN, the cookie is set on the API's origin only, so every visitor is sent to/login, even whenDASHBOARD_REQUIRED_ROLEis unset. - Deployments that serve the API from a different origin than the web app should not upgrade until this is resolved. Same-origin deployments are unaffected.
- The dashboard page guard reads the
- An administrator who is impersonating someone can still open the page shell.
- Impersonation issues a bearer token only and never replaces the browser cookie, so the administrator's own session still opens the dashboard pages.
- Data APIs authorize the impersonation bearer independently.
What's new
- Opt-in
DASHBOARD_REQUIRED_ROLE(API environment) restricts every page underweb/app/(app)(including/profile) to accounts holding that role (#5, #6).- Unset or blank (the default): any signed-in account, as in v0.9.0.
- Set (e.g.
admin): role membership is checked against the database on every request.- API tokens (PATs) and impersonated sessions are refused even when the account holds the role.
- The setting is read when the API boots, so changing it needs a restart.
GET /api/dashboard/accessanswers 204 when the caller is allowed, 401 when they need to sign in and 403 when they are forbidden. The response is alwaysCache-Control: no-store, private.- Server-side
DashboardGatein the(app)layout and on every(app)page denies hard loads, RSC requests, prefetches and soft navigations.- The Next server forwards only
togo_session, and only to the server-sideAPI_ORIGIN. - Timeouts, unexpected answers and an invalid
API_ORIGINfail closed.
- The Next server forwards only
What it does not do
- It is not the data boundary. Each API still enforces its own authorization.
/api/_meta/*,/graphqland/eventsare not covered by this setting. - It does not hide the UI code. The compiled client bundles under
/_next/staticremain publicly downloadable. They expose UI, endpoint and field names, but no data. - Unsetting the variable is a security downgrade, not a rollback.
Requirements
togo-framework/authv0.10.0, already pinned.- No migrations.
Verification
- CI on the merged head:
goandwebboth green. Thewebjob runs the end-to-end page-guard suite. - End-to-end page-guard suite: every
(app)route, requested as a hard load, an RSC request, a prefetch and a soft navigation, by anonymous, forged, PAT, impersonated, non-admin and admin callers, plus demotion, deletion and the unset role (395/395). - Gate-coverage test: fails if any
(app)page renders outsideDashboardGate. - Security review: an independent review found no bypass. All three of its findings were fixed before the merge.
Full diff: v0.9.0...v0.10.0