-
Notifications
You must be signed in to change notification settings - Fork 0
fix: PR-review findings cleanup (security, cost, UX guards) #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
4023d3a
test(e2e+unit): failing CSRF + loopback regression for Deep Audit POSβ¦
sharonds 40c9d7b
test(cost): failing regression for premium-tier sync estimate (#46 reβ¦
sharonds 99843e0
test(llm): failing regression for Gemini maxOutputTokens clamp (#46 rβ¦
sharonds c107668
test(utils): failing regression for URL encoding in Gemini interactioβ¦
sharonds 4b48433
test(dashboard-format): failing regression for invalid date input (#4β¦
sharonds 6285ee3
fix(dashboard): add CSRF + loopback guard to Deep Audit POST (#44 revβ¦
sharonds 5d06536
ci: run browser E2E lane so new UI regressions are caught (#46 review)
sharonds 36e3d27
fix(cost): premium tier uses basic sync cost; Deep Audit stays separaβ¦
sharonds b503314
fix(llm): Gemini maxOutputTokens respects caller budget, capped at 81β¦
sharonds b77fb40
fix(dashboard): formatShortDate fallback on invalid date input (#47 rβ¦
sharonds bb572e2
fix(gemini): URL-encode api key and interaction id in all Gemini endpβ¦
sharonds 656e372
fix(providers): gemini tier costs are per-claim, aligned with 4-claimβ¦
sharonds 64a7624
docs(readme): align skills table with shipped defaults and costs (#43β¦
sharonds c1488e9
docs(changelog): document PR-review-findings cleanup under [Unreleased]
sharonds 779c5b1
fix(grounded): emit per-claim cost from registry (Copilot PR #50 review)
sharonds e319a30
test(e2e): bump CSRF-test post-stop delay to 500ms (Copilot PR #50 reβ¦
sharonds 0fe7c44
ci: pin agent-browser to 0.26.0 (Copilot PR #50 review)
sharonds 19a9f89
refactor(dashboard): hoist formatShortDate result in ClaimDrillDown (β¦
sharonds 792337f
test(e2e): poll for skills list before asserting body text (fixes CI β¦
sharonds 52a3a45
Merge branch 'main' into fix/pr-review-cleanup
sharonds File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "name": "dashboard", | ||
| "version": "1.3.0", | ||
| "version": "1.3.1", | ||
| "private": true, | ||
| "scripts": { | ||
| "dev": "next dev", | ||
|
|
||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { describe, test, expect, vi } from "vitest"; | ||
| import { NextRequest } from "next/server"; | ||
|
|
||
| vi.mock("@/lib/csrf", () => ({ | ||
| getCsrfToken: vi.fn(() => "test-csrf-token"), | ||
| })); | ||
|
|
||
| import { POST } from "@/app/api/reports/[id]/deep-audit/route"; | ||
|
|
||
| describe("POST /api/reports/[id]/deep-audit β loopback + CSRF guard", () => { | ||
| test("rejects POST from spoofed Host header (uses nextUrl.hostname instead)", async () => { | ||
| const req = new NextRequest(new URL("http://203.0.113.5:3000/api/reports/1/deep-audit"), { | ||
| method: "POST", | ||
| headers: { host: "localhost", "x-checkapp-csrf": "test-csrf-token" }, | ||
| }); | ||
| const res = await POST(req, { params: Promise.resolve({ id: "1" }) }); | ||
| expect(res.status).toBe(403); | ||
| }); | ||
|
|
||
| test("rejects POST without CSRF token", async () => { | ||
| const req = new NextRequest(new URL("http://localhost:3000/api/reports/1/deep-audit"), { | ||
| method: "POST", | ||
| }); | ||
| const res = await POST(req, { params: Promise.resolve({ id: "1" }) }); | ||
| expect(res.status).toBe(403); | ||
| }); | ||
|
|
||
| test("rejects POST with wrong CSRF token", async () => { | ||
| const req = new NextRequest(new URL("http://localhost:3000/api/reports/1/deep-audit"), { | ||
| method: "POST", | ||
| headers: { "x-checkapp-csrf": "wrong" }, | ||
| }); | ||
| const res = await POST(req, { params: Promise.resolve({ id: "1" }) }); | ||
| expect(res.status).toBe(403); | ||
| }); | ||
| }); |
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI installs
agent-browserglobally without a version pin. This can make CI non-reproducible (sudden upstream releases breaking the lane) and increases supply-chain risk. Prefer pinning the version (e.g. installagent-browser@<known-good>), or add it as a devDependency and run it via a lockfile-managed runner (bunx/npx).