|
|
@@ -32,6 +32,8 @@
|
|
|
|
|
|
(require 'json)
|
|
|
|
|
|
+;=============================== custom variables ==============================
|
|
|
+
|
|
|
(defcustom bitwarden-bw-executable (executable-find "bw")
|
|
|
"The bw cli executable used by Bitwarden."
|
|
|
:group 'bitwarden
|
|
|
@@ -61,6 +63,8 @@ example, this can be the :secret plist from
|
|
|
(defconst bitwarden--err-multiple "more than one result found")
|
|
|
(defconst bitwarden--err-locked "vault is locked")
|
|
|
|
|
|
+;===================================== util ====================================
|
|
|
+
|
|
|
(defun bitwarden-logged-in-p ()
|
|
|
"Check if `bitwarden-user' is logged in.
|
|
|
Returns nil if not logged in."
|
|
|
@@ -162,6 +166,8 @@ the command and whether to pass the user."
|
|
|
(concat bitwarden-bw-executable " " cmd))))
|
|
|
(set-process-filter process #'bitwarden--login-proc-filter)))
|
|
|
|
|
|
+;================================= interactive =================================
|
|
|
+
|
|
|
(defun bitwarden-unlock ()
|
|
|
"Unlock bitwarden vault.
|
|
|
It is not sufficient to check the env variable for BW_SESSION
|