This repository was archived by the owner on Jul 3, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
ci/security/test: automated audit fixes for CodexAuditBridge #48
Merged
Merged
Changes from all commits
Commits
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import assert from "node:assert/strict"; | ||
| import test from "node:test"; | ||
|
|
||
| import { buildDashboardApiUrl } from "../src/index.mjs"; | ||
|
|
||
| test("buildDashboardApiUrl preserves query strings for allowed read routes", () => { | ||
| assert.equal( | ||
| buildDashboardApiUrl("https://origin.example/base", "/v1/ai/changes", "?days=7"), | ||
| "https://origin.example/base/v1/ai/changes?days=7", | ||
| ); | ||
| }); | ||
|
|
||
| test("buildDashboardApiUrl allows effectiveness route with query", () => { | ||
| assert.equal( | ||
| buildDashboardApiUrl("https://origin.example", "/v1/ai/changes/effectiveness", "?days=90"), | ||
| "https://origin.example/v1/ai/changes/effectiveness?days=90", | ||
| ); | ||
| }); | ||
|
|
||
| test("buildDashboardApiUrl rejects unsupported origin paths", () => { | ||
| assert.throws( | ||
| () => buildDashboardApiUrl("https://origin.example", "/v1/ai/execute/jobs", ""), | ||
| /not allowed/, | ||
| ); | ||
| }); | ||
|
|
||
| test("buildDashboardApiUrl rejects insecure origins", () => { | ||
| assert.throws( | ||
| () => buildDashboardApiUrl("http://origin.example", "/v1/ai/health", ""), | ||
| /HTTPS/, | ||
| ); | ||
| }); |
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.
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.
When the dashboard loads it calls
/api/v1/ai/changes/effectiveness?days=90; forwardingurl.searchmakes the origin receive/v1/ai/changes/effectiveness?days=90. The current VPS handler inservice/ai_gateway_service.py:503checks exactself.path == "/v1/ai/changes/effectiveness"before the generic/v1/ai/changes/branch, so with a query it falls into change-detail lookup and returns 404. Because this call is part of the dashboard'sPromise.all, that one 404 prevents all dashboard cards from rendering; please fix the origin router first or avoid forwarding the query for this route.Useful? React with 👍 / 👎.