Files
Kaname/src/lib/token-scopes.ts
T
Pascal LinxweilerandClaude Opus 5.5 7b1c8070b3 API for agents: tokens, /api/v1, guardrails, approval
- Scoped bearer tokens (models:read, downloads:create), stored as SHA-256, managed in
  Settings -> API tokens. Only /api/v1 accepts them; the rest stays OIDC-only.
- /api/v1: Hub lookup, library list with the search filters, download requests through the
  existing add-model/queue path (idempotent), compact job status, disk space.
- Guardrails: approval mode (default approve), max size per request, minimum free space incl.
  reserved bytes, max open agent jobs, author allowlist. Approve/reject in the UI; "requested by"
  shown and filterable.
- docs/api.md (incl. Traefik forward-auth bypass), docs/agent/SKILL.md, DB-backed API tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 16:14:45 +02:00

9 lines
343 B
TypeScript

// What each API token scope allows, for the settings UI. Pure, safe for the browser.
import type { TokenScope } from "@/lib/db/schema";
export const SCOPE_LABEL: Record<TokenScope, string> = {
"models:read": "Look up Hub repos, list models, read jobs and disk space",
"downloads:create": "Request downloads (within the guardrails)",
};