Implements #DecodeSecret as a wrapper to #TransformSecret#1509
Implements #DecodeSecret as a wrapper to #TransformSecret#1509talentedmrjones merged 1 commit intodagger:mainfrom
Conversation
df3701e to
cf3b707
Compare
|
✔️ Deploy Preview for devel-docs-dagger-io ready! 🔨 Explore the source changes: c2a09f8ab1b7a4584d9f7694f4c96a690694011b 🔍 Inspect the deploy log: https://app.netlify.com/sites/devel-docs-dagger-io/deploys/61f43b020a7a62000792faf8 😎 Browse the preview: https://deploy-preview-1509--devel-docs-dagger-io.netlify.app |
cf3b707 to
abc2338
Compare
|
@aluzzardi @shykes I believe this is ready to 🚢 |
This comment has been minimized.
This comment has been minimized.
|
I agree the names could be better. "Decodes" kind of makes sense: you're What's really happening is that a Considering that we also have other related definitions like package secrets
import (
"encoding/json"
)
#FromJSON: engine.#TransformSecret & {
// engine.#TransformSecret already defines input: engine.#Secret
#function: {
input: _
output: json.Unmarshal(input)
}
}
#FromYAML: engine.#TransformSecret & {
#function: {
input: _
output: yaml.Unmarshal(input)
}
}Then the use becomes: actions: awsCreds: secrets.#FromJSON & {
input: secrets.awsVault.contents
}☝🏻 it actually reads plainly "secrets from json" |
Generally speaking if you're using something like |
This comment has been minimized.
This comment has been minimized.
|
@shykes can we |
|
@aluzzardi what’s our policy on squashing? This one has 7 commits. |
c2a09f8 to
31f5047
Compare
… json secrets Signed-off-by: Richard Jones <[email protected]>
31f5047 to
4f2c6e5
Compare
Provides a convenienc wrapper to get maps of secrets from YAML and JSON sources.
Without this wrapper, plan authors would need to implement
#TransformSecretdirectly, which is verbose and confusing for anyone without a deep knowledge of CUE.To use this simply pass the secret as
input:to#DecodeSecret, specify theformat: "json" | "yaml"and theoutputas a map of secrets will be automatically filled by dagger.For secrets from
sopsFor secrets from a JSON source, such as
aws-vaultCloses #1496
Closes #1497