Explorar o código

secret/with with wiping

Innocenty Enikeev %!s(int64=8) %!d(string=hai) anos
pai
achega
6bb15f3281
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      secrets.lisp

+ 6 - 0
secrets.lisp

@@ -20,3 +20,9 @@
   (with-input-from-string (input value)
     (%secret/pass (format nil "insert --force  --multiline ~{~A~^/~}" path)
                   :input input :output :string)))
+
+(defmacro secret/with ((var path) &body body)
+  `(let ((,var (ignore-errors (secret/get ,path))))
+     (unwind-protect
+          (progn ,@body)
+       (fill ,var #\Space))))