Skip to content

fix: enforce per-owner agent token quotas - #1286

Merged
Dumbris merged 1 commit into
mainfrom
codex/fix-per-owner-token-quota
Sep 16, 2026
Merged

Dumbris merged 1 commit into
mainfrom
codex/fix-per-owner-token-quota

Conversation

@Dumbris

@Dumbris Dumbris commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Enforce a 25-record per-owner agent-token quota in server edition.
  • Retain the existing 100-record deployment cap as the storage backstop.
  • Count revoked records until permanent deletion, preventing mint/revoke storage growth.
  • Keep ownerless personal-edition behavior unchanged.
  • Return an actionable HTTP 409 response when an owner exhausts their quota.

Security impact

Previously, any authenticated server-edition tenant could consume all 100 shared token slots and deny token creation to every other tenant, including administrators. The per-owner quota reserves capacity for at least four fully provisioned owners while preserving the deployment-wide storage bound.

Verification

  • Added focused storage and server-edition HTTP regression tests.
  • Ran storage token tests under the race detector.
  • Ran the broader storage, authentication, HTTP API, and server-edition package suites.
  • Ran go vet for the affected personal- and server-edition packages.
  • Built the personal- and server-edition binaries.
  • Tested a real isolated server-edition instance on localhost:
    • Readiness returned HTTP 200.
    • Tenant A token creations 1–25 returned HTTP 201.
    • Tenant A token 26 returned HTTP 409 with permanent-delete guidance.
    • Tenant B's first token still returned HTTP 201.
  • Passed repository pre-commit and pre-push hooks.
  • Passed all required GitHub checks.

Closes #1177

@cloudflare-workers-and-pages

Copy link
Copy Markdown

@Dumbris Dumbris changed the title Enforce per-owner agent token quotas fix: enforce per-owner agent token quotas Sep 16, 2026
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 66.66667% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/storage/agent_tokens.go 75.00% 3 Missing and 3 partials ⚠️
internal/httpapi/tokens.go 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: codex/fix-per-owner-token-quota

Available Artifacts

  • archive-darwin-amd64 (30 MB)
  • archive-darwin-arm64 (27 MB)
  • archive-linux-amd64 (18 MB)
  • archive-linux-arm64 (16 MB)
  • archive-windows-amd64 (30 MB)
  • archive-windows-arm64 (26 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (24 MB)
  • installer-dmg-darwin-arm64 (21 MB)
  • smart-mcp-proxymcpproxy-goMYWQJ4.dockerbuild (0 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 35069967458 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris
Dumbris merged commit b1777e8 into main Sep 16, 2026
43 of 44 checks passed
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.

Server edition: auth.MaxTokens is a global 100-token cap, so one tenant can exhaust agent-token slots for the whole deployment

2 participants