feat(dashboard): a link back to the platform portal #365

Merged
sharang merged 1 commits from feat/portal-link into main 2026-09-24 12:16:56 +00:00
Owner

Customers who open Prüfwerk from the platform portal had no way back. The sidebar now starts with a "Zur Plattform" / "Back to the platform" link to their workspace in the portal: <PORTAL_URL>/<tenant_slug>/dashboard.

How

  • PORTAL_URL, read at runtime. Staging and production run the same image but use different portals (app-stage. / app.breakpilot.com), so a build argument would not work. When it is unset (local development), the link is hidden. The values are set in platform/orca-platform (companion PR).
  • Tenant slug. At login the dashboard reads the tenant_slug claim from the Keycloak access token and keeps it in the session. Both realms' dashboard clients receive the claim through the default tenant-context scope. Sessions from before this change have no slug, so their link goes to the portal's start page.
  • The link. check_auth returns it in the new AuthInfo.portal_url field (#[serde(default)]). A slug that isn't plain lowercase letters, digits and dashes falls back to the start page, so a claim cannot change the path.
  • Sidebar. The link sits above the product navigation, in mono uppercase, violet on hover. When the sidebar is collapsed only the arrow shows.
  • Docs. PORTAL_URL is documented in .env.example.

Checked

  • cargo fmt --all --check.
  • clippy with the CI flags for the dashboard (server, web) and compliance-core.
  • Dashboard tests: 46 for server and 31 for web. They include new tests for reading the slug from a token and for the link, including the fallback cases.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p

Customers who open Prüfwerk from the platform portal had no way back. The sidebar now starts with a "Zur Plattform" / "Back to the platform" link to their workspace in the portal: `<PORTAL_URL>/<tenant_slug>/dashboard`. ## How - **`PORTAL_URL`, read at runtime.** Staging and production run the same image but use different portals (`app-stage.` / `app.breakpilot.com`), so a build argument would not work. When it is unset (local development), the link is hidden. The values are set in platform/orca-platform (companion PR). - **Tenant slug.** At login the dashboard reads the `tenant_slug` claim from the Keycloak access token and keeps it in the session. Both realms' dashboard clients receive the claim through the default `tenant-context` scope. Sessions from before this change have no slug, so their link goes to the portal's start page. - **The link.** `check_auth` returns it in the new `AuthInfo.portal_url` field (`#[serde(default)]`). A slug that isn't plain lowercase letters, digits and dashes falls back to the start page, so a claim cannot change the path. - **Sidebar.** The link sits above the product navigation, in mono uppercase, violet on hover. When the sidebar is collapsed only the arrow shows. - **Docs.** `PORTAL_URL` is documented in `.env.example`. ## Checked - `cargo fmt --all --check`. - clippy with the CI flags for the dashboard (`server`, `web`) and compliance-core. - Dashboard tests: 46 for server and 31 for web. They include new tests for reading the slug from a token and for the link, including the fallback cases. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang added 1 commit 2026-09-24 12:08:49 +00:00
feat(dashboard): a link back to the platform portal
CI / Check (push) Skipped
CI / Detect Changes (pull_request) Skipped
CI / Deploy Agent (pull_request) Skipped
CI / Deploy Dashboard (pull_request) Skipped
CI / Deploy Docs (pull_request) Skipped
CI / Deploy MCP (pull_request) Skipped
CI / Check (pull_request) Successful in 7m11s
d36c3e92ab
The sidebar links to the customer's workspace in the portal
(<PORTAL_URL>/<tenant_slug>/dashboard). PORTAL_URL is read at runtime,
since staging and production share an image; the slug comes from the
access token's tenant_slug claim at login and is kept in the session.
Without PORTAL_URL the link is hidden.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EYKjxacrr6K88DruUmP48p
sharang force-pushed feat/portal-link from becc4824a1 to d36c3e92ab 2026-09-24 12:08:49 +00:00 Compare
sharang merged commit 33eb46df76 into main 2026-09-24 12:16:56 +00:00
Sign in to join this conversation.