CheckmarxPythonSDK 1.7.7__py3-none-any.whl → 1.7.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.
Files changed (35) hide show
  1. CheckmarxPythonSDK/CxODataApiSDK/Utilities.py +1 -1
  2. CheckmarxPythonSDK/CxODataApiSDK/config.py +7 -2
  3. CheckmarxPythonSDK/CxOne/KeycloakAPI/AttackDetectionApi.py +29 -9
  4. CheckmarxPythonSDK/CxOne/KeycloakAPI/AuthenticationManagementApi.py +334 -102
  5. CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientAttributeCertificateApi.py +70 -15
  6. CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientInitialAccessApi.py +35 -13
  7. CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientRegistrationPolicyApi.py +12 -4
  8. CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientRoleMappingsApi.py +146 -46
  9. CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientRolesApi.py +415 -160
  10. CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientScopesApi.py +99 -35
  11. CheckmarxPythonSDK/CxOne/KeycloakAPI/ClientsApi.py +431 -130
  12. CheckmarxPythonSDK/CxOne/KeycloakAPI/ComponentApi.py +63 -19
  13. CheckmarxPythonSDK/CxOne/KeycloakAPI/GroupsApi.py +179 -53
  14. CheckmarxPythonSDK/CxOne/KeycloakAPI/IdentityProvidersApi.py +133 -40
  15. CheckmarxPythonSDK/CxOne/KeycloakAPI/KeyApi.py +7 -2
  16. CheckmarxPythonSDK/CxOne/KeycloakAPI/ProtocolMappersApi.py +234 -88
  17. CheckmarxPythonSDK/CxOne/KeycloakAPI/RealmsAdminApi.py +365 -230
  18. CheckmarxPythonSDK/CxOne/KeycloakAPI/RoleMapperApi.py +143 -41
  19. CheckmarxPythonSDK/CxOne/KeycloakAPI/RolesApi.py +467 -191
  20. CheckmarxPythonSDK/CxOne/KeycloakAPI/RolesByIdApi.py +137 -43
  21. CheckmarxPythonSDK/CxOne/KeycloakAPI/ScopeMappingsApi.py +580 -258
  22. CheckmarxPythonSDK/CxOne/KeycloakAPI/UsersApi.py +555 -220
  23. CheckmarxPythonSDK/CxOne/KeycloakAPI/dto/__init__.py +91 -0
  24. CheckmarxPythonSDK/CxOne/config.py +9 -2
  25. CheckmarxPythonSDK/CxOne/dto/Project.py +2 -0
  26. CheckmarxPythonSDK/CxRestAPISDK/config.py +7 -2
  27. CheckmarxPythonSDK/__init__.py +3 -17
  28. CheckmarxPythonSDK/__version__.py +1 -1
  29. CheckmarxPythonSDK/configuration.py +1 -1
  30. CheckmarxPythonSDK/logger_setup.py +64 -0
  31. {checkmarxpythonsdk-1.7.7.dist-info → checkmarxpythonsdk-1.7.9.dist-info}/METADATA +1 -1
  32. {checkmarxpythonsdk-1.7.7.dist-info → checkmarxpythonsdk-1.7.9.dist-info}/RECORD +35 -34
  33. {checkmarxpythonsdk-1.7.7.dist-info → checkmarxpythonsdk-1.7.9.dist-info}/WHEEL +1 -1
  34. {checkmarxpythonsdk-1.7.7.dist-info → checkmarxpythonsdk-1.7.9.dist-info}/licenses/LICENSE +0 -0
  35. {checkmarxpythonsdk-1.7.7.dist-info → checkmarxpythonsdk-1.7.9.dist-info}/top_level.txt +0 -0
@@ -206,7 +206,7 @@ def get_result(project, filter_false_positive=False, threshold=0):
206
206
  "ScanId": last_scan_id,
207
207
  "DirectLink": f"{ResultsODataAPI().api_client.configuration.server_base_url}/cxwebclient"
208
208
  f"/ViewerMain.aspx?scanid={last_scan_id}&projectid={project_id}"
209
- f"&pathid={result.get("PathId")}"
209
+ f"&pathid={result.get('PathId')}"
210
210
  }
211
211
  )
212
212
 
@@ -1,5 +1,6 @@
1
1
  from CheckmarxPythonSDK.configuration import Configuration
2
2
  from CheckmarxPythonSDK.utilities.configUtility import get_config
