Repository navigation
fix(repo): harden gateway auth, fidelity and dashboard flows - #3
Merged
Merged
Conversation
Gateway - authenticate /v1/* in an onRequest hook before the body is parsed; rejected requests still write exactly one request_logs row (paired start/end events) - forward request bodies verbatim when normalization is a no-op, and stream the original upstream bytes (invalid UTF-8/BOM preserved), with backpressure - real total + idle timeouts for streamed bodies, client-abort propagation - refuse upstream redirects (redirect: 'manual'), forward a client header allowlist (anthropic-beta, x-stainless-*, trace headers) - rotation_strategy now implements round-robin, priority and random; cooldown skips no longer create attempt rows; fatal errors keep provider attribution; retry-after extends the provider cooldown - /v1/models* is logged like every other request; request id on every response Security - TRUST_PROXY opt-in (default false) so X-Forwarded-For can no longer bypass the dashboard login brute-force guard or forge client_ip - provider test/sync SSRF guard (PROVIDER_ALLOW_PRIVATE_HOSTS opt-in) - rotate-secret refuses with 409 when ROUTER_SECRET is set, persists before the swap, and returns cache-control: no-store - CSV export neutralises formula injection; admin 500s no longer echo internals - revoke-all sessions no longer stops at the 50 newest; login/password routes have a 4 KB body limit and a 200-char password cap Admin - per-session revoke endpoint, API key rotation, provider test with a draft baseUrl against the stored key, provider test failures recorded - stats expose exact requestsLast60s/errorsLast60s behind a short TTL cache - scheduler probes cooled-down providers; settings whitelist ignores inherited property names; log filters are validated strictly; log_store_bodies removed Dashboard - focus trap/autofocus/restore for Modal, Drawer and the mobile sidebar - keyboard-accessible log rows, no stale request detail, stable time filters, clamped pagination, time-proportional charts, working live tail in poll mode - provider id on create, draft connection test, all rotation strategies, per-session revoke UI, dirty-edit protection, secret modal survives rotation Docs/tests - SPEC/API/README/CONTRIBUTING/AGENTS/.env.example updated; Node floor 22.13 - 110 unit tests and 75 e2e acceptance checks (previously 20/51)
pnpm/action-setup@v4 rejects a workflow `version` input when package.json declares `packageManager` (Multiple versions of pnpm specified). Drop the duplicated input so package.json stays the single source of truth.
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.
What changed
Implements the full improvement pass: security hardening (spoofable
request.ip/brute-force bypass, provider-URL SSRF, secret rotation durability, CSV formula injection), pass-through fidelity (pre-body auth, verbatim bodies and stream bytes, redirect refusal, real timeouts and backpressure), missing features (rotation strategies,Retry-After, per-session revoke, API key rotation, exact 60s stats, scheduler cooldown probe) and dashboard fixes (focus management, keyboard-accessible logs, stale detail, filters, chart time axis, dirty-edit protection). Docs and config templates were refreshed to match.Surface affected
/v1/*) — chat completions / responses / messages / models/admin/api/*)web/)deleteOtherSessions,deleteAuditBefore,rotateApiKey,statsOverview.requestsLast60s/errorsLast60s)Verification
pnpm typecheckpnpm test— 110/110 (was 20)pnpm buildpnpm test:e2e— 75/75 (was 51)pnpm test:live) — N/AChecklist
.envfiles are includeddocs/SPEC.mdupdated (auth hook ordering, cookie format, rotation strategies, streaming/redirect/timeout behaviour, admin session + key + settings contract, logging rules)Deliberate deviations / deferred
log_store_bodieswas removed (it never stored anything) instead of implementing body capture with redaction/retention — avoids a false forensic/privacy promise.FIX-28: latency percentiles are still computed in JS over an indexed scan, now behind the ~2s stats TTL cache; prepared-statement caching inRepowas not done.Last-Event-IDreplay, audit filters, cross-platform Chrome resolution inscripts/screenshots.ts(documented instead).🤖 Generated with Claude Code