type secretsPayload struct {
Secrets []string `json:secrets`
Version int `json:version`
data, err := ioutil.ReadAll(os.Stdin)
fmt.Fprintf(os.Stderr, "Could not read from stdin: %s", err)
secrets := secretsPayload{}
json.Unmarshal(data, &secrets)
res := map[string]map[string]string{}
for _, handle := range secrets.Secrets {
res[handle] = map[string]string{
"value": "decrypted_" + handle,
output, err := json.Marshal(res)
fmt.Fprintf(os.Stderr, "could not serialize res: %s", err)
fmt.Printf(string(output))