Allow accessing health check token from the API

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Hello,

Context

I am trying to programmatically access the health check token. Unfortunately, there's no obvious way to access it over the GitLab API even with the administrative token.

Proposal

With this issue I would like to consider you adding this option into the GitLab API. Based on my opinion the most appropriate place for this option would be Application settings API namespace.

Impact

With this option in place customers will be able to improve their monitoring automation processes.

Workaround

  • There's an option to parse the /admin/health_check plain HTML output.
  • Retrieve Gitlab::CurrentSettings.health_check_access_token from the gitlab-rails console output (which cannot be accessed over the API).

Additional context

I assume, this health check token isn't considered as a sensitive material, and on the other hand it shouldn't be visible to everyone. It's available as a non-encrypted property in the application_setting model, and requires authentication to access it.

https://gitlab.com/gitlab-org/gitlab/-/blob/17-4-stable-ee/app/models/application_setting.rb?ref_type=heads#L55

Edited by 🤖 GitLab Bot 🤖