Narrow a secret's source to the file, and resolve it against the flake - #22
Merged
Conversation
A secret's `file` was a subpath of the flake source, which carries the whole source as its context, and the unit that deploys a host references the profile holding it. Every host therefore carried every other host's sealed secrets and the rest of the repository. Narrow it to the one file, as cacheInStore already does for the cache.
The paths seal writes are relative to the flake root, but the wrapper changed to the git root. The two differ for a flake in a subdirectory of its repository, where seal then resolved every source secret against the wrong directory. Being in a git repository is also not the same as being in this flake's, so the wrapper now checks it landed somewhere with a flake.nix before writing anything.
A secret whose file comes from another flake has no copy this repository can write, and refusing the run over it meant a recipient change could be blocked by a file the user has no way to fix. seal now re-encrypts what it owns and names the rest when it finishes, so the recipient that cannot read them is said out loud without being made an error.
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.
Narrows a secret's
fileto a store path holding only that file, so a host no longer carries the whole flake source — and every other host's sealed secrets — in its closure. Resolves seal's paths against the flake root rather than the git root, which are the same path only for a flake at the top of its repository.Also stops a secret owned by another flake from blocking a recipient change. This repository has no copy of it to write, so refusing the run meant being blocked by a file the user cannot fix; seal now re-encrypts what it owns and names the rest when it finishes.
Cache entry names are unchanged, so nothing needs re-sealing.
Fixes #20
Fixes #21