about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2019-12-26T11·52+0100
committerVincent Ambo <tazjin@google.com>2019-12-26T12·02+0100
commita07571a4dbdee4f87aeb57701f1a26b2d09278fb (patch)
tree492efe1429936b963e9a60e419507386d51cdc77
parent29af390e8c146e9f741710342db1aa369681fb75 (diff)
feat(third_party/lieer): Request OAuth2 scope for sending emails r/303
This makes it possible to reuse the lieer tokens for sending emails
from XOAUTH2-compatible SMTP clients.
-rw-r--r--third_party/lieer/default.nix2
-rw-r--r--third_party/lieer/send_scope.patch13
2 files changed, 15 insertions, 0 deletions
diff --git a/third_party/lieer/default.nix b/third_party/lieer/default.nix
index 80bd06350120..0c399db158b5 100644
--- a/third_party/lieer/default.nix
+++ b/third_party/lieer/default.nix
@@ -18,6 +18,8 @@ python3Packages.buildPythonApplication rec {
     sha256 = "1zzylv8xbcrh34bz0s29dawzcyx39lai8y8wk0bl4x75v1jfynvf";
   };
 
+  patches = [ ./send_scope.patch ];
+
   propagatedBuildInputs = with python3Packages; [
     notmuch
     oauth2client
diff --git a/third_party/lieer/send_scope.patch b/third_party/lieer/send_scope.patch
new file mode 100644
index 000000000000..32f4ead5335d
--- /dev/null
+++ b/third_party/lieer/send_scope.patch
@@ -0,0 +1,13 @@
+diff --git a/lieer/remote.py b/lieer/remote.py
+index 6e3973a..ade1082 100644
+--- a/lieer/remote.py
++++ b/lieer/remote.py
+@@ -9,7 +9,7 @@ from oauth2client.file import Storage
+ from pathlib import Path
+ 
+ class Remote:
+-  SCOPES = 'https://www.googleapis.com/auth/gmail.readonly https://www.googleapis.com/auth/gmail.labels https://www.googleapis.com/auth/gmail.modify'
++  SCOPES = 'https://www.googleapis.com/auth/gmail.readonly https://www.googleapis.com/auth/gmail.labels https://www.googleapis.com/auth/gmail.modify https://www.googleapis.com/auth/gmail.send'
+   APPLICATION_NAME   = 'Lieer'
+   CLIENT_SECRET_FILE = None
+   authorized         = False