Skip to content

feat: improve secret-ref UX and docs for profiles#110

Merged
rmanibus merged 1 commit into
mainfrom
feat/rfc0011-docs-ux-secret-refs
Mar 15, 2026
Merged

feat: improve secret-ref UX and docs for profiles#110
rmanibus merged 1 commit into
mainfrom
feat/rfc0011-docs-ux-secret-refs

Conversation

@rmanibus
Copy link
Copy Markdown
Contributor

Summary

Implement RFC 0011 issue #91 with CLI UX and documentation updates for profile/store secret references.

What Changed

  • Store CLI UX
    • store new now accepts explicit *_secret flags:
      • -password-secret, -encryption-key-secret, -recovery-key-secret
      • -s3-access-key-secret, -s3-secret-key-secret
      • -store-sftp-password-secret, -store-sftp-key-secret
    • Legacy *-env flags remain supported and are converted to env://... refs when writing.
    • When both *-secret and *-env are provided, *-secret wins.
  • CLI help/completion
    • Updated usage docs (cloudstic help) for new *_secret flags.
    • Updated shell completion definitions for new store flags.
  • Documentation
    • docs/user-guide.md: secret ref guidance, scheme list, examples, and headless fallback guidance.
    • docs/encryption.md: explicit separation between repository key slots and profile credential references.

Notes

For documentation examples, this PR assumes cross-platform secret schemes are available:

  • keychain://... (macOS)
  • wincred://... (Windows)
  • secret-service://... (Linux)

Validation

  • go test ./cmd/cloudstic -count=1
  • go test ./...
  • golangci-lint run ./...

Tracking

@rmanibus rmanibus added enhancement New feature or request documentation Improvements or additions to documentation labels Mar 15, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 15, 2026

Codecov Report

❌ Patch coverage is 63.74269% with 124 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/cloudstic/cmd_store.go 63.77% 68 Missing and 28 partials ⚠️
cmd/cloudstic/usage.go 0.00% 14 Missing ⚠️
cmd/cloudstic/interactive.go 33.33% 10 Missing ⚠️
cmd/cloudstic/secret_store_stub.go 0.00% 4 Missing ⚠️

📢 Thoughts on this report? Let us know!

@rmanibus rmanibus force-pushed the feat/rfc0011-docs-ux-secret-refs branch 2 times, most recently from 1ea20b9 to 335abba Compare March 15, 2026 21:07
@rmanibus rmanibus force-pushed the feat/rfc0011-docs-ux-secret-refs branch from 335abba to e3e1d8f Compare March 15, 2026 21:13
@rmanibus rmanibus merged commit b9d0f93 into main Mar 15, 2026
5 checks passed
@rmanibus rmanibus deleted the feat/rfc0011-docs-ux-secret-refs branch March 15, 2026 21:16
@rmanibus rmanibus requested a review from Copilot March 15, 2026 23:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds richer store credential/encryption handling to the Cloudstic CLI by introducing secret reference flags and interactive flows (including macOS Keychain writes), plus a new store verify command to validate store connectivity and encrypted-repo unlock.

Changes:

  • Added cloudstic store verify subcommand and updated CLI usage + shell completions.
  • Enhanced store new to support *_secret flags, prefill existing store values in interactive mode, and verify configured encryption credentials for initialized encrypted repos.
  • Expanded docs on secret reference usage and interactive encryption setup.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
docs/user-guide.md Documents store verify and recommends *_secret secret-ref fields/schemes.
docs/encryption.md Adds explanation of profile credential references and supported secret-ref schemes.
cmd/cloudstic/usage.go Updates help output for new subcommand and new *-secret flags.
cmd/cloudstic/secret_store_stub.go Non-darwin stubs for native secret store write/exists helpers.
cmd/cloudstic/secret_store_darwin.go macOS implementation for writing/checking secrets via security.
cmd/cloudstic/secret_store_darwin_test.go Unit tests for the macOS security command invocations.
cmd/cloudstic/runner.go Adds reusable stdin/line reader plumbing to support interactive prompting.
cmd/cloudstic/interactive.go Uses runner line reader; adds hidden-input secret prompt.
cmd/cloudstic/completion.go Adds completions for store verify and the new *-secret flags.
cmd/cloudstic/cmd_store.go Implements store verify, secret-ref flag handling, interactive encryption config, and verification of encrypted repo unlock credentials.
cmd/cloudstic/cmd_store_test.go Adds/updates tests covering prefills, secret refs, credential verification, and missing-secret behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmd/cloudstic/secret_store_darwin.go
Comment thread cmd/cloudstic/secret_store_darwin.go
Comment thread cmd/cloudstic/interactive.go
Comment thread docs/encryption.md
Comment thread docs/user-guide.md
Comment thread cmd/cloudstic/usage.go
Comment thread cmd/cloudstic/usage.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RFC 0011: Documentation and CLI UX updates for profile secret references

2 participants