pyxecm 1.4__py3-none-any.whl → 1.5__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.
Potentially problematic release.
This version of pyxecm might be problematic. Click here for more details.
- pyxecm/__init__.py +3 -0
- pyxecm/coreshare.py +2636 -0
- pyxecm/customizer/__init__.py +4 -0
- pyxecm/customizer/browser_automation.py +164 -54
- pyxecm/customizer/customizer.py +451 -235
- pyxecm/customizer/k8s.py +6 -6
- pyxecm/customizer/m365.py +1136 -221
- pyxecm/customizer/payload.py +13163 -5844
- pyxecm/customizer/pht.py +503 -0
- pyxecm/customizer/salesforce.py +694 -114
- pyxecm/customizer/sap.py +4 -4
- pyxecm/customizer/servicenow.py +1221 -0
- pyxecm/customizer/successfactors.py +1056 -0
- pyxecm/helper/__init__.py +2 -0
- pyxecm/helper/assoc.py +24 -1
- pyxecm/helper/data.py +1527 -0
- pyxecm/helper/web.py +170 -46
- pyxecm/helper/xml.py +170 -34
- pyxecm/otac.py +309 -23
- pyxecm/otcs.py +2779 -698
- pyxecm/otds.py +347 -108
- pyxecm/otmm.py +808 -0
- pyxecm/otpd.py +13 -10
- {pyxecm-1.4.dist-info → pyxecm-1.5.dist-info}/METADATA +3 -1
- pyxecm-1.5.dist-info/RECORD +30 -0
- {pyxecm-1.4.dist-info → pyxecm-1.5.dist-info}/WHEEL +1 -1
- pyxecm-1.4.dist-info/RECORD +0 -24
- {pyxecm-1.4.dist-info → pyxecm-1.5.dist-info}/LICENSE +0 -0
- {pyxecm-1.4.dist-info → pyxecm-1.5.dist-info}/top_level.txt +0 -0
pyxecm/otds.py
CHANGED
|
@@ -213,6 +213,8 @@ class OTDS:
|
|
|
213
213
|
"""
|
|
214
214
|
return self._config
|
|
215
215
|
|
|
216
|
+
# end method definition
|
|
217
|
+
|
|
216
218
|
def cookie(self) -> dict:
|
|
217
219
|
"""Returns the login cookie of OTDS.
|
|
218
220
|
This is set by the authenticate() method
|
|
@@ -222,6 +224,8 @@ class OTDS:
|
|
|
222
224
|
"""
|
|
223
225
|
return self._cookie
|
|
224
226
|
|
|
227
|
+
# end method definition
|
|
228
|
+
|
|
225
229
|
def credentials(self) -> dict:
|
|
226
230
|
"""Returns the credentials (username + password)
|
|
227
231
|
|
|
@@ -233,6 +237,8 @@ class OTDS:
|
|
|
233
237
|
"password": self.config()["password"],
|
|
234
238
|
}
|
|
235
239
|
|
|
240
|
+
# end method definition
|
|
241
|
+
|
|
236
242
|
def base_url(self) -> str:
|
|
237
243
|
"""Returns the base URL of OTDS
|
|
238
244
|
|
|
@@ -241,6 +247,8 @@ class OTDS:
|
|
|
241
247
|
"""
|
|
242
248
|
return self.config()["baseUrl"]
|
|
243
249
|
|
|
250
|
+
# end method definition
|
|
251
|
+
|
|
244
252
|
def rest_url(self) -> str:
|
|
245
253
|
"""Returns the REST URL of OTDS
|
|
246
254
|
|
|
@@ -249,6 +257,8 @@ class OTDS:
|
|
|
249
257
|
"""
|
|
250
258
|
return self.config()["restUrl"]
|
|
251
259
|
|
|
260
|
+
# end method definition
|
|
261
|
+
|
|
252
262
|
def credential_url(self) -> str:
|
|
253
263
|
"""Returns the Credentials URL of OTDS
|
|
254
264
|
|
|
@@ -257,6 +267,8 @@ class OTDS:
|
|
|
257
267
|
"""
|
|
258
268
|
return self.config()["credentialUrl"]
|
|
259
269
|
|
|
270
|
+
# end method definition
|
|
271
|
+
|
|
260
272
|
def auth_handler_url(self) -> str:
|
|
261
273
|
"""Returns the Auth Handler URL of OTDS
|
|
262
274
|
|
|
@@ -265,6 +277,8 @@ class OTDS:
|
|
|
265
277
|
"""
|
|
266
278
|
return self.config()["authHandlerUrl"]
|
|
267
279
|
|
|
280
|
+
# end method definition
|
|
281
|
+
|
|
268
282
|
def partition_url(self) -> str:
|
|
269
283
|
"""Returns the Partition URL of OTDS
|
|
270
284
|
|
|
@@ -273,6 +287,8 @@ class OTDS:
|
|
|
273
287
|
"""
|
|
274
288
|
return self.config()["partitionUrl"]
|
|
275
289
|
|
|
290
|
+
# end method definition
|
|
291
|
+
|
|
276
292
|
def access_role_url(self) -> str:
|
|
277
293
|
"""Returns the Access Role URL of OTDS
|
|
278
294
|
|
|
@@ -281,6 +297,8 @@ class OTDS:
|
|
|
281
297
|
"""
|
|
282
298
|
return self.config()["accessRoleUrl"]
|
|
283
299
|
|
|
300
|
+
# end method definition
|
|
301
|
+
|
|
284
302
|
def oauth_client_url(self) -> str:
|
|
285
303
|
"""Returns the OAuth Client URL of OTDS
|
|
286
304
|
|
|
@@ -289,6 +307,8 @@ class OTDS:
|
|
|
289
307
|
"""
|
|
290
308
|
return self.config()["oauthClientUrl"]
|
|
291
309
|
|
|
310
|
+
# end method definition
|
|
311
|
+
|
|
292
312
|
def resource_url(self) -> str:
|
|
293
313
|
"""Returns the Resource URL of OTDS
|
|
294
314
|
|
|
@@ -297,6 +317,8 @@ class OTDS:
|
|
|
297
317
|
"""
|
|
298
318
|
return self.config()["resourceUrl"]
|
|
299
319
|
|
|
320
|
+
# end method definition
|
|
321
|
+
|
|
300
322
|
def license_url(self) -> str:
|
|
301
323
|
"""Returns the License URL of OTDS
|
|
302
324
|
|
|
@@ -305,6 +327,8 @@ class OTDS:
|
|
|
305
327
|
"""
|
|
306
328
|
return self.config()["licenseUrl"]
|
|
307
329
|
|
|
330
|
+
# end method definition
|
|
331
|
+
|
|
308
332
|
def token_url(self) -> str:
|
|
309
333
|
"""Returns the Token URL of OTDS
|
|
310
334
|
|
|
@@ -313,6 +337,8 @@ class OTDS:
|
|
|
313
337
|
"""
|
|
314
338
|
return self.config()["tokenUrl"]
|
|
315
339
|
|
|
340
|
+
# end method definition
|
|
341
|
+
|
|
316
342
|
def users_url(self) -> str:
|
|
317
343
|
"""Returns the Users URL of OTDS
|
|
318
344
|
|
|
@@ -321,6 +347,8 @@ class OTDS:
|
|
|
321
347
|
"""
|
|
322
348
|
return self.config()["usersUrl"]
|
|
323
349
|
|
|
350
|
+
# end method definition
|
|
351
|
+
|
|
324
352
|
def groups_url(self) -> str:
|
|
325
353
|
"""Returns the Groups URL of OTDS
|
|
326
354
|
|
|
@@ -329,6 +357,8 @@ class OTDS:
|
|
|
329
357
|
"""
|
|
330
358
|
return self.config()["groupsUrl"]
|
|
331
359
|
|
|
360
|
+
# end method definition
|
|
361
|
+
|
|
332
362
|
def system_config_url(self) -> str:
|
|
333
363
|
"""Returns the System Config URL of OTDS
|
|
334
364
|
|
|
@@ -337,6 +367,8 @@ class OTDS:
|
|
|
337
367
|
"""
|
|
338
368
|
return self.config()["systemConfigUrl"]
|
|
339
369
|
|
|
370
|
+
# end method definition
|
|
371
|
+
|
|
340
372
|
def consolidation_url(self) -> str:
|
|
341
373
|
"""Returns the Consolidation URL of OTDS
|
|
342
374
|
|
|
@@ -345,6 +377,8 @@ class OTDS:
|
|
|
345
377
|
"""
|
|
346
378
|
return self.config()["consolidationUrl"]
|
|
347
379
|
|
|
380
|
+
# end method definition
|
|
381
|
+
|
|
348
382
|
def parse_request_response(
|
|
349
383
|
self,
|
|
350
384
|
response_object: object,
|
|
@@ -396,7 +430,7 @@ class OTDS:
|
|
|
396
430
|
|
|
397
431
|
# Already authenticated and session still valid?
|
|
398
432
|
if self._cookie and not revalidate:
|
|
399
|
-
logger.
|
|
433
|
+
logger.debug(
|
|
400
434
|
"Session still valid - return existing cookie -> %s",
|
|
401
435
|
str(self._cookie),
|
|
402
436
|
)
|
|
@@ -404,7 +438,7 @@ class OTDS:
|
|
|
404
438
|
|
|
405
439
|
otds_ticket = "NotSet"
|
|
406
440
|
|
|
407
|
-
logger.
|
|
441
|
+
logger.debug("Requesting OTDS ticket from -> %s", self.credential_url())
|
|
408
442
|
|
|
409
443
|
response = None
|
|
410
444
|
try:
|
|
@@ -429,7 +463,7 @@ class OTDS:
|
|
|
429
463
|
return None
|
|
430
464
|
else:
|
|
431
465
|
otds_ticket = authenticate_dict["ticket"]
|
|
432
|
-
logger.
|
|
466
|
+
logger.debug("Ticket -> %s", otds_ticket)
|
|
433
467
|
else:
|
|
434
468
|
logger.error("Failed to request an OTDS ticket; error -> %s", response.text)
|
|
435
469
|
return None
|
|
@@ -462,7 +496,7 @@ class OTDS:
|
|
|
462
496
|
dict: Request response (dictionary) or None if the REST call fails
|
|
463
497
|
"""
|
|
464
498
|
|
|
465
|
-
logger.
|
|
499
|
+
logger.debug("Reading license file -> %s...", path_to_license_file)
|
|
466
500
|
try:
|
|
467
501
|
with open(path_to_license_file, "rt", encoding="UTF-8") as license_file:
|
|
468
502
|
license_content = license_file.read()
|
|
@@ -491,14 +525,14 @@ class OTDS:
|
|
|
491
525
|
if existing_license:
|
|
492
526
|
request_url += "/" + existing_license[0]["id"]
|
|
493
527
|
else:
|
|
494
|
-
logger.
|
|
528
|
+
logger.debug(
|
|
495
529
|
"No existing license for resource -> %s found - adding a new license...",
|
|
496
530
|
resource_id,
|
|
497
531
|
)
|
|
498
532
|
# change strategy to create a new license:
|
|
499
533
|
update = False
|
|
500
534
|
|
|
501
|
-
logger.
|
|
535
|
+
logger.debug(
|
|
502
536
|
"Adding product license -> %s for product -> %s to resource -> %s; calling -> %s",
|
|
503
537
|
path_to_license_file,
|
|
504
538
|
product_description,
|
|
@@ -530,7 +564,7 @@ class OTDS:
|
|
|
530
564
|
return self.parse_request_response(response)
|
|
531
565
|
# Check if Session has expired - then re-authenticate and try once more
|
|
532
566
|
elif response.status_code == 401 and retries == 0:
|
|
533
|
-
logger.
|
|
567
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
534
568
|
self.authenticate(revalidate=True)
|
|
535
569
|
retries += 1
|
|
536
570
|
else:
|
|
@@ -574,7 +608,7 @@ class OTDS:
|
|
|
574
608
|
+ "&validOnly=false"
|
|
575
609
|
)
|
|
576
610
|
|
|
577
|
-
logger.
|
|
611
|
+
logger.debug(
|
|
578
612
|
"Get license for resource -> %s; calling -> %s", resource_id, request_url
|
|
579
613
|
)
|
|
580
614
|
|
|
@@ -593,7 +627,7 @@ class OTDS:
|
|
|
593
627
|
return response_dict["licenseObjects"]["_licenses"]
|
|
594
628
|
# Check if Session has expired - then re-authenticate and try once more
|
|
595
629
|
elif response.status_code == 401 and retries == 0:
|
|
596
|
-
logger.
|
|
630
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
597
631
|
self.authenticate(revalidate=True)
|
|
598
632
|
retries += 1
|
|
599
633
|
else:
|
|
@@ -619,7 +653,7 @@ class OTDS:
|
|
|
619
653
|
|
|
620
654
|
request_url = "{}/{}".format(self.license_url(), license_id)
|
|
621
655
|
|
|
622
|
-
logger.
|
|
656
|
+
logger.debug(
|
|
623
657
|
"Deleting product license -> %s from resource -> %s; calling -> %s",
|
|
624
658
|
license_id,
|
|
625
659
|
resource_id,
|
|
@@ -638,7 +672,7 @@ class OTDS:
|
|
|
638
672
|
return True
|
|
639
673
|
# Check if Session has expired - then re-authenticate and try once more
|
|
640
674
|
elif response.status_code == 401 and retries == 0:
|
|
641
|
-
logger.
|
|
675
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
642
676
|
self.authenticate(revalidate=True)
|
|
643
677
|
retries += 1
|
|
644
678
|
else:
|
|
@@ -707,7 +741,7 @@ class OTDS:
|
|
|
707
741
|
|
|
708
742
|
request_url = self.license_url() + "/object/" + license_location
|
|
709
743
|
|
|
710
|
-
logger.
|
|
744
|
+
logger.debug(
|
|
711
745
|
"Assign license feature -> %s of license -> %s associated with resource -> %s to user -> %s; calling -> %s",
|
|
712
746
|
license_feature,
|
|
713
747
|
license_location,
|
|
@@ -726,7 +760,7 @@ class OTDS:
|
|
|
726
760
|
timeout=None,
|
|
727
761
|
)
|
|
728
762
|
if response.ok:
|
|
729
|
-
logger.
|
|
763
|
+
logger.debug(
|
|
730
764
|
"Added license feature -> %s for user -> %s",
|
|
731
765
|
license_feature,
|
|
732
766
|
user_id,
|
|
@@ -734,7 +768,7 @@ class OTDS:
|
|
|
734
768
|
return True
|
|
735
769
|
# Check if Session has expired - then re-authenticate and try once more
|
|
736
770
|
elif response.status_code == 401 and retries == 0:
|
|
737
|
-
logger.
|
|
771
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
738
772
|
self.authenticate(revalidate=True)
|
|
739
773
|
retries += 1
|
|
740
774
|
else:
|
|
@@ -812,7 +846,7 @@ class OTDS:
|
|
|
812
846
|
|
|
813
847
|
request_url = self.license_url() + "/object/" + license_location
|
|
814
848
|
|
|
815
|
-
logger.
|
|
849
|
+
logger.debug(
|
|
816
850
|
"Assign license feature -> %s of license -> %s associated with resource -> %s to partition -> %s; calling -> %s",
|
|
817
851
|
license_feature,
|
|
818
852
|
license_location,
|
|
@@ -831,7 +865,7 @@ class OTDS:
|
|
|
831
865
|
timeout=None,
|
|
832
866
|
)
|
|
833
867
|
if response.ok:
|
|
834
|
-
logger.
|
|
868
|
+
logger.debug(
|
|
835
869
|
"Added license feature -> %s for partition -> %s",
|
|
836
870
|
license_feature,
|
|
837
871
|
partition_name,
|
|
@@ -839,7 +873,7 @@ class OTDS:
|
|
|
839
873
|
return True
|
|
840
874
|
# Check if Session has expired - then re-authenticate and try once more
|
|
841
875
|
elif response.status_code == 401 and retries == 0:
|
|
842
|
-
logger.
|
|
876
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
843
877
|
self.authenticate(revalidate=True)
|
|
844
878
|
retries += 1
|
|
845
879
|
else:
|
|
@@ -925,7 +959,7 @@ class OTDS:
|
|
|
925
959
|
+ license_feature
|
|
926
960
|
)
|
|
927
961
|
|
|
928
|
-
logger.
|
|
962
|
+
logger.debug(
|
|
929
963
|
"Get licensed objects for license -> %s and license feature -> %s associated with resource -> %s; calling -> %s",
|
|
930
964
|
license_name,
|
|
931
965
|
license_feature,
|
|
@@ -945,7 +979,7 @@ class OTDS:
|
|
|
945
979
|
return self.parse_request_response(response)
|
|
946
980
|
# Check if Session has expired - then re-authenticate and try once more
|
|
947
981
|
elif response.status_code == 401 and retries == 0:
|
|
948
|
-
logger.
|
|
982
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
949
983
|
self.authenticate(revalidate=True)
|
|
950
984
|
retries += 1
|
|
951
985
|
else:
|
|
@@ -1102,7 +1136,7 @@ class OTDS:
|
|
|
1102
1136
|
|
|
1103
1137
|
request_url = self.partition_url()
|
|
1104
1138
|
|
|
1105
|
-
logger.
|
|
1139
|
+
logger.debug(
|
|
1106
1140
|
"Adding user partition -> %s (%s); calling -> %s",
|
|
1107
1141
|
name,
|
|
1108
1142
|
description,
|
|
@@ -1122,7 +1156,7 @@ class OTDS:
|
|
|
1122
1156
|
return self.parse_request_response(response)
|
|
1123
1157
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1124
1158
|
elif response.status_code == 401 and retries == 0:
|
|
1125
|
-
logger.
|
|
1159
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1126
1160
|
self.authenticate(revalidate=True)
|
|
1127
1161
|
retries += 1
|
|
1128
1162
|
else:
|
|
@@ -1149,7 +1183,7 @@ class OTDS:
|
|
|
1149
1183
|
|
|
1150
1184
|
request_url = "{}/{}".format(self.config()["partitionUrl"], name)
|
|
1151
1185
|
|
|
1152
|
-
logger.
|
|
1186
|
+
logger.debug("Getting user partition -> %s; calling -> %s", name, request_url)
|
|
1153
1187
|
|
|
1154
1188
|
retries = 0
|
|
1155
1189
|
while True:
|
|
@@ -1163,7 +1197,7 @@ class OTDS:
|
|
|
1163
1197
|
return self.parse_request_response(response)
|
|
1164
1198
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1165
1199
|
elif response.status_code == 401 and retries == 0:
|
|
1166
|
-
logger.
|
|
1200
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1167
1201
|
self.authenticate(revalidate=True)
|
|
1168
1202
|
retries += 1
|
|
1169
1203
|
else:
|
|
@@ -1213,7 +1247,7 @@ class OTDS:
|
|
|
1213
1247
|
|
|
1214
1248
|
request_url = self.users_url()
|
|
1215
1249
|
|
|
1216
|
-
logger.
|
|
1250
|
+
logger.debug(
|
|
1217
1251
|
"Adding user -> %s to partition -> %s; calling -> %s",
|
|
1218
1252
|
name,
|
|
1219
1253
|
partition,
|
|
@@ -1234,7 +1268,7 @@ class OTDS:
|
|
|
1234
1268
|
return self.parse_request_response(response)
|
|
1235
1269
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1236
1270
|
elif response.status_code == 401 and retries == 0:
|
|
1237
|
-
logger.
|
|
1271
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1238
1272
|
self.authenticate(revalidate=True)
|
|
1239
1273
|
retries += 1
|
|
1240
1274
|
else:
|
|
@@ -1260,7 +1294,7 @@ class OTDS:
|
|
|
1260
1294
|
|
|
1261
1295
|
request_url = self.users_url() + "/" + user_id + "@" + partition
|
|
1262
1296
|
|
|
1263
|
-
logger.
|
|
1297
|
+
logger.debug(
|
|
1264
1298
|
"Get user -> %s in partition -> %s; calling -> %s",
|
|
1265
1299
|
user_id,
|
|
1266
1300
|
partition,
|
|
@@ -1279,7 +1313,7 @@ class OTDS:
|
|
|
1279
1313
|
return self.parse_request_response(response)
|
|
1280
1314
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1281
1315
|
elif response.status_code == 401 and retries == 0:
|
|
1282
|
-
logger.
|
|
1316
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1283
1317
|
self.authenticate(revalidate=True)
|
|
1284
1318
|
retries += 1
|
|
1285
1319
|
else:
|
|
@@ -1317,14 +1351,14 @@ class OTDS:
|
|
|
1317
1351
|
request_url += "?{}".format(encodedQuery)
|
|
1318
1352
|
|
|
1319
1353
|
if partition:
|
|
1320
|
-
logger.
|
|
1354
|
+
logger.debug(
|
|
1321
1355
|
"Get all users in partition -> %s (limit -> %s); calling -> %s",
|
|
1322
1356
|
partition,
|
|
1323
1357
|
limit,
|
|
1324
1358
|
request_url,
|
|
1325
1359
|
)
|
|
1326
1360
|
else:
|
|
1327
|
-
logger.
|
|
1361
|
+
logger.debug(
|
|
1328
1362
|
"Get all users (limit -> %s); calling -> %s",
|
|
1329
1363
|
limit,
|
|
1330
1364
|
request_url,
|
|
@@ -1342,7 +1376,7 @@ class OTDS:
|
|
|
1342
1376
|
return self.parse_request_response(response)
|
|
1343
1377
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1344
1378
|
elif response.status_code == 401 and retries == 0:
|
|
1345
|
-
logger.
|
|
1379
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1346
1380
|
self.authenticate(revalidate=True)
|
|
1347
1381
|
retries += 1
|
|
1348
1382
|
else:
|
|
@@ -1390,7 +1424,7 @@ class OTDS:
|
|
|
1390
1424
|
|
|
1391
1425
|
request_url = self.users_url() + "/" + user_id
|
|
1392
1426
|
|
|
1393
|
-
logger.
|
|
1427
|
+
logger.debug(
|
|
1394
1428
|
"Update user -> %s attribute -> %s to value -> %s; calling -> %s",
|
|
1395
1429
|
user_id,
|
|
1396
1430
|
attribute_name,
|
|
@@ -1411,9 +1445,12 @@ class OTDS:
|
|
|
1411
1445
|
return self.parse_request_response(response)
|
|
1412
1446
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1413
1447
|
elif response.status_code == 401 and retries == 0:
|
|
1414
|
-
logger.
|
|
1448
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1415
1449
|
self.authenticate(revalidate=True)
|
|
1416
1450
|
retries += 1
|
|
1451
|
+
elif response.status_code == 404:
|
|
1452
|
+
logger.warning("User does not exist -> %s", user_id)
|
|
1453
|
+
return None
|
|
1417
1454
|
else:
|
|
1418
1455
|
logger.error(
|
|
1419
1456
|
"Failed to update user -> %s; error -> %s (%s)",
|
|
@@ -1437,7 +1474,7 @@ class OTDS:
|
|
|
1437
1474
|
|
|
1438
1475
|
request_url = self.users_url() + "/" + user_id + "@" + partition
|
|
1439
1476
|
|
|
1440
|
-
logger.
|
|
1477
|
+
logger.debug(
|
|
1441
1478
|
"Delete user -> %s in partition -> %s; calling -> %s",
|
|
1442
1479
|
user_id,
|
|
1443
1480
|
partition,
|
|
@@ -1456,7 +1493,7 @@ class OTDS:
|
|
|
1456
1493
|
return True
|
|
1457
1494
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1458
1495
|
elif response.status_code == 401 and retries == 0:
|
|
1459
|
-
logger.
|
|
1496
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1460
1497
|
self.authenticate(revalidate=True)
|
|
1461
1498
|
retries += 1
|
|
1462
1499
|
else:
|
|
@@ -1484,7 +1521,7 @@ class OTDS:
|
|
|
1484
1521
|
|
|
1485
1522
|
request_url = "{}/{}/password".format(self.users_url(), user_id)
|
|
1486
1523
|
|
|
1487
|
-
logger.
|
|
1524
|
+
logger.debug(
|
|
1488
1525
|
"Resetting password for user -> %s; calling -> %s", user_id, request_url
|
|
1489
1526
|
)
|
|
1490
1527
|
|
|
@@ -1501,7 +1538,7 @@ class OTDS:
|
|
|
1501
1538
|
return True
|
|
1502
1539
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1503
1540
|
elif response.status_code == 401 and retries == 0:
|
|
1504
|
-
logger.
|
|
1541
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1505
1542
|
self.authenticate(revalidate=True)
|
|
1506
1543
|
retries += 1
|
|
1507
1544
|
else:
|
|
@@ -1534,7 +1571,7 @@ class OTDS:
|
|
|
1534
1571
|
|
|
1535
1572
|
request_url = self.groups_url()
|
|
1536
1573
|
|
|
1537
|
-
logger.
|
|
1574
|
+
logger.debug(
|
|
1538
1575
|
"Adding group -> %s to partition -> %s; calling -> %s",
|
|
1539
1576
|
name,
|
|
1540
1577
|
partition,
|
|
@@ -1555,7 +1592,7 @@ class OTDS:
|
|
|
1555
1592
|
return self.parse_request_response(response)
|
|
1556
1593
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1557
1594
|
elif response.status_code == 401 and retries == 0:
|
|
1558
|
-
logger.
|
|
1595
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1559
1596
|
self.authenticate(revalidate=True)
|
|
1560
1597
|
retries += 1
|
|
1561
1598
|
else:
|
|
@@ -1596,7 +1633,7 @@ class OTDS:
|
|
|
1596
1633
|
|
|
1597
1634
|
request_url = self.groups_url() + "/" + group
|
|
1598
1635
|
|
|
1599
|
-
logger.
|
|
1636
|
+
logger.debug("Get group -> %s; calling -> %s", group, request_url)
|
|
1600
1637
|
|
|
1601
1638
|
retries = 0
|
|
1602
1639
|
while True:
|
|
@@ -1610,7 +1647,7 @@ class OTDS:
|
|
|
1610
1647
|
return self.parse_request_response(response)
|
|
1611
1648
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1612
1649
|
elif response.status_code == 401 and retries == 0:
|
|
1613
|
-
logger.
|
|
1650
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1614
1651
|
self.authenticate(revalidate=True)
|
|
1615
1652
|
retries += 1
|
|
1616
1653
|
else:
|
|
@@ -1638,7 +1675,7 @@ class OTDS:
|
|
|
1638
1675
|
|
|
1639
1676
|
request_url = self.users_url() + "/" + user + "/memberof"
|
|
1640
1677
|
|
|
1641
|
-
logger.
|
|
1678
|
+
logger.debug(
|
|
1642
1679
|
"Adding user -> %s to group -> %s; calling -> %s", user, group, request_url
|
|
1643
1680
|
)
|
|
1644
1681
|
|
|
@@ -1655,7 +1692,7 @@ class OTDS:
|
|
|
1655
1692
|
return True
|
|
1656
1693
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1657
1694
|
elif response.status_code == 401 and retries == 0:
|
|
1658
|
-
logger.
|
|
1695
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1659
1696
|
self.authenticate(revalidate=True)
|
|
1660
1697
|
retries += 1
|
|
1661
1698
|
else:
|
|
@@ -1684,7 +1721,7 @@ class OTDS:
|
|
|
1684
1721
|
|
|
1685
1722
|
request_url = self.groups_url() + "/" + group + "/memberof"
|
|
1686
1723
|
|
|
1687
|
-
logger.
|
|
1724
|
+
logger.debug(
|
|
1688
1725
|
"Adding group -> %s to parent group -> %s; calling -> %s",
|
|
1689
1726
|
group,
|
|
1690
1727
|
parent_group,
|
|
@@ -1705,7 +1742,7 @@ class OTDS:
|
|
|
1705
1742
|
return True
|
|
1706
1743
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1707
1744
|
elif response.status_code == 401 and retries == 0:
|
|
1708
|
-
logger.
|
|
1745
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1709
1746
|
self.authenticate(revalidate=True)
|
|
1710
1747
|
retries += 1
|
|
1711
1748
|
else:
|
|
@@ -1751,7 +1788,7 @@ class OTDS:
|
|
|
1751
1788
|
|
|
1752
1789
|
request_url = self.config()["resourceUrl"]
|
|
1753
1790
|
|
|
1754
|
-
logger.
|
|
1791
|
+
logger.debug(
|
|
1755
1792
|
"Adding resource -> %s (%s); calling -> %s", name, description, request_url
|
|
1756
1793
|
)
|
|
1757
1794
|
|
|
@@ -1768,7 +1805,7 @@ class OTDS:
|
|
|
1768
1805
|
return self.parse_request_response(response)
|
|
1769
1806
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1770
1807
|
elif response.status_code == 401 and retries == 0:
|
|
1771
|
-
logger.
|
|
1808
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1772
1809
|
self.authenticate(revalidate=True)
|
|
1773
1810
|
retries += 1
|
|
1774
1811
|
else:
|
|
@@ -1794,7 +1831,7 @@ class OTDS:
|
|
|
1794
1831
|
|
|
1795
1832
|
request_url = "{}/{}".format(self.config()["resourceUrl"], name)
|
|
1796
1833
|
|
|
1797
|
-
logger.
|
|
1834
|
+
logger.debug("Retrieving resource -> %s; calling -> %s", name, request_url)
|
|
1798
1835
|
|
|
1799
1836
|
retries = 0
|
|
1800
1837
|
while True:
|
|
@@ -1808,7 +1845,7 @@ class OTDS:
|
|
|
1808
1845
|
return self.parse_request_response(response)
|
|
1809
1846
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1810
1847
|
elif response.status_code == 401 and retries == 0:
|
|
1811
|
-
logger.
|
|
1848
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1812
1849
|
self.authenticate(revalidate=True)
|
|
1813
1850
|
retries += 1
|
|
1814
1851
|
else:
|
|
@@ -1821,7 +1858,7 @@ class OTDS:
|
|
|
1821
1858
|
response.text,
|
|
1822
1859
|
)
|
|
1823
1860
|
else:
|
|
1824
|
-
logger.
|
|
1861
|
+
logger.debug("Resource -> %s not found.", name)
|
|
1825
1862
|
return None
|
|
1826
1863
|
|
|
1827
1864
|
# end method definition
|
|
@@ -1841,7 +1878,7 @@ class OTDS:
|
|
|
1841
1878
|
|
|
1842
1879
|
request_url = "{}/{}".format(self.config()["resourceUrl"], name)
|
|
1843
1880
|
|
|
1844
|
-
logger.
|
|
1881
|
+
logger.debug("Updating resource -> %s; calling -> %s", name, request_url)
|
|
1845
1882
|
|
|
1846
1883
|
retries = 0
|
|
1847
1884
|
while True:
|
|
@@ -1856,7 +1893,7 @@ class OTDS:
|
|
|
1856
1893
|
return self.parse_request_response(response)
|
|
1857
1894
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1858
1895
|
elif response.status_code == 401 and retries == 0:
|
|
1859
|
-
logger.
|
|
1896
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1860
1897
|
self.authenticate(revalidate=True)
|
|
1861
1898
|
retries += 1
|
|
1862
1899
|
else:
|
|
@@ -1869,7 +1906,7 @@ class OTDS:
|
|
|
1869
1906
|
response.text,
|
|
1870
1907
|
)
|
|
1871
1908
|
else:
|
|
1872
|
-
logger.
|
|
1909
|
+
logger.debug("Resource -> %s not found.", name)
|
|
1873
1910
|
return None
|
|
1874
1911
|
|
|
1875
1912
|
# end method definition
|
|
@@ -1887,7 +1924,7 @@ class OTDS:
|
|
|
1887
1924
|
|
|
1888
1925
|
request_url = "{}/{}/activate".format(self.config()["resourceUrl"], resource_id)
|
|
1889
1926
|
|
|
1890
|
-
logger.
|
|
1927
|
+
logger.debug(
|
|
1891
1928
|
"Activating resource -> %s; calling -> %s", resource_id, request_url
|
|
1892
1929
|
)
|
|
1893
1930
|
|
|
@@ -1904,7 +1941,7 @@ class OTDS:
|
|
|
1904
1941
|
return self.parse_request_response(response)
|
|
1905
1942
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1906
1943
|
elif response.status_code == 401 and retries == 0:
|
|
1907
|
-
logger.
|
|
1944
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1908
1945
|
self.authenticate(revalidate=True)
|
|
1909
1946
|
retries += 1
|
|
1910
1947
|
else:
|
|
@@ -1929,7 +1966,7 @@ class OTDS:
|
|
|
1929
1966
|
|
|
1930
1967
|
request_url = self.config()["accessRoleUrl"]
|
|
1931
1968
|
|
|
1932
|
-
logger.
|
|
1969
|
+
logger.debug("Retrieving access roles; calling -> %s", request_url)
|
|
1933
1970
|
|
|
1934
1971
|
retries = 0
|
|
1935
1972
|
while True:
|
|
@@ -1943,7 +1980,7 @@ class OTDS:
|
|
|
1943
1980
|
return self.parse_request_response(response)
|
|
1944
1981
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1945
1982
|
elif response.status_code == 401 and retries == 0:
|
|
1946
|
-
logger.
|
|
1983
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1947
1984
|
self.authenticate(revalidate=True)
|
|
1948
1985
|
retries += 1
|
|
1949
1986
|
else:
|
|
@@ -1967,7 +2004,7 @@ class OTDS:
|
|
|
1967
2004
|
|
|
1968
2005
|
request_url = self.config()["accessRoleUrl"] + "/" + access_role
|
|
1969
2006
|
|
|
1970
|
-
logger.
|
|
2007
|
+
logger.debug(
|
|
1971
2008
|
"Retrieving access role -> %s; calling -> %s", access_role, request_url
|
|
1972
2009
|
)
|
|
1973
2010
|
|
|
@@ -1983,7 +2020,7 @@ class OTDS:
|
|
|
1983
2020
|
return self.parse_request_response(response)
|
|
1984
2021
|
# Check if Session has expired - then re-authenticate and try once more
|
|
1985
2022
|
elif response.status_code == 401 and retries == 0:
|
|
1986
|
-
logger.
|
|
2023
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
1987
2024
|
self.authenticate(revalidate=True)
|
|
1988
2025
|
retries += 1
|
|
1989
2026
|
else:
|
|
@@ -2020,7 +2057,7 @@ class OTDS:
|
|
|
2020
2057
|
self.config()["accessRoleUrl"], access_role
|
|
2021
2058
|
)
|
|
2022
2059
|
|
|
2023
|
-
logger.
|
|
2060
|
+
logger.debug(
|
|
2024
2061
|
"Add user partition -> %s to access role -> %s; calling -> %s",
|
|
2025
2062
|
partition,
|
|
2026
2063
|
access_role,
|
|
@@ -2039,7 +2076,7 @@ class OTDS:
|
|
|
2039
2076
|
if response.ok:
|
|
2040
2077
|
return True
|
|
2041
2078
|
elif response.status_code == 401 and retries == 0:
|
|
2042
|
-
logger.
|
|
2079
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
2043
2080
|
self.authenticate(revalidate=True)
|
|
2044
2081
|
retries += 1
|
|
2045
2082
|
else:
|
|
@@ -2079,14 +2116,14 @@ class OTDS:
|
|
|
2079
2116
|
accessRoleUsers = accessRolesGetResponse["accessRoleMembers"]["users"]
|
|
2080
2117
|
for user in accessRoleUsers:
|
|
2081
2118
|
if user["displayName"] == user_id:
|
|
2082
|
-
logger.
|
|
2119
|
+
logger.debug(
|
|
2083
2120
|
"User -> %s already added to access role -> %s",
|
|
2084
2121
|
user_id,
|
|
2085
2122
|
access_role,
|
|
2086
2123
|
)
|
|
2087
2124
|
return True
|
|
2088
2125
|
|
|
2089
|
-
logger.
|
|
2126
|
+
logger.debug(
|
|
2090
2127
|
"User -> %s is not yet in access role -> %s - adding...",
|
|
2091
2128
|
user_id,
|
|
2092
2129
|
access_role,
|
|
@@ -2099,7 +2136,7 @@ class OTDS:
|
|
|
2099
2136
|
self.config()["accessRoleUrl"], access_role
|
|
2100
2137
|
)
|
|
2101
2138
|
|
|
2102
|
-
logger.
|
|
2139
|
+
logger.debug(
|
|
2103
2140
|
"Add user -> %s to access role -> %s; calling -> %s",
|
|
2104
2141
|
user_id,
|
|
2105
2142
|
access_role,
|
|
@@ -2118,7 +2155,7 @@ class OTDS:
|
|
|
2118
2155
|
if response.ok:
|
|
2119
2156
|
return True
|
|
2120
2157
|
elif response.status_code == 401 and retries == 0:
|
|
2121
|
-
logger.
|
|
2158
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
2122
2159
|
self.authenticate(revalidate=True)
|
|
2123
2160
|
retries += 1
|
|
2124
2161
|
else:
|
|
@@ -2157,12 +2194,12 @@ class OTDS:
|
|
|
2157
2194
|
accessRoleGroups = accessRolesGetResponse["accessRoleMembers"]["groups"]
|
|
2158
2195
|
for accessRoleGroup in accessRoleGroups:
|
|
2159
2196
|
if accessRoleGroup["name"] == group:
|
|
2160
|
-
logger.
|
|
2197
|
+
logger.debug(
|
|
2161
2198
|
"Group -> %s already added to access role -> %s", group, access_role
|
|
2162
2199
|
)
|
|
2163
2200
|
return True
|
|
2164
2201
|
|
|
2165
|
-
logger.
|
|
2202
|
+
logger.debug(
|
|
2166
2203
|
"Group -> %s is not yet in access role -> %s - adding...",
|
|
2167
2204
|
group,
|
|
2168
2205
|
access_role,
|
|
@@ -2175,7 +2212,7 @@ class OTDS:
|
|
|
2175
2212
|
self.config()["accessRoleUrl"], access_role
|
|
2176
2213
|
)
|
|
2177
2214
|
|
|
2178
|
-
logger.
|
|
2215
|
+
logger.debug(
|
|
2179
2216
|
"Add group -> %s to access role -> %s; calling -> %s",
|
|
2180
2217
|
group,
|
|
2181
2218
|
access_role,
|
|
@@ -2194,7 +2231,7 @@ class OTDS:
|
|
|
2194
2231
|
if response.ok:
|
|
2195
2232
|
return True
|
|
2196
2233
|
elif response.status_code == 401 and retries == 0:
|
|
2197
|
-
logger.
|
|
2234
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
2198
2235
|
self.authenticate(revalidate=True)
|
|
2199
2236
|
retries += 1
|
|
2200
2237
|
else:
|
|
@@ -2237,7 +2274,7 @@ class OTDS:
|
|
|
2237
2274
|
|
|
2238
2275
|
request_url = "{}/{}/attributes".format(self.config()["accessRoleUrl"], name)
|
|
2239
2276
|
|
|
2240
|
-
logger.
|
|
2277
|
+
logger.debug(
|
|
2241
2278
|
"Update access role -> %s with attributes -> %s; calling -> %s",
|
|
2242
2279
|
name,
|
|
2243
2280
|
accessRolePutBodyJson,
|
|
@@ -2257,7 +2294,7 @@ class OTDS:
|
|
|
2257
2294
|
return self.parse_request_response(response)
|
|
2258
2295
|
# Check if Session has expired - then re-authenticate and try once more
|
|
2259
2296
|
elif response.status_code == 401 and retries == 0:
|
|
2260
|
-
logger.
|
|
2297
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
2261
2298
|
self.authenticate(revalidate=True)
|
|
2262
2299
|
retries += 1
|
|
2263
2300
|
else:
|
|
@@ -2293,7 +2330,7 @@ class OTDS:
|
|
|
2293
2330
|
request_url = "{}/system_attributes".format(self.config()["systemConfigUrl"])
|
|
2294
2331
|
|
|
2295
2332
|
if description:
|
|
2296
|
-
logger.
|
|
2333
|
+
logger.debug(
|
|
2297
2334
|
"Add system attribute -> %s (%s) with value -> %s; calling -> %s",
|
|
2298
2335
|
name,
|
|
2299
2336
|
description,
|
|
@@ -2301,7 +2338,7 @@ class OTDS:
|
|
|
2301
2338
|
request_url,
|
|
2302
2339
|
)
|
|
2303
2340
|
else:
|
|
2304
|
-
logger.
|
|
2341
|
+
logger.debug(
|
|
2305
2342
|
"Add system attribute -> %s with value -> %s; calling -> %s",
|
|
2306
2343
|
name,
|
|
2307
2344
|
value,
|
|
@@ -2321,7 +2358,7 @@ class OTDS:
|
|
|
2321
2358
|
return self.parse_request_response(response)
|
|
2322
2359
|
# Check if Session has expired - then re-authenticate and try once more
|
|
2323
2360
|
elif response.status_code == 401 and retries == 0:
|
|
2324
|
-
logger.
|
|
2361
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
2325
2362
|
self.authenticate(revalidate=True)
|
|
2326
2363
|
retries += 1
|
|
2327
2364
|
else:
|
|
@@ -2347,7 +2384,7 @@ class OTDS:
|
|
|
2347
2384
|
|
|
2348
2385
|
request_url = "{}/whitelist".format(self.config()["systemConfigUrl"])
|
|
2349
2386
|
|
|
2350
|
-
logger.
|
|
2387
|
+
logger.debug("Retrieving trusted sites; calling -> %s", request_url)
|
|
2351
2388
|
|
|
2352
2389
|
retries = 0
|
|
2353
2390
|
while True:
|
|
@@ -2361,7 +2398,7 @@ class OTDS:
|
|
|
2361
2398
|
return self.parse_request_response(response)
|
|
2362
2399
|
# Check if Session has expired - then re-authenticate and try once more
|
|
2363
2400
|
elif response.status_code == 401 and retries == 0:
|
|
2364
|
-
logger.
|
|
2401
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
2365
2402
|
self.authenticate(revalidate=True)
|
|
2366
2403
|
retries += 1
|
|
2367
2404
|
else:
|
|
@@ -2396,7 +2433,7 @@ class OTDS:
|
|
|
2396
2433
|
|
|
2397
2434
|
request_url = "{}/whitelist".format(self.config()["systemConfigUrl"])
|
|
2398
2435
|
|
|
2399
|
-
logger.
|
|
2436
|
+
logger.debug("Add trusted site -> %s; calling -> %s", trusted_site, request_url)
|
|
2400
2437
|
|
|
2401
2438
|
response = requests.put(
|
|
2402
2439
|
url=request_url,
|
|
@@ -2484,7 +2521,7 @@ class OTDS:
|
|
|
2484
2521
|
|
|
2485
2522
|
request_url = "{}/audit".format(self.config()["systemConfigUrl"])
|
|
2486
2523
|
|
|
2487
|
-
logger.
|
|
2524
|
+
logger.debug("Enable audit; calling -> %s", request_url)
|
|
2488
2525
|
|
|
2489
2526
|
response = requests.put(
|
|
2490
2527
|
url=request_url,
|
|
@@ -2605,7 +2642,7 @@ class OTDS:
|
|
|
2605
2642
|
|
|
2606
2643
|
request_url = self.oauth_client_url()
|
|
2607
2644
|
|
|
2608
|
-
logger.
|
|
2645
|
+
logger.debug(
|
|
2609
2646
|
"Adding oauth client -> %s (%s); calling -> %s",
|
|
2610
2647
|
description,
|
|
2611
2648
|
client_id,
|
|
@@ -2625,7 +2662,7 @@ class OTDS:
|
|
|
2625
2662
|
return self.parse_request_response(response)
|
|
2626
2663
|
# Check if Session has expired - then re-authenticate and try once more
|
|
2627
2664
|
elif response.status_code == 401 and retries == 0:
|
|
2628
|
-
logger.
|
|
2665
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
2629
2666
|
self.authenticate(revalidate=True)
|
|
2630
2667
|
retries += 1
|
|
2631
2668
|
else:
|
|
@@ -2651,7 +2688,7 @@ class OTDS:
|
|
|
2651
2688
|
|
|
2652
2689
|
request_url = "{}/{}".format(self.oauth_client_url(), client_id)
|
|
2653
2690
|
|
|
2654
|
-
logger.
|
|
2691
|
+
logger.debug("Get oauth client -> %s; calling -> %s", client_id, request_url)
|
|
2655
2692
|
|
|
2656
2693
|
retries = 0
|
|
2657
2694
|
while True:
|
|
@@ -2665,7 +2702,7 @@ class OTDS:
|
|
|
2665
2702
|
return self.parse_request_response(response)
|
|
2666
2703
|
# Check if Session has expired - then re-authenticate and try once more
|
|
2667
2704
|
elif response.status_code == 401 and retries == 0:
|
|
2668
|
-
logger.
|
|
2705
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
2669
2706
|
self.authenticate(revalidate=True)
|
|
2670
2707
|
retries += 1
|
|
2671
2708
|
else:
|
|
@@ -2696,7 +2733,7 @@ class OTDS:
|
|
|
2696
2733
|
|
|
2697
2734
|
request_url = "{}/{}".format(self.oauth_client_url(), client_id)
|
|
2698
2735
|
|
|
2699
|
-
logger.
|
|
2736
|
+
logger.debug(
|
|
2700
2737
|
"Update OAuth client -> %s with -> %s; calling -> %s",
|
|
2701
2738
|
client_id,
|
|
2702
2739
|
updates,
|
|
@@ -2716,7 +2753,7 @@ class OTDS:
|
|
|
2716
2753
|
return self.parse_request_response(response)
|
|
2717
2754
|
# Check if Session has expired - then re-authenticate and try once more
|
|
2718
2755
|
elif response.status_code == 401 and retries == 0:
|
|
2719
|
-
logger.
|
|
2756
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
2720
2757
|
self.authenticate(revalidate=True)
|
|
2721
2758
|
retries += 1
|
|
2722
2759
|
else:
|
|
@@ -2741,7 +2778,7 @@ class OTDS:
|
|
|
2741
2778
|
|
|
2742
2779
|
request_url = self.config()["accessRoleUrl"] + "/" + access_role_name
|
|
2743
2780
|
|
|
2744
|
-
logger.
|
|
2781
|
+
logger.debug(
|
|
2745
2782
|
"Get access role -> %s; calling -> %s", access_role_name, request_url
|
|
2746
2783
|
)
|
|
2747
2784
|
|
|
@@ -2758,7 +2795,7 @@ class OTDS:
|
|
|
2758
2795
|
break
|
|
2759
2796
|
# Check if Session has expired - then re-authenticate and try once more
|
|
2760
2797
|
elif response.status_code == 401 and retries == 0:
|
|
2761
|
-
logger.
|
|
2798
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
2762
2799
|
self.authenticate(revalidate=True)
|
|
2763
2800
|
retries += 1
|
|
2764
2801
|
else:
|
|
@@ -2823,7 +2860,7 @@ class OTDS:
|
|
|
2823
2860
|
)
|
|
2824
2861
|
|
|
2825
2862
|
if response.ok:
|
|
2826
|
-
logger.
|
|
2863
|
+
logger.debug(
|
|
2827
2864
|
"OauthClients partition successfully added to access role -> %s",
|
|
2828
2865
|
access_role_name,
|
|
2829
2866
|
)
|
|
@@ -2925,7 +2962,7 @@ class OTDS:
|
|
|
2925
2962
|
|
|
2926
2963
|
request_url = "{}/{}".format(self.auth_handler_url(), name)
|
|
2927
2964
|
|
|
2928
|
-
logger.
|
|
2965
|
+
logger.debug(
|
|
2929
2966
|
"Getting authentication handler -> %s; calling -> %s", name, request_url
|
|
2930
2967
|
)
|
|
2931
2968
|
|
|
@@ -2941,7 +2978,7 @@ class OTDS:
|
|
|
2941
2978
|
return self.parse_request_response(response)
|
|
2942
2979
|
# Check if Session has expired - then re-authenticate and try once more
|
|
2943
2980
|
elif response.status_code == 401 and retries == 0:
|
|
2944
|
-
logger.
|
|
2981
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
2945
2982
|
self.authenticate(revalidate=True)
|
|
2946
2983
|
retries += 1
|
|
2947
2984
|
else:
|
|
@@ -3070,12 +3107,214 @@ class OTDS:
|
|
|
3070
3107
|
"_description": "Specifies the SAML binding to use for the response to an AuthnRequest",
|
|
3071
3108
|
"_value": "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST",
|
|
3072
3109
|
},
|
|
3110
|
+
{
|
|
3111
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim1",
|
|
3112
|
+
"_name": "Claim 1",
|
|
3113
|
+
"_description": "SAML attribute/claim that should be mapped to an OTDS user attribute. This value is case sensitive. Note that mapped claims are only relevant if the corresponding account is auto-provisioned in OTDS. See the Administration Guide for details.",
|
|
3114
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress",
|
|
3115
|
+
},
|
|
3116
|
+
{
|
|
3117
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute1",
|
|
3118
|
+
"_name": "OTDS Attribute 1",
|
|
3119
|
+
"_description": "OTDS user attribute to which the SAML attribute/claim should be mapped",
|
|
3120
|
+
"_value": "mail",
|
|
3121
|
+
},
|
|
3122
|
+
{
|
|
3123
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim2",
|
|
3124
|
+
"_name": "Claim 2",
|
|
3125
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname",
|
|
3126
|
+
},
|
|
3127
|
+
{
|
|
3128
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute2",
|
|
3129
|
+
"_name": "OTDS Attribute 2",
|
|
3130
|
+
"_value": "givenName",
|
|
3131
|
+
},
|
|
3132
|
+
{
|
|
3133
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim3",
|
|
3134
|
+
"_name": "Claim 3",
|
|
3135
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname",
|
|
3136
|
+
},
|
|
3137
|
+
{
|
|
3138
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute3",
|
|
3139
|
+
"_name": "OTDS Attribute 3",
|
|
3140
|
+
"_value": "sn",
|
|
3141
|
+
},
|
|
3142
|
+
{
|
|
3143
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim4",
|
|
3144
|
+
"_name": "Claim 4",
|
|
3145
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
|
|
3146
|
+
},
|
|
3147
|
+
{
|
|
3148
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute4",
|
|
3149
|
+
"_name": "OTDS Attribute 4",
|
|
3150
|
+
"_value": "displayName",
|
|
3151
|
+
},
|
|
3152
|
+
{
|
|
3153
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim5",
|
|
3154
|
+
"_name": "Claim 5",
|
|
3155
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/streetaddress",
|
|
3156
|
+
},
|
|
3157
|
+
{
|
|
3158
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute5",
|
|
3159
|
+
"_name": "OTDS Attribute 5",
|
|
3160
|
+
"_value": "oTStreetAddress",
|
|
3161
|
+
},
|
|
3162
|
+
{
|
|
3163
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim6",
|
|
3164
|
+
"_name": "Claim 6",
|
|
3165
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/locality",
|
|
3166
|
+
},
|
|
3167
|
+
{
|
|
3168
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute6",
|
|
3169
|
+
"_name": "OTDS Attribute 6",
|
|
3170
|
+
"_value": "l",
|
|
3171
|
+
},
|
|
3172
|
+
{
|
|
3173
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim7",
|
|
3174
|
+
"_name": "Claim 7",
|
|
3175
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/stateorprovince",
|
|
3176
|
+
},
|
|
3177
|
+
{
|
|
3178
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute7",
|
|
3179
|
+
"_name": "OTDS Attribute 7",
|
|
3180
|
+
"_value": "st",
|
|
3181
|
+
},
|
|
3182
|
+
{
|
|
3183
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim8",
|
|
3184
|
+
"_name": "Claim 8",
|
|
3185
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/postalcode",
|
|
3186
|
+
},
|
|
3187
|
+
{
|
|
3188
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute8",
|
|
3189
|
+
"_name": "OTDS Attribute 8",
|
|
3190
|
+
"_value": "postalCode",
|
|
3191
|
+
},
|
|
3192
|
+
{
|
|
3193
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim9",
|
|
3194
|
+
"_name": "Claim 9",
|
|
3195
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country",
|
|
3196
|
+
},
|
|
3197
|
+
{
|
|
3198
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute9",
|
|
3199
|
+
"_name": "OTDS Attribute 9",
|
|
3200
|
+
"_value": "countryName",
|
|
3201
|
+
},
|
|
3202
|
+
{
|
|
3203
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim10",
|
|
3204
|
+
"_name": "Claim 10",
|
|
3205
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/otherphone",
|
|
3206
|
+
},
|
|
3207
|
+
{
|
|
3208
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute10",
|
|
3209
|
+
"_name": "OTDS Attribute 10",
|
|
3210
|
+
"_value": "oTTelephoneNumber",
|
|
3211
|
+
},
|
|
3212
|
+
{
|
|
3213
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim11",
|
|
3214
|
+
"_name": "Claim 11",
|
|
3215
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/homephone",
|
|
3216
|
+
},
|
|
3217
|
+
{
|
|
3218
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute11",
|
|
3219
|
+
"_name": "OTDS Attribute 11",
|
|
3220
|
+
"_value": "homePhone",
|
|
3221
|
+
},
|
|
3222
|
+
{
|
|
3223
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim12",
|
|
3224
|
+
"_name": "Claim 12",
|
|
3225
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dateofbirth",
|
|
3226
|
+
},
|
|
3227
|
+
{
|
|
3228
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute12",
|
|
3229
|
+
"_name": "OTDS Attribute 12",
|
|
3230
|
+
"_value": "birthDate",
|
|
3231
|
+
},
|
|
3232
|
+
{
|
|
3233
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim13",
|
|
3234
|
+
"_name": "Claim 13",
|
|
3235
|
+
"_value": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/gender",
|
|
3236
|
+
},
|
|
3237
|
+
{
|
|
3238
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute13",
|
|
3239
|
+
"_name": "OTDS Attribute 13",
|
|
3240
|
+
"_value": "gender",
|
|
3241
|
+
},
|
|
3242
|
+
{
|
|
3243
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim14",
|
|
3244
|
+
"_name": "Claim 14",
|
|
3245
|
+
"_value": "",
|
|
3246
|
+
},
|
|
3247
|
+
{
|
|
3248
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute14",
|
|
3249
|
+
"_name": "OTDS Attribute 14",
|
|
3250
|
+
"_value": "",
|
|
3251
|
+
},
|
|
3252
|
+
{
|
|
3253
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim15",
|
|
3254
|
+
"_name": "Claim 15",
|
|
3255
|
+
"_value": "http://schemas.xmlsoap.org/claims/Group",
|
|
3256
|
+
},
|
|
3257
|
+
{
|
|
3258
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute15",
|
|
3259
|
+
"_name": "OTDS Attribute 15",
|
|
3260
|
+
"_value": "oTMemberOf",
|
|
3261
|
+
},
|
|
3262
|
+
{
|
|
3263
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim16",
|
|
3264
|
+
"_name": "Claim 16",
|
|
3265
|
+
"_value": "http://schemas.xmlsoap.org/claims/Department",
|
|
3266
|
+
},
|
|
3267
|
+
{
|
|
3268
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute16",
|
|
3269
|
+
"_name": "OTDS Attribute 16",
|
|
3270
|
+
"_value": "oTDepartment",
|
|
3271
|
+
},
|
|
3272
|
+
{
|
|
3273
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim17",
|
|
3274
|
+
"_name": "Claim 17",
|
|
3275
|
+
"_value": "http://schemas.xmlsoap.org/claims/Title",
|
|
3276
|
+
},
|
|
3277
|
+
{
|
|
3278
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute17",
|
|
3279
|
+
"_name": "OTDS Attribute 17",
|
|
3280
|
+
"_value": "title",
|
|
3281
|
+
},
|
|
3282
|
+
{
|
|
3283
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim18",
|
|
3284
|
+
"_name": "Claim 18",
|
|
3285
|
+
"_value": "",
|
|
3286
|
+
},
|
|
3287
|
+
{
|
|
3288
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute18",
|
|
3289
|
+
"_name": "OTDS Attribute 18",
|
|
3290
|
+
"_value": "",
|
|
3291
|
+
},
|
|
3292
|
+
{
|
|
3293
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim19",
|
|
3294
|
+
"_name": "Claim 19",
|
|
3295
|
+
"_value": "http://schemas.microsoft.com/ws/2008/06/identity/claims/role",
|
|
3296
|
+
},
|
|
3297
|
+
{
|
|
3298
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute19",
|
|
3299
|
+
"_name": "OTDS Attribute 19",
|
|
3300
|
+
"_value": "oTMemberOf",
|
|
3301
|
+
},
|
|
3302
|
+
{
|
|
3303
|
+
"_key": "com.opentext.otds.as.drivers.saml.claim20",
|
|
3304
|
+
"_name": "Claim 20",
|
|
3305
|
+
"_value": "",
|
|
3306
|
+
},
|
|
3307
|
+
{
|
|
3308
|
+
"_key": "com.opentext.otds.as.drivers.saml.claimAttribute20",
|
|
3309
|
+
"_name": "OTDS Attribute 20",
|
|
3310
|
+
"_value": "",
|
|
3311
|
+
},
|
|
3073
3312
|
],
|
|
3074
3313
|
}
|
|
3075
3314
|
|
|
3076
3315
|
request_url = self.auth_handler_url()
|
|
3077
3316
|
|
|
3078
|
-
logger.
|
|
3317
|
+
logger.debug(
|
|
3079
3318
|
"Adding SAML auth handler -> %s (%s); calling -> %s",
|
|
3080
3319
|
name,
|
|
3081
3320
|
description,
|
|
@@ -3095,7 +3334,7 @@ class OTDS:
|
|
|
3095
3334
|
return self.parse_request_response(response)
|
|
3096
3335
|
# Check if Session has expired - then re-authenticate and try once more
|
|
3097
3336
|
elif response.status_code == 401 and retries == 0:
|
|
3098
|
-
logger.
|
|
3337
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
3099
3338
|
self.authenticate(revalidate=True)
|
|
3100
3339
|
retries += 1
|
|
3101
3340
|
else:
|
|
@@ -3196,7 +3435,7 @@ class OTDS:
|
|
|
3196
3435
|
# 2. Create the auth handler in OTDS
|
|
3197
3436
|
request_url = self.auth_handler_url()
|
|
3198
3437
|
|
|
3199
|
-
logger.
|
|
3438
|
+
logger.debug(
|
|
3200
3439
|
"Adding SAP auth handler -> %s (%s); calling -> %s",
|
|
3201
3440
|
name,
|
|
3202
3441
|
description,
|
|
@@ -3222,7 +3461,7 @@ class OTDS:
|
|
|
3222
3461
|
# 3. Upload the certificate file:
|
|
3223
3462
|
|
|
3224
3463
|
# Check that the certificate (PSE) file is readable:
|
|
3225
|
-
logger.
|
|
3464
|
+
logger.debug("Reading certificate file -> %s...", certificate_file)
|
|
3226
3465
|
try:
|
|
3227
3466
|
# PSE files are binary - so we need to open with "rb":
|
|
3228
3467
|
with open(certificate_file, "rb") as certFile:
|
|
@@ -3246,21 +3485,21 @@ class OTDS:
|
|
|
3246
3485
|
certContentDecoded = base64.b64decode(certContent, validate=True)
|
|
3247
3486
|
certContentEncoded = base64.b64encode(certContentDecoded).decode("utf-8")
|
|
3248
3487
|
if certContentEncoded == certContent.decode("utf-8"):
|
|
3249
|
-
logger.
|
|
3488
|
+
logger.debug(
|
|
3250
3489
|
"Certificate file -> %s is base64 encoded", certificate_file
|
|
3251
3490
|
)
|
|
3252
3491
|
cert_file_encoded = True
|
|
3253
3492
|
else:
|
|
3254
3493
|
cert_file_encoded = False
|
|
3255
3494
|
except TypeError:
|
|
3256
|
-
logger.
|
|
3495
|
+
logger.debug(
|
|
3257
3496
|
"Certificate file -> %s is not base64 encoded", certificate_file
|
|
3258
3497
|
)
|
|
3259
3498
|
cert_file_encoded = False
|
|
3260
3499
|
|
|
3261
3500
|
if cert_file_encoded:
|
|
3262
3501
|
certificate_file = "/tmp/" + os.path.basename(certificate_file)
|
|
3263
|
-
logger.
|
|
3502
|
+
logger.debug("Writing decoded certificate file -> %s...", certificate_file)
|
|
3264
3503
|
try:
|
|
3265
3504
|
# PSE files need to be binary - so we need to open with "wb":
|
|
3266
3505
|
with open(certificate_file, "wb") as certFile:
|
|
@@ -3289,7 +3528,7 @@ class OTDS:
|
|
|
3289
3528
|
|
|
3290
3529
|
request_url = self.auth_handler_url() + "/" + name + "/files"
|
|
3291
3530
|
|
|
3292
|
-
logger.
|
|
3531
|
+
logger.debug(
|
|
3293
3532
|
"Uploading certificate file -> %s for SAP auth handler -> %s (%s); calling -> %s",
|
|
3294
3533
|
certificate_file,
|
|
3295
3534
|
name,
|
|
@@ -3705,7 +3944,7 @@ class OTDS:
|
|
|
3705
3944
|
|
|
3706
3945
|
request_url = self.auth_handler_url()
|
|
3707
3946
|
|
|
3708
|
-
logger.
|
|
3947
|
+
logger.debug(
|
|
3709
3948
|
"Adding OAuth auth handler -> %s (%s); calling -> %s",
|
|
3710
3949
|
name,
|
|
3711
3950
|
description,
|
|
@@ -3725,7 +3964,7 @@ class OTDS:
|
|
|
3725
3964
|
return self.parse_request_response(response)
|
|
3726
3965
|
# Check if Session has expired - then re-authenticate and try once more
|
|
3727
3966
|
elif response.status_code == 401 and retries == 0:
|
|
3728
|
-
logger.
|
|
3967
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
3729
3968
|
self.authenticate(revalidate=True)
|
|
3730
3969
|
retries += 1
|
|
3731
3970
|
else:
|
|
@@ -3767,7 +4006,7 @@ class OTDS:
|
|
|
3767
4006
|
|
|
3768
4007
|
request_url = "{}".format(self.consolidation_url())
|
|
3769
4008
|
|
|
3770
|
-
logger.
|
|
4009
|
+
logger.debug(
|
|
3771
4010
|
"Consolidation of resource -> %s; calling -> %s", resource_dn, request_url
|
|
3772
4011
|
)
|
|
3773
4012
|
|
|
@@ -3784,7 +4023,7 @@ class OTDS:
|
|
|
3784
4023
|
return True
|
|
3785
4024
|
# Check if Session has expired - then re-authenticate and try once more
|
|
3786
4025
|
elif response.status_code == 401 and retries == 0:
|
|
3787
|
-
logger.
|
|
4026
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
3788
4027
|
self.authenticate(revalidate=True)
|
|
3789
4028
|
retries += 1
|
|
3790
4029
|
else:
|
|
@@ -3825,7 +4064,7 @@ class OTDS:
|
|
|
3825
4064
|
|
|
3826
4065
|
request_url = "{}/{}/impersonation".format(self.resource_url(), resource_name)
|
|
3827
4066
|
|
|
3828
|
-
logger.
|
|
4067
|
+
logger.debug(
|
|
3829
4068
|
"Impersonation settings for resource -> %s; calling -> %s",
|
|
3830
4069
|
resource_name,
|
|
3831
4070
|
request_url,
|
|
@@ -3844,7 +4083,7 @@ class OTDS:
|
|
|
3844
4083
|
return True
|
|
3845
4084
|
# Check if Session has expired - then re-authenticate and try once more
|
|
3846
4085
|
elif response.status_code == 401 and retries == 0:
|
|
3847
|
-
logger.
|
|
4086
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
3848
4087
|
self.authenticate(revalidate=True)
|
|
3849
4088
|
retries += 1
|
|
3850
4089
|
else:
|
|
@@ -3884,7 +4123,7 @@ class OTDS:
|
|
|
3884
4123
|
|
|
3885
4124
|
request_url = "{}/{}/impersonation".format(self.oauth_client_url(), client_id)
|
|
3886
4125
|
|
|
3887
|
-
logger.
|
|
4126
|
+
logger.debug(
|
|
3888
4127
|
"Impersonation settings for OAuth Client -> %s; calling -> %s",
|
|
3889
4128
|
client_id,
|
|
3890
4129
|
request_url,
|
|
@@ -3903,7 +4142,7 @@ class OTDS:
|
|
|
3903
4142
|
return True
|
|
3904
4143
|
# Check if Session has expired - then re-authenticate and try once more
|
|
3905
4144
|
elif response.status_code == 401 and retries == 0:
|
|
3906
|
-
logger.
|
|
4145
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
3907
4146
|
self.authenticate(revalidate=True)
|
|
3908
4147
|
retries += 1
|
|
3909
4148
|
else:
|
|
@@ -3948,7 +4187,7 @@ class OTDS:
|
|
|
3948
4187
|
|
|
3949
4188
|
request_url = "{}/passwordpolicy".format(self.config()["systemConfigUrl"])
|
|
3950
4189
|
|
|
3951
|
-
logger.
|
|
4190
|
+
logger.debug("Getting password policy; calling -> %s", request_url)
|
|
3952
4191
|
|
|
3953
4192
|
retries = 0
|
|
3954
4193
|
while True:
|
|
@@ -3962,7 +4201,7 @@ class OTDS:
|
|
|
3962
4201
|
return self.parse_request_response(response)
|
|
3963
4202
|
# Check if Session has expired - then re-authenticate and try once more
|
|
3964
4203
|
elif response.status_code == 401 and retries == 0:
|
|
3965
|
-
logger.
|
|
4204
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
3966
4205
|
self.authenticate(revalidate=True)
|
|
3967
4206
|
retries += 1
|
|
3968
4207
|
else:
|
|
@@ -4009,7 +4248,7 @@ class OTDS:
|
|
|
4009
4248
|
|
|
4010
4249
|
request_url = "{}/passwordpolicy".format(self.config()["systemConfigUrl"])
|
|
4011
4250
|
|
|
4012
|
-
logger.
|
|
4251
|
+
logger.debug(
|
|
4013
4252
|
"Update password policy with these new values -> %s; calling -> %s",
|
|
4014
4253
|
update_values,
|
|
4015
4254
|
request_url,
|
|
@@ -4028,7 +4267,7 @@ class OTDS:
|
|
|
4028
4267
|
return True
|
|
4029
4268
|
# Check if Session has expired - then re-authenticate and try once more
|
|
4030
4269
|
elif response.status_code == 401 and retries == 0:
|
|
4031
|
-
logger.
|
|
4270
|
+
logger.debug("Session has expired - try to re-authenticate...")
|
|
4032
4271
|
self.authenticate(revalidate=True)
|
|
4033
4272
|
retries += 1
|
|
4034
4273
|
else:
|