(require 'auth-source)
(require 'url-parse)
+(defgroup auth-source-pass nil
+ "password-store integration within auth-source."
+ :prefix "auth-source-pass-"
+ :group 'auth-source
+ :version "27.1")
+
+(defcustom auth-source-pass-filename "~/.password-store"
+ "Filename of the password-store folder."
+ :type 'directory
+ :version "27.1")
+
(cl-defun auth-source-pass-search (&rest spec
&key backend type host user port
&allow-other-keys)
(with-temp-buffer
(insert-file-contents (expand-file-name
(format "%s.gpg" entry)
- "~/.password-store"))
+ auth-source-pass-filename))
(buffer-substring-no-properties (point-min) (point-max))))
(defun auth-source-pass-parse-entry (entry)
;; in Emacs
(defun auth-source-pass-entries ()
"Return a list of all password store entries."
- (let ((store-dir (expand-file-name "~/.password-store/")))
+ (let ((store-dir (expand-file-name auth-source-pass-filename)))
(mapcar
(lambda (file) (file-name-sans-extension (file-relative-name file store-dir)))
(directory-files-recursively store-dir "\\.gpg$"))))