Update usage of GET /groups/{group_id}/files/{file_name}/- json/xml #6385
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The following endpoints have been refactored:
Therefore, a revision in the code to properly manage them has been necessary.
The change to the endpoints has been to remove the extension from the path and replace it with a raw variable, making it so that if the variable is set to true, it will return the response structured as an XML; if the parameter is not added, it will return the response as a JSON.
Within the front-end structure, no endpoint needs a JSON structure, so I have added the parameter raw=true as the default. This is reflected in the file
plugins/main/public/controllers/management/components/management/groups/utils/groups-handler.js
, in the function getFileContent.Issues Resolved
Update usage of GET /groups/{group_id}/files/{file_name}/json and GET /groups/{group_id}/files/{file_name}/XML
Evidence
Evidence.mp4
Test
To generate a manager that works correctly, it will be necessary to use the master branch. For this, you can include this code in the dev.yml.
The files located in /wazuh_manager_filebeat_sources_cmake should be replaced with the following ones:
master-manager-enviroment.zip
Check List
yarn test:jest