[ARVADOS] updated: bcde8a61f1cdc87c546241dd133f862850e9f102

git at public.curoverse.com git at public.curoverse.com
Wed Jun 25 07:01:35 EDT 2014


Summary of changes:
 .../app/controllers/application_controller.rb      | 26 ++--------------------
 .../test/integration/anonymous_user_test.rb        |  2 +-
 2 files changed, 3 insertions(+), 25 deletions(-)

       via  bcde8a61f1cdc87c546241dd133f862850e9f102 (commit)
       via  5a78cd03550aafd578b03f7fe8b5c49580b40663 (commit)
      from  fada1a2d5776e9ea5e7555a81bf256185121cef3 (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 bcde8a61f1cdc87c546241dd133f862850e9f102
Author: radhika <radhika at curoverse.com>
Date:   Wed Jun 25 07:00:45 2014 -0400

    2659: bogus anonymous token test was NOT using a bogus token!!

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index b4a3126..6538e83 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -469,6 +469,7 @@ class ApplicationController < ActionController::Base
     end
   end
 
+  # if inactive user, set enable anonymous browsing if applicable
   def permit_anonymous_browsing_for_inactive_user
     anonymous_user_token = Rails.configuration.anonymous_user_token
     if !anonymous_user_token
diff --git a/apps/workbench/test/integration/anonymous_user_test.rb b/apps/workbench/test/integration/anonymous_user_test.rb
index 01cc4de..bd1fa4e 100644
--- a/apps/workbench/test/integration/anonymous_user_test.rb
+++ b/apps/workbench/test/integration/anonymous_user_test.rb
@@ -176,7 +176,7 @@ class AnonymousUserTest < ActionDispatch::IntegrationTest
     ['active', api_fixture('users')['active'], true]
   ].each do |token, user, invited|
     test "visit home page when anonymous login configured with bogus token for user #{token}" do
-      Rails.configuration.anonymous_user_token = false
+      Rails.configuration.anonymous_user_token = 'no-such-token'
 
       if !token
         visit ('/')

commit 5a78cd03550aafd578b03f7fe8b5c49580b40663
Author: radhika <radhika at curoverse.com>
Date:   Wed Jun 25 06:39:48 2014 -0400

    2659: much simpler permit_anonymous_browsing_if_no_thread_token method

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 23f6205..b4a3126 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -464,31 +464,8 @@ class ApplicationController < ActionController::Base
   end
 
   def permit_anonymous_browsing_if_no_thread_token
-    anonymous_user_token = Rails.configuration.anonymous_user_token
-    if !anonymous_user_token
-      Thread.current[:arvados_anonymous_api_token] = nil
-      return
-    end
-
     if !Thread.current[:arvados_api_token] && !params[:api_token] && !session[:arvados_api_token]
-      Thread.current[:arvados_api_token] = anonymous_user_token
-      if verify_api_token 
-        session[:arvados_api_token] = anonymous_user_token
-        u = User.current
-        session[:user] = {
-          uuid: u.uuid,
-          email: u.email,
-          first_name: u.first_name,
-          last_name: u.last_name,
-          is_active: u.is_active,
-          is_admin: u.is_admin,
-          prefs: u.prefs
-        }
-        Thread.current[:arvados_anonymous_api_token] = anonymous_user_token
-      else
-        Thread.current[:arvados_api_token] = nil
-        Thread.current[:arvados_anonymous_api_token] = nil
-      end
+      params[:api_token] = Rails.configuration.anonymous_user_token
     end
   end
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list