diff options
author | 2021-10-21 23:45:24 -0700 | |
---|---|---|
committer | 2021-11-02 22:06:32 -0700 | |
commit | f5896ccc12007abbb89688685fcd061c1d4b4bed (patch) | |
tree | f48cc6ef3964e4c86c2b0d2d99e724ab8681c488 /mbsync/usr/bin | |
parent | 92d2d4650e645853333474c16234a8a1d5a705f9 (diff) | |
download | new-dotfiles-f5896ccc12007abbb89688685fcd061c1d4b4bed.tar.gz new-dotfiles-f5896ccc12007abbb89688685fcd061c1d4b4bed.zip |
[mbsync] Get the account credentials from the secret service
Instead of using my custom Python script that looks them up, just use the
command-line application included in the ‘libsecret’ package on Archlinux.
Remove the custom helper script that I’d written for them.
Diffstat (limited to 'mbsync/usr/bin')
-rwxr-xr-x | mbsync/usr/bin/get-mail-password | 12 | ||||
-rwxr-xr-x | mbsync/usr/bin/set-mail-password | 17 |
2 files changed, 0 insertions, 29 deletions
diff --git a/mbsync/usr/bin/get-mail-password b/mbsync/usr/bin/get-mail-password deleted file mode 100755 index ecfbb09..0000000 --- a/mbsync/usr/bin/get-mail-password +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/python3 - -import sys -import secretstorage - -connection = secretstorage.dbus_init() -collection = secretstorage.get_collection_by_alias(connection, "login") - -for foo in collection.search_items( - {"application": "mbsync", "account": sys.argv[1]} -): - print(foo.get_secret().decode()) diff --git a/mbsync/usr/bin/set-mail-password b/mbsync/usr/bin/set-mail-password deleted file mode 100755 index c36e39b..0000000 --- a/mbsync/usr/bin/set-mail-password +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/python3 - -import sys -from getpass import getpass -import secretstorage - -connection = secretstorage.dbus_init() -collection = secretstorage.get_collection_by_alias(connection, "login") -attributes = {"application": "mbsync", "account": sys.argv[1]} - -collection.create_item( - "Password for '{}' on '{}'".format( - attributes["account"], attributes["application"] - ), - attributes, - getpass().encode(), -) |