oldaplib 0.2.8__py3-none-any.whl → 0.2.9__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.
oldaplib/src/connection.py
CHANGED
|
@@ -96,7 +96,7 @@ class Connection(IConnection):
|
|
|
96
96
|
_query_url: str
|
|
97
97
|
_update_url: str
|
|
98
98
|
_transaction_url: Optional[str]
|
|
99
|
-
__jwtkey: str
|
|
99
|
+
__jwtkey: str
|
|
100
100
|
_switcher = {
|
|
101
101
|
SparqlResultFormat.XML: lambda a: a.text,
|
|
102
102
|
SparqlResultFormat.JSON: lambda a: a.json(),
|
|
@@ -140,6 +140,7 @@ class Connection(IConnection):
|
|
|
140
140
|
in specific scenarios.
|
|
141
141
|
"""
|
|
142
142
|
super().__init__(context_name=context_name)
|
|
143
|
+
self.__jwtkey = os.getenv("OLDAP_JWT_SECRET", "You have to change this!!! +D&RWG+")
|
|
143
144
|
self._server = server or os.getenv("OLDAP_TS_SERVER", "http://localhost:7200")
|
|
144
145
|
self._repo = repo or os.getenv("OLDAP_TS_REPO", "oldap")
|
|
145
146
|
self._dbuser = dbuser or os.getenv("OLDAP_TS_USER", "")
|
|
@@ -153,7 +154,7 @@ class Connection(IConnection):
|
|
|
153
154
|
context = Context(name=context_name)
|
|
154
155
|
if token is not None:
|
|
155
156
|
try:
|
|
156
|
-
payload = jwt.decode(jwt=token, key=
|
|
157
|
+
payload = jwt.decode(jwt=token, key=self.__jwtkey, algorithms="HS256")
|
|
157
158
|
except InvalidTokenError:
|
|
158
159
|
logger.error("Connection with invalid token")
|
|
159
160
|
raise OldapError("Wrong credentials")
|
|
@@ -206,7 +207,7 @@ class Connection(IConnection):
|
|
|
206
207
|
}
|
|
207
208
|
self._token = jwt.encode(
|
|
208
209
|
payload=payload,
|
|
209
|
-
key=
|
|
210
|
+
key=self.__jwtkey,
|
|
210
211
|
algorithm="HS256")
|
|
211
212
|
#
|
|
212
213
|
# Get projects and add to Context
|
|
@@ -250,7 +251,7 @@ class Connection(IConnection):
|
|
|
250
251
|
@property
|
|
251
252
|
def jwtkey(self) -> str:
|
|
252
253
|
"""Getter for the JWT token"""
|
|
253
|
-
return
|
|
254
|
+
return self.__jwtkey
|
|
254
255
|
|
|
255
256
|
@property
|
|
256
257
|
def server(self) -> str:
|
oldaplib/src/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.2.
|
|
1
|
+
__version__ = "0.2.9"
|
|
@@ -7,7 +7,7 @@ oldaplib/ontologies/oldap.ttl,sha256=w4q5SX6UIeuYXI2nxNSxzsjZKfR5-mDoLaJXyODBUps
|
|
|
7
7
|
oldaplib/ontologies/shared.trig,sha256=Am3_Nrp1j6fr3W0CEns-RczBRX96mQD0T1GgSjdmvDY,17233
|
|
8
8
|
oldaplib/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
oldaplib/src/cachesingleton.py,sha256=RzQz5-rSAuqgF0TbkdHPwdOjoGxpHFqO8Fpips4AK54,3550
|
|
10
|
-
oldaplib/src/connection.py,sha256=
|
|
10
|
+
oldaplib/src/connection.py,sha256=LJMJO65QhSbheIEBnOCphRyAD1STwkO8zfNcYPcKwP8,29016
|
|
11
11
|
oldaplib/src/datamodel.py,sha256=7jhqiFYT9fkn6cNTCn5Q7QfxSy29QyMrcVferPZLQrE,30309
|
|
12
12
|
oldaplib/src/dtypes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
13
13
|
oldaplib/src/dtypes/bnode.py,sha256=aPdm6FpqqFXCAtZJtOniLwIUFRcxK4XmwpCcg3PEnGc,1554
|
|
@@ -66,7 +66,7 @@ oldaplib/src/propertyclass.py,sha256=sOxK1S5SEGOoUqSKrV4hxWAluNMagnTnPFoo5JuuWEQ
|
|
|
66
66
|
oldaplib/src/resourceclass.py,sha256=DSuLMmgWutLUCbC1NuoBVwLHalDakeipMP3-NmnWx_g,98981
|
|
67
67
|
oldaplib/src/user.py,sha256=Z4GXPRkaHXx3glUpPXQdFqYMxQPOuqayDwkTAE5RGjU,48820
|
|
68
68
|
oldaplib/src/userdataclass.py,sha256=FbZkcRt0pKbOeqsZ7HbpwoKE-XPWH2AqpHG1GcsrBPo,12364
|
|
69
|
-
oldaplib/src/version.py,sha256=
|
|
69
|
+
oldaplib/src/version.py,sha256=oVsqrXzR8GvkVDBk6i2YQGHXmKdqeqypnb-K9OFmLlg,21
|
|
70
70
|
oldaplib/src/xsd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
71
71
|
oldaplib/src/xsd/floatingpoint.py,sha256=rDReKqh0mXyc4F5wslgTUxbeGf3-PGERyughj5_62YI,8852
|
|
72
72
|
oldaplib/src/xsd/iri.py,sha256=tXOuDASdQ6k9KKp2wTO8H4K8yb-_o8jFPanua7wCHog,8269
|
|
@@ -152,6 +152,6 @@ oldaplib/testdata/source_type.yaml,sha256=dSihKikw3O-IlGf6anj5KWMoBYLaweLVF1Zojm
|
|
|
152
152
|
oldaplib/testdata/test_move_left_of_toL.yaml,sha256=2m1OSQrQFlsCQxeJrjzBAO74LMprNDo_HuyrYGsOeXI,787
|
|
153
153
|
oldaplib/testdata/testlist.yaml,sha256=AT11nXEG81Sfyb-tr1gQV0H_dZBrOCcFuHf7YtL8P2g,1994
|
|
154
154
|
oldaplib/testit.http,sha256=qW7mnr6aNLXFG6lQdLgyhXILOPN6qc5iFVZclLyVvkY,303
|
|
155
|
-
oldaplib-0.2.
|
|
156
|
-
oldaplib-0.2.
|
|
157
|
-
oldaplib-0.2.
|
|
155
|
+
oldaplib-0.2.9.dist-info/METADATA,sha256=UyG0whMOpshjA9sVHMfqAfqWxqnFcIkHG5jAtLlgcEw,2803
|
|
156
|
+
oldaplib-0.2.9.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
157
|
+
oldaplib-0.2.9.dist-info/RECORD,,
|
|
File without changes
|