1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class HealthcheckController < ApplicationController
6 skip_around_action :thread_clear
7 skip_around_action :set_thread_api_token
8 skip_around_action :require_thread_api_token
9 skip_before_action :ensure_arvados_api_exists
10 skip_before_action :accept_uuid_as_id_param
11 skip_before_action :check_user_agreements
12 skip_before_action :check_user_profile
13 skip_before_action :load_filters_and_paging_params
14 skip_before_action :find_object_by_uuid
16 before_action :check_auth_header
19 mgmt_token = Rails.configuration.ManagementToken
20 auth_header = request.headers['Authorization']
23 render :json => {:errors => "disabled"}, :status => 404
25 render :json => {:errors => "authorization required"}, :status => 401
26 elsif auth_header != 'Bearer '+mgmt_token
27 render :json => {:errors => "authorization error"}, :status => 403
32 resp = {"health" => "OK"}