wizata-dsapi 1.2.27__py3-none-any.whl → 1.2.28__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wizata_dsapi/version.py +1 -1
- wizata_dsapi/wizata_dsapi_client.py +21 -0
- {wizata_dsapi-1.2.27.dist-info → wizata_dsapi-1.2.28.dist-info}/METADATA +1 -1
- {wizata_dsapi-1.2.27.dist-info → wizata_dsapi-1.2.28.dist-info}/RECORD +7 -7
- {wizata_dsapi-1.2.27.dist-info → wizata_dsapi-1.2.28.dist-info}/LICENSE.txt +0 -0
- {wizata_dsapi-1.2.27.dist-info → wizata_dsapi-1.2.28.dist-info}/WHEEL +0 -0
- {wizata_dsapi-1.2.27.dist-info → wizata_dsapi-1.2.28.dist-info}/top_level.txt +0 -0
wizata_dsapi/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.2.
|
|
1
|
+
__version__ = "1.2.28"
|
|
@@ -15,6 +15,7 @@ import os
|
|
|
15
15
|
import types
|
|
16
16
|
import wizata_dsapi
|
|
17
17
|
import urllib.parse
|
|
18
|
+
import base64
|
|
18
19
|
|
|
19
20
|
import string
|
|
20
21
|
import random
|
|
@@ -221,6 +222,26 @@ class WizataDSAPIClient(ApiInterface):
|
|
|
221
222
|
self._process_request(method='GET', route='whoami/')
|
|
222
223
|
return self.roles, self.twins
|
|
223
224
|
|
|
225
|
+
def who_am_i(self):
|
|
226
|
+
"""
|
|
227
|
+
decrypt current JWT token used to get information about current user.
|
|
228
|
+
:return:
|
|
229
|
+
"""
|
|
230
|
+
token = self.__token()
|
|
231
|
+
if token is None:
|
|
232
|
+
return {}
|
|
233
|
+
parts = token.split('.')
|
|
234
|
+
if len(parts) != 3:
|
|
235
|
+
return None # not a JWT
|
|
236
|
+
_, payload_b64, _ = parts
|
|
237
|
+
def _b64url_decode(input_str: str) -> bytes:
|
|
238
|
+
rem = len(input_str) % 4
|
|
239
|
+
if rem:
|
|
240
|
+
input_str += '=' * (4 - rem)
|
|
241
|
+
return base64.urlsafe_b64decode(input_str.encode('utf-8'))
|
|
242
|
+
payload_json = json.loads(_b64url_decode(payload_b64).decode('utf-8'))
|
|
243
|
+
return payload_json
|
|
244
|
+
|
|
224
245
|
def _process_request(self,
|
|
225
246
|
method: str,
|
|
226
247
|
route: str,
|
|
@@ -31,10 +31,10 @@ wizata_dsapi/template.py,sha256=wtCRKKk3PchH4RrNgNYlEF_9C6bzZwKIeLyEvgv6Fdo,1370
|
|
|
31
31
|
wizata_dsapi/trigger.py,sha256=w3BZYP-L3SUwvaT0oCTanh_Ewn57peZvlt7vxzHv9J8,5129
|
|
32
32
|
wizata_dsapi/twin.py,sha256=S0DUzQf1smZXZTdXpXZPtkZYCfKIhw53EecCnsl9i4Q,11017
|
|
33
33
|
wizata_dsapi/twinregistration.py,sha256=Mi6-YuwroiEXc0c1hgrOaphh4hNVoHupxOnXedVtJtE,13377
|
|
34
|
-
wizata_dsapi/version.py,sha256=
|
|
34
|
+
wizata_dsapi/version.py,sha256=sZoYrdh97RjbwC1rg-3mt6kqvjxTxWL7ejhDDrG6mVM,23
|
|
35
35
|
wizata_dsapi/wizard_function.py,sha256=RbM7W7Gf-6Rhp_1dU9DBYkHaciknGAGvuAndhAS_vyo,942
|
|
36
36
|
wizata_dsapi/wizard_request.py,sha256=v6BaqKLKvTWmUSo0_gda9FabAQz5x_-GOH1Av50GzFo,3762
|
|
37
|
-
wizata_dsapi/wizata_dsapi_client.py,sha256=
|
|
37
|
+
wizata_dsapi/wizata_dsapi_client.py,sha256=tW4vQDEIo6ZxwEu03vVoWXLw3pSmqYM4hP4iu-NbSvA,79364
|
|
38
38
|
wizata_dsapi/words.py,sha256=tV8CqzCqODZCV7PgBxBF5exBxeF_ya9t5DiUy-cg6Sg,1535
|
|
39
39
|
wizata_dsapi/models/__init__.py,sha256=O5PHqw8lKILw4apO-MfDxPz73wK0vADD9y3xjuzX7Tw,104
|
|
40
40
|
wizata_dsapi/models/common.py,sha256=1dTqE80-mFJnUwEdNlJdhJzfZ2N5Kp8Nb3LQ8uwPtLc,3808
|
|
@@ -42,8 +42,8 @@ wizata_dsapi/plots/__init__.py,sha256=qgnSFqrjOPur-807M8uh5awIfjM1ZHXUXcAqHc-r2l
|
|
|
42
42
|
wizata_dsapi/plots/common.py,sha256=jdPsJqLHBwSKc6dX83BSGPqSRxzIVNHSYO5yI_8sjGk,6568
|
|
43
43
|
wizata_dsapi/scripts/__init__.py,sha256=hAxiETSQf0qOHde1si1tEAJU48seqEgHrchCzS2-LvQ,80
|
|
44
44
|
wizata_dsapi/scripts/common.py,sha256=efwq-Rd0lvYljIs3gSFz9izogBD7asOU2cTK-IvHTkM,4244
|
|
45
|
-
wizata_dsapi-1.2.
|
|
46
|
-
wizata_dsapi-1.2.
|
|
47
|
-
wizata_dsapi-1.2.
|
|
48
|
-
wizata_dsapi-1.2.
|
|
49
|
-
wizata_dsapi-1.2.
|
|
45
|
+
wizata_dsapi-1.2.28.dist-info/LICENSE.txt,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
46
|
+
wizata_dsapi-1.2.28.dist-info/METADATA,sha256=IQBoeuXslxKLkmNrnnf0blXNJZZdzfsfnMSDPPB1ReU,2188
|
|
47
|
+
wizata_dsapi-1.2.28.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
|
48
|
+
wizata_dsapi-1.2.28.dist-info/top_level.txt,sha256=-OeTJbEnh5DuWyTOHtvw0Dw3LRg3G27TNS6W4ZtfwPs,13
|
|
49
|
+
wizata_dsapi-1.2.28.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|