[ARVADOS] updated: bf13df5af0c451ef1d3fe38138851ac023d6c910

git at public.curoverse.com git at public.curoverse.com
Tue Jun 17 23:00:06 EDT 2014


Summary of changes:
 .../app/controllers/application_controller.rb      | 15 +++++----
 .../app/views/application/_job_progress.html.erb   | 37 ++++++++++++++++++----
 .../app/views/layouts/application.html.erb         |  6 ++--
 apps/workbench/config/application.default.yml      |  2 ++
 sdk/cli/bin/arv                                    |  3 ++
 sdk/cli/bin/arv-ws                                 |  1 +
 sdk/cli/bin/crunch-job                             |  2 +-
 sdk/cli/test/test_arv-ws.rb                        | 21 ++++++++++++
 sdk/python/arvados/events.py                       | 23 +++++++++++---
 sdk/python/bin/arv-ws                              | 30 ++++++++++++++++++
 sdk/python/setup.py                                |  1 +
 services/api/test/fixtures/users.yml               |  2 +-
 12 files changed, 121 insertions(+), 22 deletions(-)
 create mode 120000 sdk/cli/bin/arv-ws
 create mode 100644 sdk/cli/test/test_arv-ws.rb
 create mode 100755 sdk/python/bin/arv-ws

       via  bf13df5af0c451ef1d3fe38138851ac023d6c910 (commit)
       via  cab79c6e20f787f0fc20d6cbdef409972e2562c0 (commit)
       via  586c0409bf9496bae169c2d51b04806b82c342a9 (commit)
       via  c23ee1444f21e6a5f2af9f058b610cfa301059cf (commit)
       via  c6ecb94b3d88dc6c5c28c45e9d602a2abd7f07db (commit)
       via  7e88a950d4fdbc2790e6164aa7d947b491419f21 (commit)
       via  ee69f7031612132f0b27fb9b05d24bc1201ead69 (commit)
       via  5185d344b45f34ced54cb15310acdb5a92103a74 (commit)
       via  4f8f78732e08abb8b83166fd7ffbf207e9466264 (commit)
       via  7c098f97052780882fe4c08f48f83b47a1973d36 (commit)
       via  8b7cac2607bda6ace3444ff20917c6262395bd7a (commit)
       via  4b8a53c9cfc81a942f985f1799dbc6e27deb3bc2 (commit)
       via  91cea2d82e477833d322b7267988c490ed284b62 (commit)
       via  5030cca0ec767bf6e1ba630f91938130731ed6cc (commit)
       via  1a3ec903e591304b72bd0d394219729ac76bfed0 (commit)
      from  82b0423895892677ce49c4b0f731618458195596 (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 bf13df5af0c451ef1d3fe38138851ac023d6c910
Author: radhika <radhika at curoverse.com>
Date:   Tue Jun 17 22:51:08 2014 -0400

    2659: pipeline instance test when using anonymous user is now working.

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index e47526c..e3983ec 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -10,7 +10,7 @@ class ApplicationController < ActionController::Base
   around_filter :thread_clear
   around_filter :thread_with_mandatory_api_token, except: ERROR_ACTIONS
   around_filter :thread_with_optional_api_token
-  before_filter :check_user_agreements, except: ERROR_ACTIONS
+#  before_filter :check_user_agreements, except: ERROR_ACTIONS
   before_filter :check_user_notifications, except: ERROR_ACTIONS
   before_filter :find_object_by_uuid, except: [:index] + ERROR_ACTIONS
   theme :select_theme
@@ -354,18 +354,22 @@ class ApplicationController < ActionController::Base
     begin
       try_redirect_to_login = true
 
+      anonymous_user_token = Rails.configuration.anonymous_user_token
       using_anonymous_user_token = false
       if !params[:api_token] && !session[:arvados_api_token] &&
           !Thread.current[:anonymous_api_token]
         if session['arv-referrer'] == 'logout'
           # do not use anonymous user token and let logout happen
         else
-          anonymous_user_token = Rails.configuration.anonymous_user_token
           if anonymous_user_token
             params[:api_token] = anonymous_user_token
             using_anonymous_user_token = true
           end
         end
+      else
+        if params[:api_token] && (params[:api_token] == anonymous_user_token)
+          using_anonymous_user_token = true
+        end
       end
 
       if params[:api_token]
@@ -374,7 +378,7 @@ class ApplicationController < ActionController::Base
         # Before copying the token into session[], do a simple API
         # call to verify its authenticity.
         if verify_api_token
-         if !anonymous_user_token
+         if !using_anonymous_user_token
           session[:arvados_api_token] = params[:api_token]
           u = User.current
           session[:user] = {
@@ -398,6 +402,8 @@ class ApplicationController < ActionController::Base
          else     # using anonymous token
             Thread.current[:user] = User.current
             Thread.current[:anonymous_api_token] = params[:api_token]
+            session[:arvados_api_token] = nil
+            session[:user] = nil
             redirect_to request.fullpath.sub(%r{([&\?]api_token=)[^&\?]*}, '')
          end
         else
@@ -491,8 +497,6 @@ class ApplicationController < ActionController::Base
 
   def check_user_agreements
     if current_user && !current_user.is_active
-=begin
-      return render '/'
       if not current_user.is_invited
         return render 'users/inactive'
       end
@@ -514,7 +518,6 @@ class ApplicationController < ActionController::Base
       if !current_user.is_active
         render 'user_agreements/index'
       end
-=end
     end
     true
   end
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index a2acfb5..cc3c6a2 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -77,7 +77,7 @@
           -->
 
           <% if current_user %>
-          <% if current_user.is_active %>
+          <% if current_user && !current_user.is_anonymous %>
           <li class="dropdown notification-menu">
             <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="notifications-menu">
               <span class="badge badge-alert notification-count"><%= @notification_count %></span>
@@ -100,7 +100,7 @@
               <% end %>
             </ul>
           </li>
-          <% elsif current_user.is_anonymous %>    <%# current user is anonymous %>
+          <% else %>
             <li><a href="<%= arvados_api_client.arvados_login_url(return_to: root_url) %>">Log in</a></li>
           <% end %>
           <% end %>
@@ -165,7 +165,7 @@
       </div><!-- /.navbar-collapse -->
     </nav>
 
-    <% if current_user.andand.is_active %>
+    <% if current_user %>
       <nav class="navbar navbar-default breadcrumbs" role="navigation">
         <ul class="nav navbar-nav navbar-left">
           <li class="dropdown">
diff --git a/apps/workbench/config/application.default.yml b/apps/workbench/config/application.default.yml
index 7c5fbdc..6711d52 100644
--- a/apps/workbench/config/application.default.yml
+++ b/apps/workbench/config/application.default.yml
@@ -58,6 +58,8 @@ test:
 
   site_name: Workbench:test
 
+  anonymous_user_token: 4kg6k6lzmp9kj4cpkcoxie964cmvjahbt4fod9zru44k4jqdmi
+
 common:
   assets.js_compressor: false
   assets.css_compressor: false
diff --git a/services/api/test/fixtures/users.yml b/services/api/test/fixtures/users.yml
index 55ccef5..ac76d5f 100644
--- a/services/api/test/fixtures/users.yml
+++ b/services/api/test/fixtures/users.yml
@@ -85,6 +85,6 @@ anonymous:
   email: anonymouspublic
   first_name: anonymouspublic
   last_name: anonymouspublic
-  is_active: true
+  is_active: false
   is_admin: false
   prefs: {}

commit cab79c6e20f787f0fc20d6cbdef409972e2562c0
Merge: 82b0423 586c040
Author: radhika <radhika at curoverse.com>
Date:   Tue Jun 17 19:33:05 2014 -0400

    Merge branch 'master' into 2659-anonymous-group


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


hooks/post-receive
-- 




More information about the arvados-commits mailing list