-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.py
37 lines (32 loc) · 1.08 KB
/
types.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from dataclasses import dataclass
class SessionType:
# see: https://www.sfu.ca/information-systems/services/cas/cas-for-web-applications/
# for more info on the kinds of members
FACULTY = "faculty"
# TODO: what will happen to the maillists for authentication; are groups part of this?
CSSS_MEMBER = "csss member" # !cs-students maillist
STUDENT = "student"
ALUMNI = "alumni"
SFU = "sfu"
@staticmethod
def valid_session_type_list():
# values taken from https://www.sfu.ca/information-systems/services/cas/cas-for-web-applications.html
return [
"faculty",
"student",
"alumni",
"sfu"
]
@dataclass
class SiteUserData:
computing_id: str
first_logged_in: str
last_logged_in: str
profile_picture_url: None | str
def serializable_dict(self):
return {
"computing_id": self.computing_id,
"first_logged_in": self.first_logged_in,
"last_logged_in": self.last_logged_in,
"profile_picture_url": self.profile_picture_url
}