[ARVADOS] created: ea3b83da139e08c21e448accc937682a5bf5f88e

git at public.curoverse.com git at public.curoverse.com
Tue Jun 30 11:22:32 EDT 2015


        at  ea3b83da139e08c21e448accc937682a5bf5f88e (commit)


commit ea3b83da139e08c21e448accc937682a5bf5f88e
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Jun 30 11:20:38 2015 -0400

    6377: Fix reversed condition in "site application.yml is optional" fix.

diff --git a/sdk/python/tests/test_arv_put.py b/sdk/python/tests/test_arv_put.py
index d078268..1cc9b95 100644
--- a/sdk/python/tests/test_arv_put.py
+++ b/sdk/python/tests/test_arv_put.py
@@ -400,7 +400,7 @@ class ArvPutIntegrationTest(run_test_server.TestCaseWithServers,
                             ArvadosBaseTestCase):
     def _getKeepServerConfig():
         for config_file, mandatory in [
-                ['application.yml', True], ['application.default.yml', False]]:
+                ['application.yml', False], ['application.default.yml', True]]:
             path = os.path.join(run_test_server.SERVICES_SRC_DIR,
                                 "api", "config", config_file)
             if not mandatory and not os.path.exists(path):

commit ab72d767be973bd8f848be6eccca62299277520a
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Jun 30 11:19:04 2015 -0400

    6377: Use fork of themes_for_rails with fixed gemspec.
    
    Allows installing with current bundler versions, which treat the invalid
    gemspec as an error.

diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index d4f5e6c..e35cc83 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -87,7 +87,7 @@ gem 'piwik_analytics'
 gem 'httpclient', '~> 2.5'
 
 # This fork has Rails 4 compatible routes
-gem 'themes_for_rails', git: 'https://github.com/holtkampw/themes_for_rails', ref: '1fd2d7897d75ae0d6375f4c390df87b8e91ad417'
+gem 'themes_for_rails', git: 'https://github.com/curoverse/themes_for_rails'
 
 gem "deep_merge", :require => 'deep_merge/rails_compat'
 
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index 9fc7550..bc7ddaf 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -1,7 +1,6 @@
 GIT
-  remote: https://github.com/holtkampw/themes_for_rails
-  revision: 1fd2d7897d75ae0d6375f4c390df87b8e91ad417
-  ref: 1fd2d7897d75ae0d6375f4c390df87b8e91ad417
+  remote: https://github.com/curoverse/themes_for_rails
+  revision: 61154877047d2346890bda0b7be5827cf51a6a76
   specs:
     themes_for_rails (0.5.1)
       rails (>= 3.0.0)
@@ -10,29 +9,29 @@ GEM
   remote: https://rubygems.org/
   specs:
     RedCloth (4.2.9)
-    actionmailer (4.1.9)
-      actionpack (= 4.1.9)
-      actionview (= 4.1.9)
+    actionmailer (4.1.12)
+      actionpack (= 4.1.12)
+      actionview (= 4.1.12)
       mail (~> 2.5, >= 2.5.4)
-    actionpack (4.1.9)
-      actionview (= 4.1.9)
-      activesupport (= 4.1.9)
+    actionpack (4.1.12)
+      actionview (= 4.1.12)
+      activesupport (= 4.1.12)
       rack (~> 1.5.2)
       rack-test (~> 0.6.2)
-    actionview (4.1.9)
-      activesupport (= 4.1.9)
+    actionview (4.1.12)
+      activesupport (= 4.1.12)
       builder (~> 3.1)
       erubis (~> 2.7.0)
-    activemodel (4.1.9)
-      activesupport (= 4.1.9)
+    activemodel (4.1.12)
+      activesupport (= 4.1.12)
       builder (~> 3.1)
-    activerecord (4.1.9)
-      activemodel (= 4.1.9)
-      activesupport (= 4.1.9)
+    activerecord (4.1.12)
+      activemodel (= 4.1.12)
+      activesupport (= 4.1.12)
       arel (~> 5.0.0)
     activerecord-nulldb-adapter (0.3.1)
       activerecord (>= 2.0.0)
-    activesupport (4.1.9)
+    activesupport (4.1.12)
       i18n (~> 0.6, >= 0.6.9)
       json (~> 1.7, >= 1.7.7)
       minitest (~> 5.1)
@@ -114,13 +113,12 @@ GEM
       uuidtools (>= 2.1.0)
     headless (1.0.2)
     highline (1.6.21)
-    hike (1.2.3)
     httpclient (2.6.0.1)
     i18n (0.7.0)
     jquery-rails (3.1.2)
       railties (>= 3.0, < 5.0)
       thor (>= 0.14, < 2.0)
-    json (1.8.2)
+    json (1.8.3)
     jwt (0.1.13)
       multi_json (>= 1.5)
     launchy (2.4.3)
@@ -134,14 +132,14 @@ GEM
     mail (2.6.3)
       mime-types (>= 1.16, < 3)
     metaclass (0.0.4)
-    mime-types (2.4.3)
+    mime-types (2.6.1)
     mini_portile (0.6.2)
-    minitest (5.5.1)
+    minitest (5.7.0)
     mocha (1.1.0)
       metaclass (~> 0.0.1)
     morrisjs-rails (0.5.1)
       railties (> 3.1, < 5)
-    multi_json (1.10.1)
+    multi_json (1.11.1)
     multipart-post (1.2.0)
     net-scp (1.2.1)
       net-ssh (>= 2.6.5)
@@ -166,25 +164,25 @@ GEM
       cliver (~> 0.3.1)
       multi_json (~> 1.0)
       websocket-driver (>= 0.2.0)
-    rack (1.5.2)
+    rack (1.5.5)
     rack-mini-profiler (0.9.2)
       rack (>= 1.1.3)
     rack-test (0.6.3)
       rack (>= 1.0)
-    rails (4.1.9)
-      actionmailer (= 4.1.9)
-      actionpack (= 4.1.9)
-      actionview (= 4.1.9)
-      activemodel (= 4.1.9)
-      activerecord (= 4.1.9)
-      activesupport (= 4.1.9)
+    rails (4.1.12)
+      actionmailer (= 4.1.12)
+      actionpack (= 4.1.12)
+      actionview (= 4.1.12)
+      activemodel (= 4.1.12)
+      activerecord (= 4.1.12)
+      activesupport (= 4.1.12)
       bundler (>= 1.3.0, < 2.0)
-      railties (= 4.1.9)
+      railties (= 4.1.12)
       sprockets-rails (~> 2.0)
     rails-perftest (0.0.5)
-    railties (4.1.9)
-      actionpack (= 4.1.9)
-      activesupport (= 4.1.9)
+    railties (4.1.12)
+      actionpack (= 4.1.12)
+      activesupport (= 4.1.12)
       rake (>= 0.8.7)
       thor (>= 0.18.1, < 2.0)
     rake (10.4.2)
@@ -222,12 +220,9 @@ GEM
     simplecov-rcov (0.2.3)
       simplecov (>= 0.4.1)
     slop (3.6.0)
-    sprockets (2.12.3)
-      hike (~> 1.2)
-      multi_json (~> 1.0)
+    sprockets (3.2.0)
       rack (~> 1.0)
-      tilt (~> 1.1, != 1.3.0)
-    sprockets-rails (2.2.2)
+    sprockets-rails (2.3.2)
       actionpack (>= 3.0)
       activesupport (>= 3.0)
       sprockets (>= 2.8, < 4.0)
@@ -236,7 +231,7 @@ GEM
       libv8 (~> 3.16.14.0)
       ref
     thor (0.19.1)
-    thread_safe (0.3.4)
+    thread_safe (0.3.5)
     tilt (1.4.1)
     tzinfo (1.2.2)
       thread_safe (~> 0.1)
@@ -299,3 +294,6 @@ DEPENDENCIES
   therubyracer
   uglifier (>= 1.0.3)
   wiselinks
+
+BUNDLED WITH
+   1.10.5

commit 222c3bb069a9e0247068eed57b7b3b5d88c8c520
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Jun 30 11:07:24 2015 -0400

    6377: Support loading omniauth config from application.yml.

diff --git a/services/api/app/controllers/user_sessions_controller.rb b/services/api/app/controllers/user_sessions_controller.rb
index 256a67b..d8faafc 100644
--- a/services/api/app/controllers/user_sessions_controller.rb
+++ b/services/api/app/controllers/user_sessions_controller.rb
@@ -93,7 +93,7 @@ class UserSessionsController < ApplicationController
 
     flash[:notice] = 'You have logged off'
     return_to = params[:return_to] || root_url
-    redirect_to "#{CUSTOM_PROVIDER_URL}/users/sign_out?redirect_uri=#{CGI.escape return_to}"
+    redirect_to "#{Rails.configuration.sso_provider_url}/users/sign_out?redirect_uri=#{CGI.escape return_to}"
   end
 
   # login - Just bounce to /auth/joshid. The only purpose of this function is
diff --git a/services/api/config/application.default.yml b/services/api/config/application.default.yml
index 9b758e6..409dea6 100644
--- a/services/api/config/application.default.yml
+++ b/services/api/config/application.default.yml
@@ -41,6 +41,9 @@ test:
   active_support.deprecation: :stderr
   active_record.mass_assignment_sanitizer: :strict
   uuid_prefix: zzzzz
+  sso_app_id: arvados-server
+  sso_app_secret: <%= rand(2**512).to_s(36) %>
+  sso_provider_url: http://localhost:3002
   secret_token: <%= rand(2**512).to_s(36) %>
   blob_signing_key: zfhgfenhffzltr9dixws36j1yhksjoll2grmku38mi7yxd66h5j4q9w4jzanezacp8s6q0ro3hxakfye02152hncy6zml2ed0uc
   user_profile_notification_address: arvados at example.com
@@ -291,6 +294,12 @@ common:
   # server is using a self-signed cert.
   sso_insecure: false
 
+  # These settings are provided by your OAuth2 provider (e.g.,
+  # sso-provider).
+  sso_app_id: ~
+  sso_app_secret: ~
+  sso_provider_url: ~
+
   # Default replication level for collections. This is used when a
   # collection's replication_desired attribute is nil.
   default_collection_replication: 2
diff --git a/services/api/config/application.yml.example b/services/api/config/application.yml.example
index c3e599f..ee14c0e 100644
--- a/services/api/config/application.yml.example
+++ b/services/api/config/application.yml.example
@@ -23,6 +23,9 @@ production:
   blob_signing_key: ~
   uuid_prefix: bogus
   workbench_address: https://workbench.bogus.arvadosapi.com
+  sso_app_id: arvados-server
+  sso_app_secret: ~
+  sso_provider_url: https://login.bogus.arvadosapi.com
 
 test:
   # Tests should be able to run without further configuration, but if you do
diff --git a/services/api/config/initializers/load_config.rb b/services/api/config/initializers/load_config.rb
index 3b516da..80ba370 100644
--- a/services/api/config/initializers/load_config.rb
+++ b/services/api/config/initializers/load_config.rb
@@ -6,6 +6,16 @@ rescue LoadError
   # configured by application.yml (i.e., here!) instead.
 end
 
+begin
+  require_relative 'omniauth.rb'
+rescue LoadError
+else
+  # Copy omniauth from globals in legacy config file.
+  Rails.configuration.sso_app_id = APP_ID
+  Rails.configuration.sso_app_secret = APP_SECRET
+  Rails.configuration.sso_provider_url = CUSTOM_PROVIDER_URL
+end
+
 $application_config = {}
 
 %w(application.default application).each do |cfgfile|
diff --git a/services/api/config/initializers/omniauth.rb.example b/services/api/config/initializers/omniauth.rb.example
deleted file mode 100644
index aefcf56..0000000
--- a/services/api/config/initializers/omniauth.rb.example
+++ /dev/null
@@ -1,13 +0,0 @@
-# Change this omniauth configuration to point to your registered provider
-# Since this is a registered application, add the app id and secret here
-APP_ID = 'arvados-server'
-APP_SECRET = rand(2**512).to_s(36) # CHANGE ME!
-
-# Update your custom Omniauth provider URL here
-CUSTOM_PROVIDER_URL = 'http://localhost:3002'
-
-Rails.application.config.middleware.use OmniAuth::Builder do
-  provider :josh_id, APP_ID, APP_SECRET, CUSTOM_PROVIDER_URL
-end
-
-OmniAuth.config.on_failure = StaticController.action(:login_failure)
diff --git a/services/api/config/initializers/omniauth_init.rb b/services/api/config/initializers/omniauth_init.rb
new file mode 100644
index 0000000..af2da15
--- /dev/null
+++ b/services/api/config/initializers/omniauth_init.rb
@@ -0,0 +1,23 @@
+# This file is called omniauth_init.rb instead of omniauth.rb because
+# older versions had site configuration in omniauth.rb.
+
+# Note load_config.rb will also ensure the old site-specific
+# omniauth.rb is loaded, if it exists.
+require_relative 'load_config.rb'
+
+if defined? CUSTOM_PROVIDER_URL
+  Rails.logger.warn <<-EOS
+DEPRECATED CONFIGURATION:
+ Please move your SSO provider config into config/application.yml
+ and delete config/initializers/omniauth.rb.
+EOS
+else
+  Rails.application.config.middleware.use OmniAuth::Builder do
+    provider(:josh_id,
+             Rails.configuration.sso_app_id,
+             Rails.configuration.sso_app_secret,
+             Rails.configuration.sso_provider_url)
+  end
+end
+
+OmniAuth.config.on_failure = StaticController.action(:login_failure)

commit 7759a62cbbf18b8572b4fc3b9887558cd3047db0
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Jun 26 11:19:54 2015 -0400

    Missing application.yml is not an error. No issue #

diff --git a/sdk/python/tests/run_test_server.py b/sdk/python/tests/run_test_server.py
index b25bf62..02f65e6 100644
--- a/sdk/python/tests/run_test_server.py
+++ b/sdk/python/tests/run_test_server.py
@@ -453,10 +453,13 @@ def _getport(program):
 def _apiconfig(key):
     if _cached_config:
         return _cached_config[key]
-    def _load(f):
-        return yaml.load(os.path.join(SERVICES_SRC_DIR, 'api', 'config', f))
+    def _load(f, required=True):
+        fullpath = os.path.join(SERVICES_SRC_DIR, 'api', 'config', f)
+        if not required and not os.path.exists(fullpath):
+            return {}
+        return yaml.load(fullpath)
     cdefault = _load('application.default.yml')
-    csite = _load('application.yml')
+    csite = _load('application.yml', required=False)
     _cached_config = {}
     for section in [cdefault.get('common',{}), cdefault.get('test',{}),
                     csite.get('common',{}), csite.get('test',{})]:

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list