You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ponymail.apache.org by hu...@apache.org on 2020/09/07 02:40:47 UTC

[incubator-ponymail-foal] 02/05: Set data if passed, add oauth_data sub-object

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git

commit 88c5e2282d5830fcc427bde334d581f08513e42e
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Mon Sep 7 04:30:01 2020 +0200

    Set data if passed, add oauth_data sub-object
---
 server/plugins/session.py | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/server/plugins/session.py b/server/plugins/session.py
index 9f6c4d3..fde3cfc 100644
--- a/server/plugins/session.py
+++ b/server/plugins/session.py
@@ -37,10 +37,17 @@ class SessionCredentials:
     provider: str
     authoritative: bool
     admin: bool
+    oauth_data: dict
 
     def __init__(self, doc: typing.Dict = None):
         if doc:
-            pass
+            self.uid = doc.get('uid', '')
+            self.name = doc.get('name', '')
+            self.email = doc.get('email', '')
+            self.provider = doc.get('provider', 'generic')
+            self.authoritative = doc.get('authoritative', False)
+            self.admin = doc.get('admin', False)
+            self.oauth_data = doc.get('oauth_data', {})
         else:
             self.uid = ""
             self.name = ""
@@ -48,6 +55,7 @@ class SessionCredentials:
             self.provider = "generic"
             self.authoritative = False
             self.admin = False
+            self.oauth_data = {}
 
 
 class SessionObject: