Hey gang!
So I’ve used gopass for awhile now, and Emacs for longer.
I was wondering if any of you here interact with gopass via Emacs with auth-source
or something similar.
The main reason I ask is because I’m wanting to finally use Emacs for other things, such as an IRC client and making more use of Magit, and even writing with 750words.
A lot of my passwords are stored with gopass, and the structure isn’t always the same for stores. For instance:
| Forums
|-- Gentoo
|-- Some other forum
|
| Email Host
|-- [email protected]
|---- password
|---- recovery codes
|
| Employer Name
|-- Some program we use at work
|---- [email protected]
|
| Some app
|-- My User Name
Maybe this structure for a password store is a no-no, though it’s not a big deal to move things around.
Any tips? I’ve seen auth-source-gopass
, but that doesn’t provide any interaction with selection of passwords or creation of passwords, I think.
I’ve look at that mentioned library some and writing an auth-source
backend doesn’t seem too involved, but maybe I don’t necessarily have to with auth-source
.
EDIT:
A potential configuration that others might use:
(require 'consult)
(require 'auth-source-pass)
(use-package pass
:requires password-store
:preface
(defvar consult:pass-source
`(:name "Passwords"
:narrow ?< ;; maybe you want something else for narrow?
:face pass-mode-directory-face ;; maybe you want to use a different face?
:category pass
:enabled
,(lambda ()
(auth-source-pass-file-name-p auth-source-pass-filename))
:items ,#'password-store-list)
"Consult source for passwords with (go)pass.")
(defun consult:pass (arg pass)
"Stolen from Doom Emacs.
https://github.com/doomemacs/doomemacs/blob/master/modules/tools/pass/autoload/consult.el"
(interactive
(list current-prefix-arg
(progn
(require 'consult)
(consult--read consult:pass-source
:prompt "(Go)Pass: "
:sort nil
:require-match t
:category 'pass))))
(funcall (if arg
#'password-store-url
#'password-store-copy)
pass))
:custom
(password-store-executable (executable-find "gopass"))
(auth-source-pass-filename
(or (getenv "PASSWORD_STORE_DIR")
(expand-file-name "~/.local/share/gopass/stores/root")))
:config
(auth-source-pass-enable))
I guess I’m supposed to know what gopass is. Is it this? https://github.com/gopasspw/gopass
Yes, should’ve mentioned that in my post.