summaryrefslogtreecommitdiff
path: root/shroud/ui
diff options
context:
space:
mode:
authorDavid Thompson <davet@gnu.org>2015-06-10 18:15:56 -0400
committerDavid Thompson <davet@gnu.org>2015-06-10 18:15:56 -0400
commit778963a0da12125e5894e8009bcc91020eb988a5 (patch)
tree042db20cf4d057673ac25ecbd5425fad966265b2 /shroud/ui
parent16360f53d7035a184e56bd9a04968a24014350b0 (diff)
Change <secret> to store arbitrary key/value pairs.
* shroud/secret.scm (secret-username, secret-password): Delete. (secret-contents): New accessor. (secret-ref): New procedure. (alist->secret, secret->alist): Use new format.
Diffstat (limited to 'shroud/ui')
-rw-r--r--shroud/ui/hide.scm4
-rw-r--r--shroud/ui/show.scm6
2 files changed, 6 insertions, 4 deletions
diff --git a/shroud/ui/hide.scm b/shroud/ui/hide.scm
index b09d7c2..9240b54 100644
--- a/shroud/ui/hide.scm
+++ b/shroud/ui/hide.scm
@@ -82,7 +82,9 @@ Add a new secret to the database.~%")
(let* ((db (secrets-by-id (force db)))
(existing (vhash-ref db id))
(vcons (if existing vhash-replace vhash-cons))
- (secret (make-secret id username password)))
+ (contents `(("username" . ,username)
+ ("password" . ,password)))
+ (secret (make-secret id contents)))
(when (and (not replace?) existing)
(leave "~a: secret already defined" id))
diff --git a/shroud/ui/show.scm b/shroud/ui/show.scm
index 88d9ccb..6ad1ba0 100644
--- a/shroud/ui/show.scm
+++ b/shroud/ui/show.scm
@@ -70,10 +70,10 @@ Show secret named ID.~%")
(leave "~a: secret undefined" id))
(if password?
- (display (secret-password secret))
+ (display (secret-ref secret "password"))
(format #t "username: ~a~%password: ~a~%"
- (secret-username secret)
- (secret-password secret)))))
+ (secret-ref secret "username")
+ (secret-ref secret "password")))))
;; We don't alter the database.
db)