1 # Copyright (C) The Arvados Authors. All rights reserved.
3 # SPDX-License-Identifier: AGPL-3.0
5 class HealthcheckController < ApplicationController
6 skip_around_filter :thread_clear
7 skip_around_filter :set_thread_api_token
8 skip_around_filter :require_thread_api_token
9 skip_before_filter :ensure_arvados_api_exists
10 skip_before_filter :accept_uuid_as_id_param
11 skip_before_filter :check_user_agreements
12 skip_before_filter :check_user_profile
13 skip_before_filter :load_filters_and_paging_params
14 skip_before_filter :find_object_by_uuid
16 before_filter :check_auth_header
19 mgmt_token = Rails.configuration.management_token
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"}