Repository navigation
feat(launch): read unset profile secrets through secretspec - #84
Draft
runewright[bot] wants to merge 1 commit into
Draft
runewright[bot] wants to merge 1 commit into
runewright[bot] wants to merge 1 commit into
Conversation
A launch profile's from_env key that the shell leaves unset is read with secretspec get from a manifest: the new secrets config key, RUNE_SECRETS, or ~/.config/rune/secretspec.toml when it exists and no env file is named. An empty secrets value turns the manifest off. With a manifest the env file is not read, so a stale ~/.env cannot answer for a failed read. Without one, the env file works as before. Each read passes a reason and the caller fields, so secretspec's audit log names the profile and the key. A missing manifest, a missing binary, or a failed read stops the launch with the key, the manifest, and a cause from a fixed list. Secretspec's own report is never repeated: a dotenv parse error quotes the failing line, which can hold a value. The SecretSource trait leaves room for the SDK. Change launch-secret-declaration-lookup. Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
|
review/correctness stood down on |
|
review/correctness stood down on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rune launchandrune runread a profile'sfrom_envkey that the shell leaves unset through secretspec, from a manifest the newsecretsconfig key names.Plan
Change
launch-secret-declaration-lookup: proposal, design, one ADDED delta (launch-secret-declaration-lookup), tasks, andadr.mdunderdocs/changes/launch-secret-declaration-lookup/.Changes
secretsconfig key and theRUNE_SECRETSoverride (src/ontology.rs). With neither set and no env file named, use~/.config/rune/secretspec.tomlwhen it exists. An empty value turns the manifest off.rune config set secrets <path>works.src/cli/launch/secrets.rs: theSecretSourcetrait andSecretspecBinary, which runssecretspec get <KEY> --file <manifest>with a reason and--caller rune, and returns stdout byte for byte.apply_profile_envwhen one applies, and never read the env file then. Without a manifest, keep the env file fallback. Read each key once per launch.config.example.yaml,docs/config-reference.json,docs/Manual Testing.md, andCHANGELOG.md.Testing
cargo test --workspace --all-features: every test binary passes. New tests cover the manifest read, the environment winning, one read per key, a failed read, a missing manifest, the argument list, and a fakesecretspecbinary.cargo clippy --workspace --all-targets --all-features -- -D warningsandcargo fmt --checkclean.rune spec validate launch-secret-declaration-lookuppasses.sol@claudewith no shell variable and no env file: secretspec's audit log shows the Keychain servedCLIPROXY_API_KEYwith rune's reason and caller.Release Notes
rune launchandrune runread unsetfrom_envkeys through secretspec from~/.config/rune/secretspec.toml, or the manifest thatsecretsorRUNE_SECRETSnames. Without a manifest, the env file works as before.Note
Add secretspec manifest lookup for unset profile secrets in launch
from_envprofile references from a secretspec manifest viasecretspec get, implemented in secrets.rs. A single fallback source is picked per launch: a manifest when one applies, otherwise the env file.secretsconfig key orRUNE_SECRETSenv var (RUNE_SECRETSwins), with a default manifest used when it exists and no env file is named. An empty value disables manifest use.apply_profile_env. A failed manifest lookup stops the launch, and thesecretspecbinary must be installed when a manifest applies.Macroscope summarized 89a0bf1.