summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Velghe <kevin@paretje.be>2016-04-01 22:37:49 +0200
committerKevin Velghe <kevin@paretje.be>2016-04-01 22:52:32 +0200
commit35fa7b3989a7b9bebe19848bbd8b6056f758bccb (patch)
tree5bc2c44df097f90d76463cc515d5b848a6aa9cfa
parent3b24e70db1989a6cb6c2b9731b0a5f62964e895c (diff)
downloadqutebrowser-35fa7b3989a7b9bebe19848bbd8b6056f758bccb.tar.gz
qutebrowser-35fa7b3989a7b9bebe19848bbd8b6056f758bccb.zip
Implement libsecret password backend
-rwxr-xr-xmisc/userscripts/password_fill22
1 files changed, 22 insertions, 0 deletions
diff --git a/misc/userscripts/password_fill b/misc/userscripts/password_fill
index bc12e228b..fba09c78e 100755
--- a/misc/userscripts/password_fill
+++ b/misc/userscripts/password_fill
@@ -273,6 +273,28 @@ pass_backend() {
}
# =======================================================
+# =======================================================
+# backend: secret
+secret_backend() {
+ init() {
+ return
+ }
+ query_entries() {
+ local domain="$1"
+ while read -r line ; do
+ if [[ "$line" =~ "attribute.username = " ]] ; then
+ files+=("$domain ${line#${BASH_REMATCH[0]}}")
+ fi
+ done < <( secret-tool search --unlock --all domain "$domain" 2>&1 )
+ }
+ open_entry() {
+ local domain="${1%% *}"
+ username="${1#* }"
+ password=$(secret-tool lookup domain "$domain" username "$username")
+ }
+}
+# =======================================================
+
# load some sane default backend
reset_backend
pass_backend