refactor: Update wazuh manager functions to remove `/` (#287)
taylor_socfortress committed
Sep 8, 2024 at 17:48 UTC
895091fca3543f207aabd657c23482cdeaa0dbc7
2 files changed
+6
-6
backend/app/connectors/wazuh_manager/utils/universal.py
+5
-5
@@ -151,7 +151,7 @@ async def send_get_request(
151
# if params is {"raw": True} then we want to return the raw response
152
if params == {"raw": True}:
153
response = requests.get(
154
- f"{attributes['connector_url']}/{endpoint}",
154
+ f"{attributes['connector_url']}{endpoint}",
155
headers=wazuh_manager_client,
156
params=params,
157
verify=False,
@@ -163,7 +163,7 @@ async def send_get_request(
163
"message": "Successfully retrieved data",
164
}
165
response = requests.get(
166
- f"{attributes['connector_url']}/{endpoint}",
166
+ f"{attributes['connector_url']}{endpoint}",
167
headers=wazuh_manager_client,
168
params=params,
169
verify=False,
@@ -207,7 +207,7 @@ async def send_post_request(
207
return None
208
try:
209
response = requests.post(
210
- f"{attributes['connector_url']}/{endpoint}",
210
+ f"{attributes['connector_url']}{endpoint}",
211
headers=wazuh_manager_client,
212
json=data,
213
verify=False,
@@ -264,7 +264,7 @@ async def send_put_request(
264
try:
265
logger.debug(f"Sending PUT request to {endpoint} with data: {data}")
266
response = requests.put(
267
- f"{attributes['connector_url']}/{endpoint}",
267
+ f"{attributes['connector_url']}{endpoint}",
268
headers=wazuh_manager_client,
269
params=params,
270
data=data,
@@ -309,7 +309,7 @@ async def send_delete_request(
309
return None
310
try:
311
response = requests.delete(
312
- f"{attributes['connector_url']}/{endpoint}",
312
+ f"{attributes['connector_url']}{endpoint}",
313
headers=wazuh_manager_client,
314
params=params,
315
verify=False,
backend/app/integrations/office365/services/provision.py
+1
-1
@@ -245,7 +245,7 @@ async def update_wazuh_configuration(
245
Args:
246
provision_office365_auth_keys (ProvisionOffice365AuthKeys): The Office365 authentication keys.
247
"""
248
- endpoint = "manager/configuration"
248
+ endpoint = "/manager/configuration"
249
250
# Get the directory of the current module
251
dir_path = os.path.dirname(os.path.realpath(__file__))