-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace generic HTTP status codes in the API controller #4710
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Code review: ✔️
- Test: ✔️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog entry missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.4-7.16 4.4-7.16
# Navigate to the new working tree
cd .worktrees/backport-4.4-7.16
# Create a new branch
git switch --create backport-4710-to-4.4-7.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9f53850ef89b07824774aedf0e3e6bfeb8a51113
# Push it to GitHub
git push --set-upstream origin backport-4710-to-4.4-7.16
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.4-7.16 Then, create a pull request where the |
* Add http status codes constants * Replace internal server errors for service unavailable * Added changelog and made the error constant an enum * Add HTTP status unit test * Update CHANGELOG.md Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com> (cherry picked from commit 9f53850)
…ontroller (#4722) Replace generic HTTP status codes in the API controller (#4710) * Add http status codes constants * Replace internal server errors for service unavailable * Added changelog and made the error constant an enum * Add HTTP status unit test * Update CHANGELOG.md Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com> (cherry picked from commit 9f53850) Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
* Add http status codes constants * Replace internal server errors for service unavailable * Added changelog and made the error constant an enum * Add HTTP status unit test * Update CHANGELOG.md Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com> (cherry picked from commit 9f53850)
…roller (#4723) Replace generic HTTP status codes in the API controller (#4710) * Add http status codes constants * Replace internal server errors for service unavailable * Added changelog and made the error constant an enum * Add HTTP status unit test * Update CHANGELOG.md Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com> (cherry picked from commit 9f53850) Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
* Add http status codes constants * Replace internal server errors for service unavailable * Added changelog and made the error constant an enum * Add HTTP status unit test * Update CHANGELOG.md Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com> (cherry picked from commit 9f53850)
…azuh-api controller (#4733) * Replace generic HTTP status codes in the API controller (#4710) * Add http status codes constants * Replace internal server errors for service unavailable * Added changelog and made the error constant an enum * Add HTTP status unit test * Update CHANGELOG.md Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com> (cherry picked from commit 9f53850) * Fix typos and errors code status replacement in wazuh-api controller (#4728) * Fix typos and replacement errors * Add changelog (cherry picked from commit f6f437d) Co-authored-by: Federico Rodriguez <federico.rodriguez@wazuh.com>
Description
Hi team, this PR replaces HTTPS status error codes to prevent expected errors to be logged in the server console.
Checking the connection of a downed API should now throw a 503 Service Unavailable.
Issues Resolved
#4650
Test
wazuh.yml
configuration a fake Wazuh API entry to cause a connection exception.Check List
yarn test:jest