feat: add the logo, and point people at the plugin before they mint a token #15

Merged
jknapp merged 1 commits from feat/logo-and-tokens-copy into main 2026-07-27 13:22:52 +00:00
7 changed files with 92 additions and 1 deletions
Showing only changes of commit 6b28e1d6c8 - Show all commits
+6
View File
@@ -40,6 +40,12 @@ OIDC_CLIENT_ID_WEB=replace-me
OIDC_CLIENT_SECRET_WEB=replace-me OIDC_CLIENT_SECRET_WEB=replace-me
OIDC_CLIENT_ID_MCP=replace-me OIDC_CLIENT_ID_MCP=replace-me
OIDC_AUDIENCE=shared-memory OIDC_AUDIENCE=shared-memory
# Marketplace this instance's Claude Code plugin is published from. When set,
# the CLI tokens page shows the one-command plugin install so people only mint
# a bearer token when a browser sign-in genuinely isn't possible.
#PLUGIN_MARKETPLACE_URL=https://your-git-host/you/shared-memory.git
#PLUGIN_MARKETPLACE_NAME=shared-memory
# Scope whose IdP mapping emits `aud: <OIDC_AUDIENCE>`. Advertised in # Scope whose IdP mapping emits `aud: <OIDC_AUDIENCE>`. Advertised in
# /.well-known/oauth-protected-resource so MCP clients request it — without # /.well-known/oauth-protected-resource so MCP clients request it — without
# that, Authentik never evaluates the mapping and every token 401s with # that, Authentik never evaluates the mapping and every token 401s with
+2
View File
@@ -145,6 +145,8 @@ Copy `.env.example` and fill in the values below.
| `OIDC_CLIENT_ID_MCP` | both | Client ID of the MCP resource-server client in your IdP. | | `OIDC_CLIENT_ID_MCP` | both | Client ID of the MCP resource-server client in your IdP. |
| `OIDC_AUDIENCE` | both | Audience string the MCP access token must carry in its `aud` claim. Recommended: `shared-memory`. | | `OIDC_AUDIENCE` | both | Audience string the MCP access token must carry in its `aud` claim. Recommended: `shared-memory`. |
| `OIDC_ISSUER_MCP` | optional | Issuer of MCP access tokens when the MCP endpoint is a separate IdP application (Authentik stamps each app's tokens with its own slug). Defaults to `OIDC_ISSUER`. | | `OIDC_ISSUER_MCP` | optional | Issuer of MCP access tokens when the MCP endpoint is a separate IdP application (Authentik stamps each app's tokens with its own slug). Defaults to `OIDC_ISSUER`. |
| `PLUGIN_MARKETPLACE_URL` | optional | Marketplace URL for this instance's plugin. Shown as a one-command install on the CLI tokens page. Hidden when unset. |
| `PLUGIN_MARKETPLACE_NAME` | optional | Marketplace name used in `shared-memory@<name>`. Defaults to `shared-memory`. |
| `OIDC_AUDIENCE_SCOPE` | optional | Name of the IdP scope whose mapping emits that `aud` claim. Advertised in `scopes_supported` so clients request it. Defaults to `aud-<OIDC_AUDIENCE>`. | | `OIDC_AUDIENCE_SCOPE` | optional | Name of the IdP scope whose mapping emits that `aud` claim. Advertised in `scopes_supported` so clients request it. Defaults to `aud-<OIDC_AUDIENCE>`. |
| `POSTGRES_USER` / `POSTGRES_PASSWORD` / `POSTGRES_DB` | both | Local Postgres credentials. | | `POSTGRES_USER` / `POSTGRES_PASSWORD` / `POSTGRES_DB` | both | Local Postgres credentials. |
| `NEXTAUTH_SECRET` | both | Session-cookie signing key. Generate with `openssl rand -base64 32`. | | `NEXTAUTH_SECRET` | both | Session-cookie signing key. Generate with `openssl rand -base64 32`. |
+44 -1
View File
@@ -108,6 +108,44 @@ async function revokeTokenAction(formData: FormData) {
revalidatePath("/settings/tokens"); revalidatePath("/settings/tokens");
} }
/**
* Points people at the plugin before they mint a token they don't need.
*
* Rendered only when this instance knows which marketplace it's published
* from — showing a copyable command that points nowhere is worse than showing
* nothing.
*/
function PluginHint({
marketplaceUrl,
marketplaceName,
}: {
marketplaceUrl: string | undefined;
marketplaceName: string;
}) {
if (!marketplaceUrl) return null;
return (
<Card className="mb-6">
<CardHeader className="text-sm font-medium text-fg">
If this machine has a browser, install the plugin instead
</CardHeader>
<CardBody>
<p className="text-sm text-fg-muted mb-3">
The plugin signs you in through {" "}
<span className="text-fg">your usual login</span>, so there&apos;s no
token to copy, store, or rotate. Generate a token below only when a
browser sign-in isn&apos;t possible.
</p>
<pre className="text-xs !whitespace-pre-wrap !break-all select-all">
{[
`claude plugin marketplace add ${marketplaceUrl}`,
`claude plugin install shared-memory@${marketplaceName}`,
].join("\n")}
</pre>
</CardBody>
</Card>
);
}
export default async function TokensPage() { export default async function TokensPage() {
const session = await auth(); const session = await auth();
const userId = session!.user.id; const userId = session!.user.id;
@@ -144,7 +182,12 @@ export default async function TokensPage() {
<Container className="pt-6 max-w-3xl"> <Container className="pt-6 max-w-3xl">
<PageHeader <PageHeader
title="CLI tokens" title="CLI tokens"
description={`Long-lived bearer tokens for MCP clients without browser access. ${ttlDays}-day expiry per token.`} description={`For machines that can't complete a browser sign-in — headless containers, CI runners, sealed devboxes. Tokens last ${ttlDays} days and can be revoked one at a time.`}
/>
<PluginHint
marketplaceUrl={env().PLUGIN_MARKETPLACE_URL}
marketplaceName={env().PLUGIN_MARKETPLACE_NAME}
/> />
<Card className="mb-6"> <Card className="mb-6">
+16
View File
@@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="shared-memory">
<title>shared-memory</title>
<rect width="64" height="64" rx="14" fill="#11151b"/>
<!--
Three retrieval signals - vector, full-text, tags - converging on a single
memory. The direct match runs straight through at full strength; the two
ranked neighbours fall back, which is the fusion the search actually does.
Opacity is held equal on the outer pair so the mark stays balanced at 16px.
-->
<g fill="none" stroke-linecap="round" stroke-width="7">
<path d="M13 15C25 15 26 32 35 32" stroke="#0092fd" opacity=".55"/>
<path d="M13 32H35" stroke="#49a9ff"/>
<path d="M13 49C25 49 26 32 35 32" stroke="#0092fd" opacity=".55"/>
</g>
<circle cx="45" cy="32" r="7.5" fill="#76c0ff"/>
</svg>

After

Width:  |  Height:  |  Size: 847 B

+8
View File
@@ -67,6 +67,13 @@ const envSchema = z.object({
// every issued CLI token at once. // every issued CLI token at once.
CLI_TOKEN_SECRET: z.string().min(32, "CLI_TOKEN_SECRET must be at least 32 chars"), CLI_TOKEN_SECRET: z.string().min(32, "CLI_TOKEN_SECRET must be at least 32 chars"),
// Plugin marketplace this instance is published from. When set, the CLI
// tokens page shows the one-command plugin install, so people only mint a
// bearer token when their machine genuinely can't complete a browser
// sign-in. Left unset, that hint is hidden rather than shown wrong.
PLUGIN_MARKETPLACE_URL: optional(z.string().url()),
PLUGIN_MARKETPLACE_NAME: z.string().min(1).default("shared-memory"),
// Behavior flags // Behavior flags
ALLOW_INSECURE_HTTP: Bool.optional().default(false), ALLOW_INSECURE_HTTP: Bool.optional().default(false),
}); });
@@ -110,6 +117,7 @@ function buildPhaseStub(): Env {
EMBEDDING_DIM: 384, EMBEDDING_DIM: 384,
NEXTAUTH_SECRET: "build-phase-secret-not-used-at-runtime-xxxxxxxx", NEXTAUTH_SECRET: "build-phase-secret-not-used-at-runtime-xxxxxxxx",
CLI_TOKEN_SECRET: "build-phase-secret-not-used-at-runtime-xxxxxxxx", CLI_TOKEN_SECRET: "build-phase-secret-not-used-at-runtime-xxxxxxxx",
PLUGIN_MARKETPLACE_NAME: "shared-memory",
ALLOW_INSECURE_HTTP: false, ALLOW_INSECURE_HTTP: false,
}; };
} }
+14
View File
@@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64" role="img" aria-label="shared-memory">
<title>shared-memory</title>
<!--
Transparent, currentColor variant of the mark for in-app use - inherits
the surrounding text color so it works on any surface. The tile version
used as the favicon lives at app/icon.svg.
-->
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-width="7">
<path d="M13 15C25 15 27 32 37 32" opacity=".45"/>
<path d="M13 32H37"/>
<path d="M13 49C25 49 27 32 37 32" opacity=".7"/>
</g>
<circle cx="43" cy="32" r="8" fill="currentColor"/>
</svg>

After

Width:  |  Height:  |  Size: 648 B

+2
View File
@@ -117,6 +117,8 @@ services:
# added to .env but not listed here never reaches the container. # added to .env but not listed here never reaches the container.
OIDC_ISSUER_MCP: ${OIDC_ISSUER_MCP:-} OIDC_ISSUER_MCP: ${OIDC_ISSUER_MCP:-}
OIDC_AUDIENCE_SCOPE: ${OIDC_AUDIENCE_SCOPE:-} OIDC_AUDIENCE_SCOPE: ${OIDC_AUDIENCE_SCOPE:-}
PLUGIN_MARKETPLACE_URL: ${PLUGIN_MARKETPLACE_URL:-}
PLUGIN_MARKETPLACE_NAME: ${PLUGIN_MARKETPLACE_NAME:-shared-memory}
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB} DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}