Skip to content

feat: add binary secret value support with --value-from-file and --to-file#686

Merged
jhrv merged 1 commit intomainfrom
binary-secret-values
Mar 20, 2026
Merged

feat: add binary secret value support with --value-from-file and --to-file#686
jhrv merged 1 commit intomainfrom
binary-secret-values

Conversation

@jhrv
Copy link
Copy Markdown
Contributor

@jhrv jhrv commented Mar 19, 2026

Summary

Adds CLI support for binary secret values (keystores, certificates, .p12 files).

  • Writing: nais secret set <name> --key <key> --value-from-file ./file.p12 --env prod reads a file, base64-encodes it, and stores it with encoding: BASE64
  • Reading: nais secret get <name> --key <key> --to-file ./file.p12 --env prod --reason "..." downloads and decodes a binary value to a file (--to-file implies --with-values)
  • Display: Binary values show as <binary, N bytes> in table output instead of raw content
  • --value-from-file is mutually exclusive with --value and --value-from-stdin
  • --to-file requires --key (one key at a time)

Related

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 19, 2026

📝 Changelog preview

Below is a preview of the Changelog that will be added to the next release. Only commit messages that follow the Conventional Commits specification will be included in the Changelog.

v5.20.0 - 2026-03-20

Full Changelog: v5.19.1...v5.20.0

🚀 Features

  • Add binary secret value support with --value-from-file and --to-file (54a64bc)

@jhrv jhrv force-pushed the binary-secret-values branch 3 times, most recently from a49f5cc to aadb315 Compare March 20, 2026 11:58
…-file

Add --value-from-file flag to 'nais secret set' for uploading binary
files (keystores, certs, .p12) as base64-encoded secret values.

Add --to-file flag to 'nais secret get' for downloading binary values
back to files. Binary values display as '<binary, N bytes>' in table
output.

Depends on nais-api ValueEncoding enum support.
@jhrv jhrv force-pushed the binary-secret-values branch from aadb315 to 54a64bc Compare March 20, 2026 12:09
@jhrv jhrv enabled auto-merge (rebase) March 20, 2026 12:12
@jhrv jhrv merged commit 228046c into main Mar 20, 2026
19 checks passed
@jhrv jhrv deleted the binary-secret-values branch March 20, 2026 12:13
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