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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add function to health check #257

Open
2 tasks done
RodrigoDornelles opened this issue Apr 22, 2024 · 1 comment
Open
2 tasks done

feat: add function to health check #257

RodrigoDornelles opened this issue Apr 22, 2024 · 1 comment

Comments

@RodrigoDornelles
Copy link
Member

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

馃殌 Feature Proposal

enable function that own auth checks if client secrets and ID are correct, in addition to being connected to the openid server, it should false if there is a connection problem.

like this curl

curl -X POST \
  'https://example.com/auth/realms/seu-realm/protocol/openid-connect/token' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'grant_type=client_credentials&client_id=seu-client-id&client_secret=seu-client-secret'

Motivation

an application that is connected to multiple systems, it is interesting to obtain a report of each dependency that is online!

Example

server.get('/health', async function() {
    return {
      keycloak: !await server.keycloak.healthCheck(),
      opensearch: !(await checkError(server.opensearch.ping)),
    };
});
@mcollina
Copy link
Member

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

@Uzlopak Uzlopak changed the title feat: add fucntion to health check feat: add function to health check Apr 22, 2024
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

No branches or pull requests

2 participants