feat(m4): session-key store via @napi-rs/keyring#311
Merged
0xDevNinja merged 3 commits intomilestone/M4-indexer-api-gateway-sdk-alphafrom Apr 29, 2026
Merged
feat(m4): session-key store via @napi-rs/keyring#3110xDevNinja merged 3 commits intomilestone/M4-indexer-api-gateway-sdk-alphafrom
0xDevNinja merged 3 commits intomilestone/M4-indexer-api-gateway-sdk-alphafrom
Conversation
Adds `SessionKeyStore` wrapping @napi-rs/keyring (OS keychain — macOS
Keychain, Windows Credential Manager, libsecret on Linux) for secure
storage of EVM private keys / SIWE JWTs / session secrets.
Public API on `@titular/acp-sdk/session-keys`:
- `SessionKeyStore({ service })` — typed wrapper with `set/get/delete`
- `inMemorySessionKeyStore()` — fallback for `--non-interactive` CI
flows and tests where no OS keychain is reachable
- New error code `keyring_unavailable` so consumers can distinguish
@napi-rs/keyring is `optionalDependencies`: native module fails on some
build envs; missing dep degrades to in-memory with a console.warn.
Service name is namespaced (default `titular-acp`) so multiple deploys
on the same host don't collide on entries.
CI runs `pnpm install --frozen-lockfile`, which fails when package.json declares an optional dep that isn't in the lockfile. Refreshes the lockfile to register `@napi-rs/keyring@^1.1.0` under the acp-sdk-ts importer's `optionalDependencies` block.
Owner
Author
|
LGTM — APPROVE. Verified:
Follow-ups (non-blocking):
Squash-merging into |
7 tasks
Resolves pnpm-lock.yaml conflict caused by sibling PR #312 (examples) landing first. Re-runs `pnpm install` against the merged package.json graph so the lockfile carries both the `@napi-rs/keyring` optional dep (this PR) and the latest examples-branch dep resolutions.
2efc025
into
milestone/M4-indexer-api-gateway-sdk-alpha
23 checks passed
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
@titular/acp-sdk/session-keysaddsSessionKeyStorewrapping@napi-rs/keyringfor OS-keychain-backed secret storage (macOS Keychain, Windows Credential Manager, libsecret).set/get/deleteper(service, account)pair; service name namespaced (defaulttitular-acp).inMemorySessionKeyStore()fallback for--non-interactiveCI flows and tests where no keychain is reachable.keyring_unavailableso consumers can distinguish missing-native-module vs missing-account.@napi-rs/keyringis inoptionalDependencies: native module fails on some build envs; missing dep degrades to in-memory with aconsole.warn.Closes #98.
Test plan
Follow-up
Wiring
SessionKeyStoreintopackages/acp-cli/src/config.tsis deferred — currently CLI uses 0o600 plaintext at~/.config/titular/config.json. Will land as a separate PR after this merges to avoid touching multiple packages in one PR.