def check_auth_header
mgmt_token = Rails.configuration.management_token
+ auth_header = request.headers['Authorization']
if !mgmt_token
send_error("disabled", status: 404)
- else
- auth_header = request.headers['Authorization']
- if !auth_header
- send_error("authorization required", status: 401)
- elsif auth_header != 'Bearer '+mgmt_token
- send_error("authorization error", status: 403)
- end
+ elsif !auth_header
+ send_error("authorization required", status: 401)
+ elsif auth_header != 'Bearer '+mgmt_token
+ send_error("authorization error", status: 403)
end
end
# Generally, new routes should appear under /arvados/v1/. If
# they appear elsewhere, that might have been caused by default
# rails generator behavior that we don't want.
- assert_match(/^\/(|\*a|arvados\/v1\/.*|auth\/.*|login|logout|database\/reset|discovery\/.*|static\/.*|themes\/.*|assets)(\(\.:format\))?$/,
+ assert_match(/^\/(|\*a|arvados\/v1\/.*|auth\/.*|login|logout|database\/reset|discovery\/.*|static\/.*|themes\/.*|assets|_health\/.*)(\(\.:format\))?$/,
route.path.spec.to_s,
"Unexpected new route: #{route.path.spec}")
end