aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMichael Albinus2018-04-23 10:16:06 +0200
committerMichael Albinus2018-04-23 10:16:06 +0200
commit0ecc10a7771bf1f62d15b2e6c747bee9f7a557ff (patch)
tree7547eb4f8b8282b88d811189b26fa6dc42d06d77 /test
parente7044d294c1b1779b3124b27ba0f09b22b64df20 (diff)
downloademacs-0ecc10a7771bf1f62d15b2e6c747bee9f7a557ff.tar.gz
emacs-0ecc10a7771bf1f62d15b2e6c747bee9f7a557ff.zip
Let Tramp save passwords
* lisp/auth-source.el (auth-source-secrets-saver): New defun. (auth-source-secrets-create): Use it. * lisp/net/secrets.el (secrets-struct-secret-content-type): (secrets-create-item): Do not hard-code :xdg:schema. * lisp/net/tramp.el (tramp-password-save-function): New defvar. (tramp-read-passwd): Set it properly. (tramp-process-actions): * lisp/net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection): Save password. * lisp/net/tramp-cmds.el (tramp-bug): Don't report `tramp-password-save-function'. * test/lisp/net/secrets-tests.el (secrets-test03-items): Extend test with another :xdg:schema.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/net/secrets-tests.el15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/lisp/net/secrets-tests.el b/test/lisp/net/secrets-tests.el
index dc9c7f1004a..23512d48ee5 100644
--- a/test/lisp/net/secrets-tests.el
+++ b/test/lisp/net/secrets-tests.el
@@ -169,9 +169,16 @@
169 (should 169 (should
170 (equal 170 (equal
171 (secrets-get-attributes "session" "bar") 171 (secrets-get-attributes "session" "bar")
172 '((:host . "remote-host") (:user . "joe") 172 '((:xdg:schema . "org.freedesktop.Secret.Generic")
173 (:method . "sudo") 173 (:host . "remote-host") (:user . "joe") (:method . "sudo"))))
174 (:xdg:schema . "org.freedesktop.Secret.Generic")))) 174
175 ;; Create an item with another schema.
176 (secrets-create-item
177 "session" "baz" "secret" :xdg:schema "org.gnu.Emacs.foo")
178 (should
179 (equal
180 (secrets-get-attributes "session" "baz")
181 '((:xdg:schema . "org.gnu.Emacs.foo"))))
175 182
176 ;; Delete them. 183 ;; Delete them.
177 (dolist (item (secrets-list-items "session")) 184 (dolist (item (secrets-list-items "session"))
@@ -206,6 +213,8 @@
206 213
207 ;; Search the items. 214 ;; Search the items.
208 (should-not (secrets-search-items "session" :user "john")) 215 (should-not (secrets-search-items "session" :user "john"))
216 (should-not
217 (secrets-search-items "session" :xdg:schema "org.gnu.Emacs.foo"))
209 (should 218 (should
210 (equal 219 (equal
211 (sort (secrets-search-items "session" :user "joe") 'string-lessp) 220 (sort (secrets-search-items "session" :user "joe") 'string-lessp)