Skip to content

Add opt-in read-only Bash credentials file backend - #27

Draft
marcus wants to merge 3 commits into
royashbrook:mainfrom
marcus:codex/secrets-file-backend
Draft

marcus wants to merge 3 commits into
royashbrook:mainfrom
marcus:codex/secrets-file-backend

Conversation

@marcus

@marcus marcus commented Oct 4, 2026

Copy link
Copy Markdown

Existing Bash credential files currently need to be copied into an OS store before hush can inject their values. This adds opt-in HUSH_BACKEND=file with HUSH_FILE (default ~/.secrets) so list, run, pipe, manifests, file-only consumers, and explicit sync can use an existing source. The default OS backend stays unchanged.

The adapter rejects store mutations before prompting or sourcing, isolates unselected variables and shell state, preserves empty values and trailing newlines, handles colliding variable names, and refuses failed or early-exiting source files. Relative files are sourced from the validated path rather than a same-named PATH entry. README, skill, and CLI help describe the contract.

The source is a trusted Bash assignment file, not dotenv data: fetching executes its shell code. This does not encrypt the source or contain its side effects. File names are Bash identifiers, and the file is a flat store independent of HUSH_NS.

Validation:

  • node test/file-backend.mjs: 92 checks pass with a temporary HOME, fake credentials, and mocked OS tools. Includes injection, manifests, file export, mocked sync, write refusal, output/trace suppression, name collisions, trailing newlines, relative-path shadowing, and failure handling.
  • Complete test/test.sh: zero failures in an isolated HOME with a fake Linux credential store; existing sync, scheduler, adoption, and maintenance fixtures also pass. No real vault or scheduler mutations.
  • Bash syntax and git diff --check pass.
  • POSIX fixtures run on macOS and simulate host detection; native Windows skips the new executable-fixture suite, consistent with the scheduler fixtures. No native Windows execution claim.

Draft for review of the Bash-file trust model and interface. No automatic PR checks are configured in the current upstream workflows.

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.

1 participant