Skip to content

1A: API Key Authentication Client - #4

Merged
atc964 merged 4 commits into
mainfrom
feature/api-key-auth
Mar 9, 2026
Merged

1A: API Key Authentication Client#4
atc964 merged 4 commits into
mainfrom
feature/api-key-auth

Conversation

@atc964

@atc964 atc964 commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds ApiKeyStore for secure per-seller API key storage (file-backed, encrypted at rest)
  • Adds AuthMiddleware for automatic header attachment (X-Api-Key or Bearer mode)
  • Handles 401 reauth flow

Bead

buyer-jin

Tests

129/129 passed, Quinn VERIFIED

🤖 Generated with Claude Code

atc964 and others added 4 commits March 8, 2026 16:10
Adds inbound API key validation via X-API-Key header on all endpoints
except /health, /docs, /openapi.json, and /redoc. Auth is disabled when
the api_key setting is empty (default), enabling frictionless local
development. Includes 8 new tests covering auth-enabled and
auth-disabled scenarios.

bead: ar-czw

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements ApiKeyStore (file-backed, base64-encoded key storage per
seller URL) and AuthMiddleware (attaches X-Api-Key or Bearer headers
to outgoing httpx requests, detects 401 for key rotation). Includes
20 unit tests covering CRUD, persistence, header attachment, URL
normalization, and 401/403 response handling.

bead: buyer-jin

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@atc964
atc964 merged commit c69543e into main Mar 9, 2026
@atc964
atc964 deleted the feature/api-key-auth branch March 9, 2026 18:05
aleksUIX pushed a commit to aleksUIX/buyer-agent that referenced this pull request Jul 26, 2026
…Lab#4 deleted)

interfaces/chat/main.py no longer defines the four inline CrewAI booking
tools (MultiSellerSearchTool, CallSellerToolTool, BookPGDealTool,
CreatePMPDealTool) that spoke a bespoke seller-MCP dialect and surfaced
seller-minted-or-fake ids outside the canonical contract.

Replacement: two THIN wrappers over MultiSellerOrchestrator —
- request_quotes: discover -> quote -> rank preview (no money committed)
- book_deals: full orchestrate within a hard budget bound; every Deal ID
  in the output is SELLER-issued.

Discovery is seeded from configured SELLER_ENDPOINTS via a small
AgentCard adapter (quoting/booking still run the real quotes -> deals
contract); with no endpoints configured the default registry-backed
orchestrator is used. ChatInterface public surface (constructor,
process_message, get_connected_sellers, close) is unchanged.

New tests/unit/test_chat_canonical_tools.py: delegation + budget bound,
preview-never-books, registry adapter, and a guard that the four rival
tools stay dead.

bead: ar-j2nw

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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