-
Notifications
You must be signed in to change notification settings - Fork 854
PROPOSAL: dagger.#DecodeSecret is a high-level wrapper to engine.#TransformSecret #1496
Copy link
Copy link
Closed
Milestone
Description
As discussed in #1429 we need some high-level wrappers to ease the entry into #TransformSecret. This is a proposal for the design of dagger.#YamlSecret (I'm not attached to names at this point, open/happy to consider other suggestions)
EDIT: per latest proposal from @shykes
package dagger
import (
"encoding/yaml"
"encoding/json"
)
DecodeSecret: {
{
format: "json"
engine.#TransformSecret & {
#function: {
input: _
output: json.Unmarshal(input)
}
}
} | {
format: "yaml"
engine.#TransformSecret & {
#function: {
input: _
output: yaml.Unmarshal(input)
}
}
}
}To use it:
dagger.#Plan & {
inputs: secrets: sops: {
command: {
name: "sops"
args: ["-d", "path/to/encryptedSecrets.yaml"]
}
}
actions: {
sopsSecrets: dagger.#DecodeSecret & {
format: "yaml"
input: inputs.secrets.sopsStuff
}
// we can now reference sopsSecrets.output.someKey.contents
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels