Skip to content

feat: keep package secrets in the Keychain - #36

Merged
Seb-GRAF merged 4 commits into
mainfrom
feat/package-secrets
Oct 16, 2026
Merged

Seb-GRAF merged 4 commits into
mainfrom
feat/package-secrets

Conversation

@Seb-GRAF

@Seb-GRAF Seb-GRAF commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Part of #33: "Add a secret setting type kept in the Keychain instead of config.json, for API tokens."

Changes

  • A setting { "type": "secret", "title": "…" } has no default. A package can use it only as a whole value in the environment of a widget or provider it defines. Templates, profiles and the top-level environment can't, so a package can't hand its token to every command.
  • StableBar replaces the reference with a marker naming the package and the setting, so configuration files, the effective document, --query and Customize never hold the token. The marker becomes the Keychain value right before the command starts, off the main thread and before event values merge in.
  • The Packages tab shows a secure field for each secret, with "Saved" or "Not set" read without fetching the token, so reviewing a package never prompts. It saves only edited secrets, only after a successful Save or Enable, and never on Disable. Remove clears a saved token on the next save. Saving updates the existing Keychain item instead of deleting it first.
  • README: the secret type, where it can be used, what it protects (configuration files, --query, Customize) and what it doesn't (other packages, programs running as you, and commands that print their token), and the Keychain prompt that ad-hoc signed builds show after an update.

Testing

  • swift test: all tests pass, including where markers are allowed, rejected markers and selection values, and the swap with a lookup function passed in. No test touches the Keychain.
  • The store's github-notifications package, which uses a secret token, passes the store's check against this build.
  • Reviewed by GPT-6.1-Sol via Codex. Its findings about lost tokens and saving on Disable are fixed here.
  • In a scratch instance, the field shows "Not set" for an installed package, and --query shows only the marker. Not tried by hand yet: the Keychain prompt, and saving or removing a token.

Merging

A merge commit. Stacked on #35.

Claude Opus 5.5 via Claude Code, reviewed by GPT-6.1-Sol via Codex.

@Seb-GRAF
Seb-GRAF force-pushed the feat/package-secrets branch from d04cb35 to ac51e7c Compare October 16, 2026 10:03
Base automatically changed from feat/package-store to main October 16, 2026 10:06
@Seb-GRAF
Seb-GRAF merged commit 2b04b83 into main Oct 16, 2026
4 checks passed
@Seb-GRAF
Seb-GRAF deleted the feat/package-secrets branch October 16, 2026 10:06
@stablebar-releases

Copy link
Copy Markdown

🎉 This PR is included in version 0.5.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant