Skip to content

feat: add binary config value support with --value-from-file and --to-file#693

Open
jhrv wants to merge 1 commit intomainfrom
binary-config-values
Open

feat: add binary config value support with --value-from-file and --to-file#693
jhrv wants to merge 1 commit intomainfrom
binary-config-values

Conversation

@jhrv
Copy link
Copy Markdown
Contributor

@jhrv jhrv commented Mar 20, 2026

Summary

  • Adds --value-from-file flag to nais config set with automatic binary detection via utf8.Valid()
  • Adds --to-file and --key flags to nais config get for extracting binary values to files
  • Shows binary config values as <binary, N bytes> in table output
  • Adds encoding field to ConfigValue/ConfigValueInput in the GraphQL schema

Details

Writing binary values:

nais config set <name> --key <key> --value-from-file ./file.p12 --env prod
  • Reads file, detects binary via utf8.Valid(), base64-encodes if binary
  • 1 MiB size validation before sending to API
  • --value, --value-from-stdin, --value-from-file are mutually exclusive

Reading binary values:

nais config get <name> --key <key> --to-file ./file.p12 --env prod
  • Extracts single key, decodes base64 if encoding is BASE64, writes to file
  • --to-file requires --key and vice versa

Depends on: nais/api#377

…-file

Add encoding field to ConfigValue/ConfigValueInput in the GraphQL schema
and update CLI commands to support binary config values, mirroring the
existing secret binary value support.

Key changes:
- Add encoding: ValueEncoding! to ConfigValue, encoding with default to ConfigValueInput
- Add --value-from-file flag to 'config set' with auto binary detection (utf8.Valid)
- Add --to-file and --key flags to 'config get' for extracting binary values
- Show binary values as '<binary, N bytes>' in table output
- Add 1 MiB size validation for values
- Mutual exclusivity between --value, --value-from-stdin, --value-from-file

Depends on nais/api binary-config-values branch.
@github-actions
Copy link
Copy Markdown
Contributor

📝 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.21.0 - 2026-03-20

Full Changelog: v5.20.0...v5.21.0

🚀 Features

  • Add binary config value support with --value-from-file and --to-file (29f4197)

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