feat(keychain): storage for openrouter api key - #129
Open
bharatsachya wants to merge 8 commits into
Open
bharatsachya wants to merge 8 commits into
bharatsachya wants to merge 8 commits into
Conversation
[CHANGES REVIEW ONLY] Pre release
Pre release
Pre release
[TESTING] Pre release
Contributor
Author
|
Against #100 |
Dead-Bytes
reviewed
Jun 8, 2026
Dead-Bytes
left a comment
Contributor
There was a problem hiding this comment.
instead of supporting legacy i think a clean migration is more viable option to go for
Dead-Bytes
approved these changes
Jun 8, 2026
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.
What changed
@napi-rs/keyringdependency to the@bb/configpackage to support synchronous access to the OS credential store (macOS Keychain, Linux Secret Service, Windows Credential Manager).packages/config/src/keychain.ts) definingSECRET_KEYS(openrouter_api_key,neo4j_password) and exposing helper functions:getSecret,setSecret,deleteSecret,isKeychainAvailable,isSecretKey, andisKeychainAvailable(availability probe).storeSecrethelper (packages/config/src/secrets.ts) that orchestrates storing secrets in the keychain while clearing any plaintext equivalents fromconfig.json.packages/config/src/loader.ts) to automatically overlay config schema values with values retrieved from the OS keychain if the local plaintext values are empty.packages/server/src/index.tsto log a startup warning if any secret key is found stored in plaintext insideconfig.json.packages/cli/src/SetCommand.ts), the setup form (packages/cli/src/SetupForm.tsx), and the configuration boot default applicator (packages/cli/src/bootConfig.ts) to route secrets through the new keychain-aware setter mapping.CLAUDE.mdandpackages/config/README.md.Why
Storing API keys and database passwords in plaintext in a configuration file (
config.json) represents a significant security risk. Moving these secrets to the OS-provided secure credential store (Keychain on macOS, Secret Service on Linux, and Credential Manager on Windows) ensures they are encrypted at rest.Using a transparent fallback to plaintext
config.jsonensures the application continues to run seamlessly on environments or containers where no secure OS keychain backend is available.How to test