|
@@ -16,6 +16,8 @@ class JitsiMeetRoom(object):
|
16
|
16
|
issuer: typing.Union[User, JitsiMeetUser, None]=None,
|
17
|
17
|
) -> None:
|
18
|
18
|
"""
|
|
19
|
+ This class set all to create a JitsiMeetRoom according
|
|
20
|
+ to current config.
|
19
|
21
|
:param issuer: user who initiated Jitsi Meet talk
|
20
|
22
|
if None, default user is created. Can be both Tracim User or
|
21
|
23
|
JitsiMeetUser.
|
|
@@ -26,7 +28,7 @@ class JitsiMeetRoom(object):
|
26
|
28
|
self._set_domain()
|
27
|
29
|
self._set_token_params()
|
28
|
30
|
self._set_context(
|
29
|
|
- receivers=receivers,
|
|
31
|
+ workspace=receivers,
|
30
|
32
|
issuer=issuer,
|
31
|
33
|
)
|
32
|
34
|
self.room = self._generate_room_name(receivers)
|
|
@@ -45,17 +47,17 @@ class JitsiMeetRoom(object):
|
45
|
47
|
"""
|
46
|
48
|
self.use_token = self.tracim_cfg.JITSI_MEET_USE_TOKEN
|
47
|
49
|
if self.use_token:
|
48
|
|
- if self.tracim_cfg.JITSI_MEET_TOKEN_GENERATOR == 'local':
|
49
|
|
- self.token_app_id = self.tracim_cfg.JITSI_MEET_TOKEN_GENERATOR_LOCAL_APP_ID # nopep8
|
50
|
|
- self.token_secret = self.tracim_cfg.JITSI_MEET_TOKEN_GENERATOR_LOCAL_SECRET # nopep8
|
51
|
|
- self.token_alg = self.tracim_cfg.JITSI_MEET_TOKEN_GENERATOR_LOCAL_ALG # nopep8
|
52
|
|
- self.token_duration = self.tracim_cfg.JITSI_MEET_TOKEN_GENERATOR_LOCAL_DURATION # nopep8
|
53
|
|
- else:
|
|
50
|
+ if self.tracim_cfg.JITSI_MEET_TOKEN_GENERATOR != 'local':
|
54
|
51
|
raise JitsiMeetNoTokenGenerator
|
55
|
52
|
|
|
53
|
+ self.token_app_id = self.tracim_cfg.JITSI_MEET_TOKEN_GENERATOR_LOCAL_APP_ID # nopep8
|
|
54
|
+ self.token_secret = self.tracim_cfg.JITSI_MEET_TOKEN_GENERATOR_LOCAL_SECRET # nopep8
|
|
55
|
+ self.token_alg = self.tracim_cfg.JITSI_MEET_TOKEN_GENERATOR_LOCAL_ALGORITHM # nopep8
|
|
56
|
+ self.token_duration = self.tracim_cfg.JITSI_MEET_TOKEN_GENERATOR_LOCAL_DURATION # nopep8
|
|
57
|
+
|
56
|
58
|
def _set_context(
|
57
|
59
|
self,
|
58
|
|
- receivers: Workspace,
|
|
60
|
+ workspace: Workspace,
|
59
|
61
|
issuer: typing.Union[User, JitsiMeetUser, None],
|
60
|
62
|
) -> None:
|
61
|
63
|
"""
|
|
@@ -63,7 +65,7 @@ class JitsiMeetRoom(object):
|
63
|
65
|
:param issuer: user who initiated Jitsi Meet talk
|
64
|
66
|
if None, default user is created. Can be both Tracim User or
|
65
|
67
|
JitsiMeetUser.
|
66
|
|
- :param receivers: User or Room who can talk with sender. Now, only
|
|
68
|
+ :param workspace: User or Room who can talk with sender. Now, only
|
67
|
69
|
Workspace are supported.
|
68
|
70
|
:return: nothing.
|
69
|
71
|
"""
|
|
@@ -84,7 +86,7 @@ class JitsiMeetRoom(object):
|
84
|
86
|
)
|
85
|
87
|
|
86
|
88
|
# INFO - G.M - 13-02-2018 - Associate
|
87
|
|
- group = receivers.label
|
|
89
|
+ group = workspace.label
|
88
|
90
|
|
89
|
91
|
self.context = JitsiMeetContext(
|
90
|
92
|
user=user,
|
|
@@ -107,7 +109,7 @@ class JitsiMeetRoom(object):
|
107
|
109
|
# Jitsi-Meet doesn't like specials_characters
|
108
|
110
|
return str_as_alpha_num_str(room)
|
109
|
111
|
|
110
|
|
- def generate_token(self) -> str:
|
|
112
|
+ def generate_jwt_token(self) -> str:
|
111
|
113
|
"""
|
112
|
114
|
Generate Jitsi-Meet related JWT token
|
113
|
115
|
:return: JWT token as str
|
|
@@ -129,6 +131,9 @@ class JitsiMeetRoom(object):
|
129
|
131
|
def generate_url(self, token=None) -> str:
|
130
|
132
|
"""
|
131
|
133
|
Generate Jitsi-Meet url with or without token
|
|
134
|
+ examples :
|
|
135
|
+ - https://myjitsiinstance/myroom
|
|
136
|
+ - https://mysecurejitsiinstance/myroom?jwt=[very_long_jwt_token]
|
132
|
137
|
:return: url as string
|
133
|
138
|
"""
|
134
|
139
|
if token:
|