Skip to content
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

Move API healthcheck endpoint from /health_check to /api/health_check #538

Merged

Conversation

josecelano
Copy link
Member

@josecelano josecelano commented Dec 14, 2023

Relates to: torrust/torrust-compose#2

From: GET /health_check
To: GET /api/health_check

To avoid collission with HTTP Tracker health check enpoint when the API and the HTTP Tracker are using the same domain+port. For example:

Old health check endpoints:

New API health check endpoint:

From: `GET /health_check`
To:   `GET /api/health_check`

To avoid collission with HTTP Tracker health check enpoint when the API
and the HTTP Tracker are using the same domain+port. For example:

- API:          https://tracker.com:443/api/
- HTTP tracker: https://tracker.com:443/

Old health check endpoints:

- API:          https://tracker.com:443/health_check
- HTTP tracker: https://tracker.com:443/health_check

New API health check endpoint:

- API:          https://tracker.com:443/api/health_check
- HTTP tracker: https://tracker.com:443/health_check
@josecelano josecelano force-pushed the issue-537-new-api-health-check-endpoint branch from 5ea4d1e to 985633e Compare December 14, 2023 09:50
@josecelano
Copy link
Member Author

ACK: 985633e

Copy link

codecov bot commented Dec 14, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (e6aecf1) 84.20% compared to head (985633e) 84.20%.

Files Patch % Lines
src/servers/health_check_api/handlers.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #538   +/-   ##
========================================
  Coverage    84.20%   84.20%           
========================================
  Files          110      110           
  Lines         7285     7286    +1     
========================================
+ Hits          6134     6135    +1     
  Misses        1151     1151           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@josecelano josecelano merged commit a3274dc into torrust:develop Dec 14, 2023
14 of 15 checks passed
@da2ce7
Copy link
Contributor

da2ce7 commented Dec 14, 2023

@josecelano

The original plan was to have it under the v1 prefix, but this pull request doesn't include the version. Hmm?

@josecelano
Copy link
Member Author

@josecelano

The original plan was to have it under the v1 prefix, but this pull request doesn't include the version. Hmm?

Hi @da2ce7 I changed my mind. In the end, I did what I mentioned at the end of the issue:

image

#537 (comment)

  • /api/heal_check is a public endpoint.
  • For /api/v1/* you need the token.

That means we are not versioning the health_check endpoint for now because we only use it for container health checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Move API healthcheck endpoint from /health_check to /api/v1/health_check
2 participants