Repository navigation
Conversation
- tests for engine, provider, controller, rate limit, config, registry and usage with the LLM stubbed - GitHub Actions workflow running pytest and the Astro build - bounded upload read, threadpool execution of the blocking provider call, failure logging - untrusted-input notice appended to every prompt - rate limiter sweeps stale client entries
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.
Summary
api/tests, 62 cases, LLM stubbed): file -> engine -> provider -> schema flow end to end through the HTTP API; invalid config (bad numeric env, non-JSONALLOWED_ORIGINS); error paths (unknown product, empty/oversized file, unsupported MIME, provider failure, malformed or schema-violating model output, retry/backoff in the Gemini provider); rate limiting; CORS; hostile slugs; usage tracking failure handling..github/workflows/ci.yml):api-tests(Python 3.12, pytest) andweb-build(Node 22,npm ci+npm run build) on pull requests and pushes tomain. Read-only permissions.max_upload_bytes + 1) instead of fully into memory before the size check.Security review: findings not implemented (would change behavior or need a decision)
request.client.host, which behind a proxy may be the proxy address, so all users could share one bucket. Fixing it means trustingX-Forwarded-For(spoofable unless the proxy hop is configured). Needs a deployment decision.Content-Type: bytes are not sniffed. Rejecting mismatches could break clients that send a wrong type today.*and.env.exampleships it. RestrictALLOWED_ORIGINSin production./statsis unauthenticated and exposes per-product usage counts. Adding auth changes the public interface.notes,vendor,description, ...) can still carry attacker-controlled text from the file. Downstream consumers (the web UI, the distributor integration) must treat them as untrusted and escape them. The prompt notice reduces, not eliminates, the risk.>=); consider a lock file for reproducible builds and audits.HTTP_413_REQUEST_ENTITY_TOO_LARGEis deprecated in current Starlette (only a warning today).Path handling: the API never touches the filesystem with user input; the product slug is only a dict lookup and uploads stay in memory. Tests cover traversal-style slugs.
Verification
python -m pytest -qinapi/: 62 passed (Python 3.13 locally; CI pins 3.12).npm ci && npm run buildinweb/: 15 pages built.