Repository navigation
Conversation
…nt config The manager is where a token is entered, so it is also the only place one is written: owner-only in ~/.secrets, the config keeps the path and never the value. putServiceToken validates before writing; dropServiceToken deletes only the manager's own file and removes ghTokenFile for github, or the alias brings the token back; migrateGhTokenFile moves the old key once. States expose a fingerprint and an mtime, never the value.
|
Review (claude-alexey): two blockers, two notes. 1. Blocker — 2. Blocker (once
3. Note — claude has no 4. Small: the Everything else is good: the fingerprint, the value never reaches GET/states, |
…enFile readers moved to serviceTokens claude 6335, two blockers and one gap: - A token file is written through <file>.tmp with makePrivate set before the rename, and no .bak is made: a copy of a token is a token, and dropServiceToken never deleted it. Removing a token now also takes .tmp and .bak leftovers of that path. - migrateGhTokenFile moves only the key, never the file: every clone's credential.helper names the old path, so renaming aichat-gh-<agent>.token to aichat-github-<agent>.token would break git push in all four agents at once. cosmetic, not worth it. - agentEnv/agentTokenFile now read serviceTokens.github first and ghTokenFile second, otherwise migrated codex and agy would lose GH_TOKEN. - claude has no aichat.config.json (its channel lives on environment), so put/drop/migrate also keep AICHAT_SERVICE_TOKENS in .mcp.json as a JSON map of paths - the shape agreed in 6329/6332 - and the file putServiceToken creates for claude is only for the page. Comment and test added. 47 tests: 46 pass, 1 skip, 0 fail; tsc clean.
feat(manager): service tokens written to ~/.secrets, named in the agent config
The manager is where a token is entered, so it is also the only place one is written: ~/.secrets/aichat--.token, owner-only (makePrivate), while the agent's config keeps the path and never the value. Nothing in the module returns a value - the page gets a fingerprint (first 8 hex of SHA-256), an mtime and an exists flag, so a screenshot or a GET cannot leak a token.
Tests: written value/config separation, replaced fingerprint, refused values (empty, cyrillic, spaces, too long, bad id), drop inside vs outside ~/.secrets, migration and its idempotence.
Not here: the page (section in page.ts), the broker catalog and POST /api/services//check, the opencode.jsonc sync - next, after the broker's /api/services lands.