[ARVADOS] updated: b9411e85079a76573f722febfdd5ab5e4c85c9f7

Git user git at public.curoverse.com
Tue Jul 18 13:49:20 EDT 2017


Summary of changes:
 .../api/app/controllers/arvados/v1/healthcheck_controller.rb | 12 +++++-------
 services/api/test/integration/errors_test.rb                 |  2 +-
 2 files changed, 6 insertions(+), 8 deletions(-)

       via  b9411e85079a76573f722febfdd5ab5e4c85c9f7 (commit)
      from  943b3e807126ba5dc936ceeeddbee9801dab7308 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit b9411e85079a76573f722febfdd5ab5e4c85c9f7
Author: radhika <radhika at curoverse.com>
Date:   Tue Jul 18 13:30:53 2017 -0400

    11906: add _health/.* to errors_test routes
    
    Arvados-DCO-1.1-Signed-off-by: Radhika Chippada <radhika at curoverse.com>

diff --git a/services/api/app/controllers/arvados/v1/healthcheck_controller.rb b/services/api/app/controllers/arvados/v1/healthcheck_controller.rb
index 41f7175..47b49ff 100644
--- a/services/api/app/controllers/arvados/v1/healthcheck_controller.rb
+++ b/services/api/app/controllers/arvados/v1/healthcheck_controller.rb
@@ -17,16 +17,14 @@ class Arvados::V1::HealthcheckController < ApplicationController
 
   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
 
diff --git a/services/api/test/integration/errors_test.rb b/services/api/test/integration/errors_test.rb
index 2ef85bc..1424558 100644
--- a/services/api/test/integration/errors_test.rb
+++ b/services/api/test/integration/errors_test.rb
@@ -23,7 +23,7 @@ class ErrorsTest < ActionDispatch::IntegrationTest
       # 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

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list