feat(api-keys): validate outbound API keys at startup and before each…#3
Open
fricigliano wants to merge 1 commit into
Open
feat(api-keys): validate outbound API keys at startup and before each…#3fricigliano wants to merge 1 commit into
fricigliano wants to merge 1 commit into
Conversation
… run Add active validation of the keys the pipeline uses to call external services (OpenAI, Bigdata.com), so a revoked/mistyped key surfaces as a clear, actionable error instead of failing deep inside a long run. - key_health.py: probe OpenAI (models.list, no tokens) and Bigdata (light authenticated KG call). Distinguish rejected (401/403) from unreachable; TTL-cached so a large batch probes upstream at most once per minute. - Startup: log one line per key in the FastAPI lifespan (non-blocking). - GET /health/keys: cached per-key status, 503 if any key is rejected. Kept separate from /health (liveness must not depend on upstreams). - Preflight before fan-out: batch_run_parallel and start_scan raise a 503 with the offending key; stateless MCP start_briefs_run returns ERROR. - Stateful MCP _api now surfaces the server's `detail` so the client sees the real reason instead of a bare "503 Server Error". Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… run
Add active validation of the keys the pipeline uses to call external services (OpenAI, Bigdata.com), so a revoked/mistyped key surfaces as a clear, actionable error instead of failing deep inside a long run.
detailso the client sees the real reason instead of a bare "503 Server Error".