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

Add meta/health/ldap endpoint #571

Merged
merged 10 commits into from
Jan 22, 2025
Merged

Conversation

pederhan
Copy link
Member

@pederhan pederhan commented Jan 14, 2025

This PR adds an endpoint for checking the status of the application's LDAP connection. It performs the following actions:

  1. Tries to connect to LDAP server and bind using credentials defined in settings.
  2. Responds with either 200 or 503 based on success of bind operation.

The response contains no data, just a status code. LDAP internals are not exposed.

Tasks

  • Add /meta/health/ldap endpoint
  • Move heartbeat endpoint to /meta/health/heartbeat
  • Add tests

@coveralls
Copy link
Collaborator

coveralls commented Jan 14, 2025

Coverage Status

coverage: 99.021% (+0.008%) from 99.013%
when pulling 9ea3c30 on pederhan:ldap-health-endpoint
into b20586d on unioslo:master.

mreg/api/views.py Outdated Show resolved Hide resolved
@pederhan pederhan marked this pull request as ready for review January 22, 2025 10:20
@pederhan pederhan requested a review from terjekv January 22, 2025 10:20
Copy link
Collaborator

@terjekv terjekv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a ChangeLog entry and we need to make it clear that the health endpoints are now public. :)

@terjekv terjekv self-requested a review January 22, 2025 10:33
Copy link
Collaborator

@terjekv terjekv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

418 - I'm a teapot. LGTM.

@pederhan pederhan merged commit 914fe86 into unioslo:master Jan 22, 2025
16 checks passed
@pederhan pederhan deleted the ldap-health-endpoint branch January 22, 2025 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants