Open chrisjsimpson opened 2 years ago
This seems to break the current interface, which I'm not in favor of. Additionally, from a security perspective, I think it's a bad idea to use the same private key for different environments. I'd recommend separate files per env instead.
Separate files per env makes a lot of sense, how did I miss that!?
I hit the issue when working with GitHub CI environments and didn't have that obvious thought.
So potentially amber-testing.yaml
, amber-staging.yaml
etc would address this exactly.
If useful I'll PR some docs on this since it's possible I'm not the only one to miss this, and miss that amber does cater to ,this use case. Failing that, will just let this thread be evidence for anyone else having the same misunderstanding.
A doc PR would be great!
Here's a demo repo doc demonstrating amber
in combination with GitHub actions with different envionrments:
https://github.com/chrisjsimpson/amber-secrets-ci-example (I'll proof read asap) perhaps not all needed for docs
I like the docs, they look great.
For example user story: As a user I can specify an environment name of my choosing whilst storing a secret, perhaps with a default. When accesing a secret, the default environment is used.
e.g. Interface
Possible structure: (Note the additon of "
environment
")Motivations
amber.yaml
in a different repo per environment, this undermines the goal to track the changes in values over time.Considerations
FILE_FORMAT_VERSION
I've coded an intial attempt at this to demonstrate the idea and will push, though a complete implementation is missing since I'm new to Rust. I specifically got stuck at: https://github.com/fpco/amber/blob/65e6c6ec8ee0669df71b9b56e6e3ab924e0d3fc2/src/config.rs#L109 after altering
SecretRaw
structure to includeenvironment
.I hope the code tempts someone or someone can point me in a better direction.