aboutsummaryrefslogtreecommitdiffstats
path: root/cloud_mdir_sync/config.py
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2020-05-28 10:13:37 -0300
committerJason Gunthorpe <jgg@mellanox.com>2020-05-28 11:41:47 -0300
commit192d633a13adf2d552f4257f4975b066204b9da9 (patch)
tree544fd2e7ec777e2bbf123369fd3de064958425c6 /cloud_mdir_sync/config.py
parent72b3e5ff5d68d9f70257f9556068cc1e5de23e1c (diff)
downloadcloud_mdir_sync-192d633a13adf2d552f4257f4975b066204b9da9.tar.gz
cloud_mdir_sync-192d633a13adf2d552f4257f4975b066204b9da9.tar.bz2
cloud_mdir_sync-192d633a13adf2d552f4257f4975b066204b9da9.zip
Add OAUTH Credential server
The OAUTH credential server allows CMS to ack as an OAUTH broker and supply bearer tokens to other applications in the system. Currently this only support SMTP tokens for outbound mail delivery. A UNIX domain socket is used to communicate between the SMTP agent and CMS. A simple one line protocol is used to specify the account requested and CMS returns the plain XAOUTH2 response string. The agent is responsible to base64 encode it. This works for GMail and O365 mailboxes. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Diffstat (limited to 'cloud_mdir_sync/config.py')
-rw-r--r--cloud_mdir_sync/config.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/cloud_mdir_sync/config.py b/cloud_mdir_sync/config.py
index 88a16b6..79ab4a9 100644
--- a/cloud_mdir_sync/config.py
+++ b/cloud_mdir_sync/config.py
@@ -116,5 +116,10 @@ class Config(object):
self.local_mboxes.append(MailDirMailbox(self, directory))
return self.local_mboxes[-1]
+ def CredentialServer(self, path: str, accounts: List, umask=0o600):
+ from .credsrv import CredentialServer
+ self.async_tasks.append(CredentialServer(self, path, accounts, umask))
+ return self.async_tasks[-1]
+
def _direct_message(self, msg):
return self.local_mboxes[0]