Repository navigation
feat(wave4): trust — tests for high-risk paths, relay hardening, credential hygiene - #35
Merged
Merged
Conversation
…ential hygiene
Wave 4 of the product audit ("trust before scale"):
Tests (6 → 29, files 2 → 7)
- api/_relay: allowlist (lookalike hosts, http), method rejection, header
filtering (cookie/sec-* dropped), set-cookie strip + link expose, size cap.
- sentry/client: proxy routing + url encoding + bearer auth, regional hosts,
Link-header cursor parse, fail-fast on 4xx (no retry).
- sentry/issues: normEnvironment ("all"/empty → no filter).
- utils/time: band boundaries incl. the 360-364d "0y ago" regression.
- utils/agentPrompt: crash-first stacktrace ordering, minimal-data fallbacks.
- parseNextCursor/normEnvironment exported for testability.
Hardening & hygiene
- relay: HTTP method allowlist (405 otherwise) + 20MB response cap (declared
content-length and actual body).
- sentryConfig.update sanitizes the token at the storage boundary.
- Dexie v4 drops the tokens table: it stored the raw token string but had zero
readers (saveTokenMeta/getTokenMeta/isTokenExpiringSoon were dead code);
SECURITY.md + Settings copy updated.
- gql throws on a 200-with-no-data payload instead of returning undefined as T;
fetchWorkflowRunJobs null-safe.
- useFlash hook (clears on re-trigger + unmount) replaces the three raw
setTimeout "copied/seen" flashes (SinceScope, DetailModalHeader, Checks).
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.
Wave 4 — "trust before scale": the final wave of the product audit. No new features; the codebase earns the confidence to grow.
🧪 Tests: 6 → 29 (files 2 → 7)
api/_relaysentry/clientsentry/issuesnormEnvironment— "all"/empty → no filterutils/timeutils/agentPrompt🛡️ Relay hardening (round 2)
content-lengthand the actual body, so a hostile upstream can't flood the browser.🔑 Credential hygiene
sentryConfig.updatesanitizes the token at the storage boundary (reads already were).tokenstable — it stored the raw token string but had zero readers (saveTokenMeta/getTokenMeta/isTokenExpiringSoonwere dead code). SECURITY.md + Settings copy updated.🧹 Robustness odds & ends
gqlthrows on a 200-with-no-data payload instead of returningundefined as T.fetchWorkflowRunJobsnull-safe.useFlashhook (clears on re-trigger + unmount) replaces the three rawsetTimeout"copied/seen" flashes.Deferred (tracked in TASK_TODO): full schema validation (zod) and hook-level tests (need @testing-library) — longer-term.
npm run checkgreen ·docs/TASK_TODO.mdticked — all 4 audit waves complete.🤖 Generated with Claude Code