Skip to content

fix(BUY-8065): add Paperclip JWT auth to TypeScript API middleware#34

Open
BuyWhere wants to merge 11 commits intomainfrom
fix/BUY-8065-paperclip-jwt
Open

fix(BUY-8065): add Paperclip JWT auth to TypeScript API middleware#34
BuyWhere wants to merge 11 commits intomainfrom
fix/BUY-8065-paperclip-jwt

Conversation

@BuyWhere
Copy link
Copy Markdown
Owner

@BuyWhere BuyWhere commented May 3, 2026

Summary

  • Add Paperclip JWT token detection and verification to TypeScript API middleware
  • Auto-provision agent API keys on first valid Paperclip token (enterprise tier)
  • Reuse provisioned keys on subsequent calls via signup_channel lookup
  • Replace inline error responses with structured sendError/sendRateLimitError
  • Add db migration step to deploy workflow

Fixes BUY-8065

Cherry-picked from richmondteo-code/buywhere-catalog-api#4

Bolt (VP DevOps) and others added 11 commits May 1, 2026 12:43
…thog.ts, rebuild dist files, fix Node.js MCP healthz endpoint (BUY-5978)
Previously call_tool extracted the API key from the ApiKey model
using key_hash, which is a bcrypt hash — not usable as a bearer
token for downstream calls. Extract the raw Authorization header
Bearer value instead, matching what the client actually sent.

Fixes BUY-5978

Co-Authored-By: Paperclip <noreply@paperclip.ing>
…I_KEY

Co-Authored-By: Paperclip <noreply@paperclip.ing>
… @buywhere/mcp-server

- Remove 'not yet published' callout and STDIO 'coming soon' text
- Add local package install path (npx -y @buywhere/mcp-server)
- Add STDIO config examples for Claude Desktop and Cursor alongside HTTP transport

Co-Authored-By: Paperclip <noreply@paperclip.ing>
…p-server

- Remove 'not yet published' callout and 'coming soon' STDIO text
- Add local package install path (npx -y @buywhere/mcp-server)
- Add STDIO config examples for Claude Desktop and Cursor alongside HTTP transport
- Remove duplicate 'Configure Cursor' section that was an accidental copy-paste

Co-Authored-By: Paperclip <noreply@paperclip.ing>
…conf

Proxies /mcp/ requests to the API backend (127.0.0.1:8000) which
should have the MCP router mounted. Fixes 404 on /mcp/ after nginx
adds a trailing slash redirect.
- Detect Paperclip JWT tokens by decoding payload (iss/aud check)
- Verify tokens via GET /api/agents/me on Paperclip API
- Auto-provision agent API keys on first valid token (enterprise tier)
- Reuse provisioned keys on subsequent calls via signup_channel lookup
- Replace inline res.status().json() with structured sendError/sendRateLimitError

Co-Authored-By: Paperclip <noreply@paperclip.ing>
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