2 parents a034ee5 + efafd96 commit eea0bc9Copy full SHA for eea0bc9
1 file changed
deploy/cdk/main.go
@@ -322,6 +322,21 @@ func (d *Dynamo) Status(key string) (yopass.Secret, error) {
322
return s, nil
323
}
324
325
+// Update reads the existing secret record, applies fn, and replaces the stored secret.
326
+func (d *Dynamo) Update(key string, fn func(yopass.Secret) (yopass.Secret, error)) error {
327
+ s, err := d.Status(key)
328
+ if err != nil {
329
+ return err
330
+ }
331
+
332
+ updated, err := fn(s)
333
334
335
336
337
+ return d.Put(key, updated)
338
+}
339
340
// Dummy health check
341
func (d *Dynamo) Health() error {
342
return nil
0 commit comments