3
+ from CheckmarxPythonSDK.logger_setup import set_module_logger_level
3
4
 
4
5
 
5
6
  def construct_configuration() -> Configuration:
@@ -20,13 +21,14 @@ def construct_configuration() -> Configuration:
20
21
  "verify": True,
21
22
  "cert": None,
22
23
  "proxy": None,
24
+ "logging_level": "ERROR",
23
25
  }
24
26
  old_config = get_config(config_default=config_default, section="checkmarx", prefix="cxsast_")
25
27
  new_config = get_config(config_default=config_default, section="CxSAST", prefix="cxsast_")
26
28
  config = old_config
27
29
  if new_config.get("base_url"):
28
30
  config = new_config
29
- return Configuration(
31
+ configuration = Configuration(
30
32
  server_base_url=config.get("base_url"),
31
33
  token_url=f"{config.get('base_url')}/cxrestapi/auth/identity/connect/token",
32
34
  username=config.get("username"),
@@ -41,5 +43,8 @@ def construct_configuration() -> Configuration:
41
43
  proxies={
42
44
  "http": config.get("proxy"),
43
45
  "https": config.get("proxy"),
44
- }
46
+ },
47
+ logging_level=config.get("logging_level"),
45
48
  )
49
+ set_module_logger_level("CxODataApiSDK", configuration.logging_level)
50
+ return configuration
@@ -11,7 +11,10 @@ class AttackDetectionApi:
11
11
  api_client = ApiClient(configuration=configuration)
12
12
  self.api_client = api_client
13
13
 
14
- def delete_users(self, realm: str) -> bool:
14
+ def delete_users(
15
+ self,
16
+ realm: str
17
+ ) -> bool:
15
18
  """
16
19
  Clear any user login failures for all users This can release temporary disabled users
17
20
 
@@ -24,11 +27,18 @@ class AttackDetectionApi:
24
27
  URL:
25
28
  Relative path: /{realm}/attack-detection/brute-force/users
26
29
  """
27
- relative_url = f"{api_url}/{realm}/attack_detection/brute_force/users"
28
- response = self.api_client.delete_request(relative_url=relative_url, is_iam=True)
30
+ relative_url = f"{api_url}/{realm}/attack-detection/brute-force/users"
31
+ response = self.api_client.delete_request(
32
+ relative_url=relative_url,
33
+ is_iam=True
34
+ )
29
35
  return response.status_code == 204
30
36
 
31
- def get_brute_force_user(self, realm: str, user_id: str) -> Dict[str, Any]:
37
+ def get_brute_force_user(
38
+ self,
39
+ realm: str,
40
+ user_id: str
41
+ ) -> Dict[str, Any]:
32
42
  """
33
43
  Get status of a username in brute force detection
34
44
 
@@ -42,11 +52,18 @@ class AttackDetectionApi:
42
52
  URL:
43
53
  Relative path: /{realm}/attack-detection/brute-force/users/{userId}
44
54
  """
45
- relative_url = f"{api_url}/{realm}/attack_detection/brute_force/users/{user_id}"
46
- response = self.api_client.get_request(relative_url=relative_url, is_iam=True)
55
+ relative_url = f"{api_url}/{realm}/attack-detection/brute-force/users/{user_id}"
56
+ response = self.api_client.get_request(
57
+ relative_url=relative_url,
58
+ is_iam=True
59
+ )
47
60
  return response.json()
48
61
 
49
- def delete_brute_force_user(self, realm: str, user_id: str) -> bool:
62
+ def delete_brute_force_user(
63
+ self,
64
+ realm: str,
65
+ user_id: str
66
+ ) -> bool:
50
67
  """
51
68
  Clear any user login failures for the user This can release temporary disabled user
52
69
 
@@ -60,6 +77,9 @@ class AttackDetectionApi:
60
77
  URL:
61
78
  Relative path: /{realm}/attack-detection/brute-force/users/{userId}
62
79
  """
63
- relative_url = f"{api_url}/{realm}/attack_detection/brute_force/users/{user_id}"
64
- response = self.api_client.delete_request(relative_url=relative_url, is_iam=True)
80
+ relative_url = f"{api_url}/{realm}/attack-detection/brute-force/users/{user_id}"
81
+ response = self.api_client.delete_request(
82
+ relative_url=relative_url,
83
+ is_iam=True
84
+ )
65
85
  return response.status_code == 204