Repository navigation
Conversation
…edding dependencies ### Description This PR addresses credential exposure in the test configuration and resolves optional dependency initialization failures within the `packages/core` directory. **Vulnerabilities & Security Defects Remediated:** * **Credential Exposure in Test Configuration (`packages/core/src/test_resources/constants.ts`, `packages/core/src/test_resources/createRuntime.ts`):** A Supabase project URL, a JWT-shaped anon key, and test-account credentials were previously embedded directly in the source code. These values have been scrubbed and are now read strictly from environment variables. Supabase integration mode will now fail with an explicit configuration error if the required values are missing. * **Optional-Dependency Initialization Failure (`packages/core/src/localembeddingManager.ts`):** The `fastembed` package was previously imported at module load time, causing the embedding module to crash before reaching the remote fallback path if the optional local dependency was unavailable. The import is now lazy and strictly contained within the guarded initialization path.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit 8afdb11. Configure here.
| throw new Error( | ||
| "Supabase integration tests require SUPABASE_URL, SUPABASE_ANON_KEY or SUPABASE_SERVICE_API_KEY, TEST_SUPABASE_EMAIL, and TEST_SUPABASE_PASSWORD", | ||
| ); | ||
| } |
There was a problem hiding this comment.
Incomplete service key env fallback
Medium Severity
Supabase key resolution accepts SUPABASE_SERVICE_API_KEY only from the env argument, while URL, anon key, email, and password can fall back to process.env via the new constants. With a partial env object and only the service key set in the environment, validation fails even though the error text lists that key as valid. The constants also snapshot process.env at import time, so later env setup never reaches those fallbacks.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 8afdb11. Configure here.
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.


Description
This PR addresses credential exposure in the test configuration and resolves optional dependency initialization failures within the
packages/coredirectory.Vulnerabilities & Security Defects Remediated:
packages/core/src/test_resources/constants.ts,packages/core/src/test_resources/createRuntime.ts): A Supabase project URL, a JWT-shaped anon key, and test-account credentials were previously embedded directly in the source code. These values have been scrubbed and are now read strictly from environment variables. Supabase integration mode will now fail with an explicit configuration error if the required values are missing.packages/core/src/localembeddingManager.ts): Thefastembedpackage was previously imported at module load time, causing the embedding module to crash before reaching the remote fallback path if the optional local dependency was unavailable. The import is now lazy and strictly contained within the guarded initialization path.Note
Medium Risk
Security-positive credential removal, but test auth still talks to real Supabase when env is set, and embedding init still loads a native optional dependency at runtime.
Overview
Removes hardcoded Supabase URL, anon JWT, and test-account credentials from
test_resourcesso they come only from environment variables. Supabase test runtime now fails fast if URL, key, and test login values are missing, and it can useSUPABASE_ANON_KEYas well as the service key.Lazily imports optional
fastembedinsideLocalEmbeddingModelManager.initializeModelinstead of at module load, so missing local embedding deps no longer crash the module before remote fallback. Nodefs/urlimports are also switched tonode:specifiers.Reviewed by Cursor Bugbot for commit 8afdb11. Bugbot is set up for automated code reviews on this repo. Configure here.