-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
marshal nested secrets value to string #454
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Seem the serialized yaml value has some newline, I should trim the output string. |
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
So the idea is that we can have yaml and json encrypted without having to put them in strings? Would be nice to extend the test case those those as well: https://github.com/Mic92/sops-nix/blob/master/pkgs/sops-install-secrets/nixos-test.nix The script to update secrets is here: https://github.com/Mic92/sops-nix/blob/master/pkgs/sops-install-secrets/test-assets/sops-edit |
The basic idea is to support any value in a nested secret. However, I found some edge cases for this pull request:
I would add some tests to |
Maybe it should only render arrays and hashmaps? |
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Signed-off-by: iosmanthus <myosmanthustree@gmail.com>
Perhaps we should marshal nested secrets only in JSON format because it is indent-insensitive. The YAML nested secrets are difficult to fit in the template due to indentation issues. |
Is there an ETA on this getting merged? Currently it is blocking me from including a traefik.env file. |
+1 |
Curious how this PR will affect the secrets declaration, I was attempting this before finding this PR: sops.secrets."cachix-auth-token" = {
mode = "0400";
key = "'[\"cachix-auth-token\"][\"value\"]'";
}; Which mirrors the CLI |
This pull request marshals nested secret values according to the format of the secret file.