Skip to content

feat: add function to health check #257

@RodrigoDornelles

Description

@RodrigoDornelles

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)),
    };
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions