Skip to content

feat(BUY-9085): add JWS-signed Agent Card at .well-known/agent.json#36

Open
BuyWhere wants to merge 15 commits intomainfrom
gate/BUY-9085-agent-card-deploy
Open

feat(BUY-9085): add JWS-signed Agent Card at .well-known/agent.json#36
BuyWhere wants to merge 15 commits intomainfrom
gate/BUY-9085-agent-card-deploy

Conversation

@BuyWhere
Copy link
Copy Markdown
Owner

@BuyWhere BuyWhere commented May 3, 2026

Summary

  • Generate ES256 keypair for buywhere.ai domain-bound identity
  • Pre-sign Agent Card with JWS compact serialization (alg:ES256, kid:buywhere-agent-card)
  • Serve signed card at .well-known/agent.json route
  • Serve JWKS public key at .well-known/jwks.json route
  • Add scripts for key generation, signing, and verification
  • Gitignore private/ directory for key material

Verification

JWS signature verified end-to-end. Payload matches canonical card JSON, signature valid against JWKS public key.

Next steps

Merge to main -> Cloud Run deployment triggers automatically.

Bolt (VP DevOps) and others added 15 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>
Merge fix/BUY-8065-paperclip-jwt into main

- Paperclip JWT auth middleware
- API key auto-provisioning for Paperclip agents
- merchants/merchant_events table migration
- Deploy workflow: add migration step, remove GAR token logic
…ript build

The middleware/errors.ts module was missing from this branch, causing
TypeScript compilation failures in apiKey.ts and developers.ts.

- Add api/src/middleware/errors.ts with ErrorCode enum, sendError,
  and sendRateLimitError helper functions
- Add corresponding compiled dist files
- Regenerate all stale dist files from successful tsc build

This is a prerequisite for the MCP Docker build (Dockerfile.mcp),
which runs tsc during image build and was failing without this module.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
- Added import for metricsRouter from ./routes/metrics
- Mounted at /admin/metrics matching existing pattern
- Route file (api/src/routes/metrics.ts) already had correct query logic

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

- Generate ES256 keypair for buywhere.ai domain-bound identity
- Pre-sign Agent Card with JWS compact serialization (alg:ES256, kid:buywhere-agent-card)
- Add src/app/.well-known/agent.json/route.ts with signed card + Cache-Control
- Add src/app/.well-known/jwks.json/route.ts for public key verification
- Add scripts/gen-agent-keys.mjs, sign-agent-card.mjs, verify-agent-card.mjs
- Ignore private/ directory for key material
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.

2 participants