Skip to content

Stop exposing pooled accounts via /me/usage and serve the maintained status line - #2

Open
rayan-mazouz wants to merge 4 commits into
devasheeshG:mainfrom
rayan-mazouz:fix/client-surface
Open

rayan-mazouz wants to merge 4 commits into
devasheeshG:mainfrom
rayan-mazouz:fix/client-surface

Conversation

@rayan-mazouz

Copy link
Copy Markdown

Note: this PR was vibe coded.

Summary

This tightens what proxy-key holders can see and fixes the status line script that clients actually download.

Commits

  • fix(me): stop exposing pooled accounts from /me/usage. /me/usage is authenticated by any proxy user's API key, but pool.accounts listed every active account's id, label and login email. That gave every key holder the Anthropic logins behind the pool. Nothing reads the per-account list: the status line uses only the pool aggregates, the dashboard uses the admin /v1/accounts endpoints, and the menu-bar app doesn't call /me/usage. So the list is removed, and the pool aggregates are unchanged.
  • fix(clients): serve the maintained status line script. /v1/clients/claude-code-statusline.sh, which INSTALLATION_AGENTS.md tells agents to download, served backend/clients/claude-code-statusline.sh. Fixes had only been applied to the unreferenced duplicate in clients/, so the served copy lacked the atomic cache write (an outage erased the last good value) and the /api//api/v1 base-URL handling. Now there is one copy, the maintained one, in the location the backend serves.
  • fix(statusline): keep cache files private. The cache files sit in the shared temp dir under predictable names and were created world-readable. They now use umask 077.
  • refactor(clients): remove the unreferenced backend installer. The dashboard's install commands use frontend/public/install.sh/install.ps1, and nothing referenced the backend's /v1/clients/install.sh, which had drifted from them.

Testing

  • A test asserts /me/usage no longer includes accounts.
  • A test asserts the served status line matches the file in the repository and includes the atomic write and umask.
  • The full suite passes (151).

/me/usage is authenticated by any proxy user's API key, but its pool block
listed every active account's id, label, and login email. That told every
key holder which Anthropic logins back the pool. No client reads the
per-account list (the status line uses only the pool aggregates, and the
dashboard uses the admin accounts endpoints), so remove it.
The backend served backend/clients/claude-code-statusline.sh, the copy the
agent installation guide downloads, but fixes had only been applied to the
unreferenced duplicate under clients/: it lacked the atomic cache write
(so an outage erased the last good pool value) and the base-URL handling
for /api and /api/v1 bases. Keep one copy, the maintained version, where
the backend serves it.
The status line caches /me/usage responses and git state in the shared
temp directory under predictable names, created with the default umask
and therefore readable by other local users. Create them with umask 077.
The dashboard's install commands use frontend/public/install.sh and
install.ps1. Nothing referenced the separate /clients/install.sh route
served by the backend, which had drifted from the public installer.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant