Skip to content

Self-host: local console sign-in without Cloudflare Access (follow-up to #95 / #104) #105

Description

@b3nw

#104 shipped the Docker self-host profile (thanks!) and listed console sessions as its main v1 limitation:

Self-host v1 has no console sessions (Cloudflare Access absent); documented as a limitation with the admin-API workflow. A token-based console login could follow if demand materializes.

Registering that demand. Running the profile from #95, the admin bearer-token API covers scripted management, but day-to-day operation wants the console: policy/grant editing, readiness, usage, playground, and the self-service maintainer keys from #103 are all dead in a browser because the dashboard fail-closes without an Access identity.

Proposal — the token-based login sketched in #104, kept minimal:

  • POST /v1/session/login exchanges the existing admin token (verified against CLAWROUTER_ADMIN_TOKEN_SHA256 — no new secrets) for a KV-backed, HttpOnly session cookie; POST /v1/session/logout revokes it. Sign-in attempts rate limited.
  • verifiedAccessSession resolves the cookie alongside Cloudflare Access, so every session consumer (dashboard, playground, /v1/session/*, maintainer keys) works unchanged.
  • Fail-closed on managed deployments: requires an explicit CLAWROUTER_LOCAL_AUTH flag and is refused whenever CLAWROUTER_ACCESS_* is configured. Cloudflare path untouched.
  • Console renders a sign-in form when the session bootstrap 401s and the service index advertises the login endpoint.

Have this implemented and verified end-to-end (workerd + headless-browser flow, full CI green on my fork); PR to follow.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerThis issue is about auth, provider routing, model choice, or SecretRef resolution.impact:securityThis issue is about security boundaries, credentials, authz, sandboxing, or sensitive data.impact:ux-frictionUser-facing flow adds avoidable confusion or support burden without fully blocking progress.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions