diff options
| -rw-r--r-- | lisp/auth-source-pass.el | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/auth-source-pass.el b/lisp/auth-source-pass.el index 4fcb1015e76..1fda6982328 100644 --- a/lisp/auth-source-pass.el +++ b/lisp/auth-source-pass.el | |||
| @@ -38,6 +38,17 @@ | |||
| 38 | (require 'auth-source) | 38 | (require 'auth-source) |
| 39 | (require 'url-parse) | 39 | (require 'url-parse) |
| 40 | 40 | ||
| 41 | (defgroup auth-source-pass nil | ||
| 42 | "password-store integration within auth-source." | ||
| 43 | :prefix "auth-source-pass-" | ||
| 44 | :group 'auth-source | ||
| 45 | :version "27.1") | ||
| 46 | |||
| 47 | (defcustom auth-source-pass-filename "~/.password-store" | ||
| 48 | "Filename of the password-store folder." | ||
| 49 | :type 'directory | ||
| 50 | :version "27.1") | ||
| 51 | |||
| 41 | (cl-defun auth-source-pass-search (&rest spec | 52 | (cl-defun auth-source-pass-search (&rest spec |
| 42 | &key backend type host user port | 53 | &key backend type host user port |
| 43 | &allow-other-keys) | 54 | &allow-other-keys) |
| @@ -121,7 +132,7 @@ key2: value2" | |||
| 121 | (with-temp-buffer | 132 | (with-temp-buffer |
| 122 | (insert-file-contents (expand-file-name | 133 | (insert-file-contents (expand-file-name |
| 123 | (format "%s.gpg" entry) | 134 | (format "%s.gpg" entry) |
| 124 | "~/.password-store")) | 135 | auth-source-pass-filename)) |
| 125 | (buffer-substring-no-properties (point-min) (point-max)))) | 136 | (buffer-substring-no-properties (point-min) (point-max)))) |
| 126 | 137 | ||
| 127 | (defun auth-source-pass-parse-entry (entry) | 138 | (defun auth-source-pass-parse-entry (entry) |
| @@ -188,7 +199,7 @@ often." | |||
| 188 | ;; in Emacs | 199 | ;; in Emacs |
| 189 | (defun auth-source-pass-entries () | 200 | (defun auth-source-pass-entries () |
| 190 | "Return a list of all password store entries." | 201 | "Return a list of all password store entries." |
| 191 | (let ((store-dir (expand-file-name "~/.password-store/"))) | 202 | (let ((store-dir (expand-file-name auth-source-pass-filename))) |
| 192 | (mapcar | 203 | (mapcar |
| 193 | (lambda (file) (file-name-sans-extension (file-relative-name file store-dir))) | 204 | (lambda (file) (file-name-sans-extension (file-relative-name file store-dir))) |
| 194 | (directory-files-recursively store-dir "\\.gpg$")))) | 205 | (directory-files-recursively store-dir "\\.gpg$")))) |