fix: publish the endpoint guard through aiToolkit's public barrel - #5625
Open
Bryandero98 wants to merge 1 commit into
Open
fix: publish the endpoint guard through aiToolkit's public barrel#5625Bryandero98 wants to merge 1 commit into
Bryandero98 wants to merge 1 commit into
Conversation
evaluateSecretEndpoint/assertSecretEndpoint (SSRF/key-exfiltration guard for provider endpoint URLs) lived only at the toolkit's private internal/endpointGuard.js path, yet six server/services/* modules imported it from there directly, coupling every one of them to a vendored internal file path. Promote both as named exports of server/lib/aiToolkit/index.js and repoint every service import at the public barrel instead. The internal/ implementation is unchanged - this is an API-path correction, not a policy change. Its contract test now imports through the barrel so it exercises what services actually call, and a stale test mock pinned to the old internal path (visionTest.frameGuard.test.js) is updated to match. Fixes atomantic#5619
Contributor
Author
|
Thanks for the well-specified issue — the reuse search and the exact call-site list made this a clean, mechanical fix to verify end-to-end. Happy to adjust anything or take on more of this module-hygiene series if useful. |
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
evaluateSecretEndpoint/assertSecretEndpoint(the SSRF/key-exfiltration guard for providerendpointURLs) lived only at the toolkit's privateinternal/endpointGuard.jspath, yet sixserver/services/*modules imported it from there directly.server/lib/aiToolkit/index.jsand repoints every service import at the public barrel.internal/endpointGuard.jsstays the sole implementation — this is an API-path correction, not a policy change.server/lib/README.md.visionTest.frameGuard.test.js) still pinned to the old internal path, found while grepping the whole repo for any remaining reference — it would have silently stopped intercepting the guard call once the production import moved.Test plan
npx vitest run lib/aiToolkit/internal/endpointGuard.test.js services/aiProvider.test.js services/askService.test.js services/localLlmPlayground.test.js services/visionTest.test.js services/voice/llm.test.js services/insightsService.test.js services/visionTest.frameGuard.test.js— all passaiToolkit/internal/endpointGuard.jsoutside the toolkit's own internal modules (providers.js,runner.js,validation.js)Fixes #5619