Skip to content

Add system-keychain secrets API - #98

Merged
1bye merged 7 commits into
mainfrom
codex/secrets-17
Nov 22, 2026
Merged

1bye merged 7 commits into
mainfrom
codex/secrets-17

Conversation

@1bye

@1bye 1bye commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Apps can keep small tokens in the system credential store through Platform::secrets(), which uses the application id configured in App::new. A platform without a configured id returns Error::MissingApplicationId. Read, write, and delete are asynchronous. Pass an owned String or Vec<u8> to secrets.write("api-token", token.into(), cx) to transfer its buffer without copying. App ids and names map injectively onto separate URL keys; values have redacted Debug and zeroized owned buffers, and never register with inspection or storage tooling. Web explicitly fails without a storage fallback.

Adds desktop demo controls, a restart/cleanup probe, redaction regressions and platform/error documentation. Missing reads return None and missing deletes succeed. Backend messages are withheld; typed errors are mapped where GPUI preserves them, with documented limits. Store encryption and biometric prompts remain out of scope.

The devtools → dep:windows addition was incidental to the dependency edit; typed secrets errors require windows through gpui, which already enables it, so the extra devtools edge is redundant.

Closes #17

Verified on this Mac:

  • cargo build -p rake-app --example secrets-probe and cargo build -p rake-desktop-example passed.
  • cargo test -p rake-app --lib platform::secrets: 4 passed, including backend-message redaction and typed macOS error mappings.
  • cargo test -p rake-app --lib platform::secrets --no-default-features --features devtools: 2 passed, checking diagnostics, the formatted log tail used by file output, inspection output and the storage catalog.
  • Real Keychain probe wrote the clearly namespaced dev.rake.secrets-17-test / restart-probe entry, read it in a new process, checked missing reads and repeated deletion, and confirmed absence. Final cleanup succeeded; no test entry remains.
  • rake format, rake lint and the dependency-pin/default-Web-graph check passed.

Not verified: real Windows/Linux desktop keychains, Web runtime, interactive locked/denied prompts, or desktop button interactions. Typed error mappings use source contracts and synthetic tests; they do not establish real OS behavior. CI runs the wider platform matrix. The isolated target directory has been removed; the worktree and logs remain for review.

🤖 Generated with Claude Code

1bye and others added 7 commits November 18, 2026 19:49
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Use the application id configured by App::new for Platform::secrets().
Move owned String and Vec<u8> tokens into Secret without copying.
@1bye
1bye marked this pull request as ready for review November 22, 2026 12:40
@1bye
1bye merged commit 58afe2e into main Nov 22, 2026
21 of 22 checks passed
1bye added a commit that referenced this pull request Nov 22, 2026
Resolves overlaps with the secrets API dependencies (#98) and the
link and selection view tests (#99).

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Secrets API backed by the system keychain

1 participant