[ARVADOS] updated: 1.3.0-1537-g068e72307
Git user
git at public.curoverse.com
Thu Sep 5 17:16:53 UTC 2019
Summary of changes:
services/api/app/controllers/user_sessions_controller.rb | 12 +++++-------
services/api/app/models/api_client_authorization.rb | 8 ++++----
2 files changed, 9 insertions(+), 11 deletions(-)
via 068e72307f9ce91538e45cb461b99cf92d2f5666 (commit)
from fb5b1feb7acdfafed1bcbe932ff90e95e129c2a3 (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 068e72307f9ce91538e45cb461b99cf92d2f5666
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Thu Sep 5 13:16:26 2019 -0400
15529: LoginCluster uses ApiClientAuthorization.remote_host
Fix misspellings.
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/services/api/app/controllers/user_sessions_controller.rb b/services/api/app/controllers/user_sessions_controller.rb
index f3591345d..49af41431 100644
--- a/services/api/app/controllers/user_sessions_controller.rb
+++ b/services/api/app/controllers/user_sessions_controller.rb
@@ -157,18 +157,16 @@ class UserSessionsController < ApplicationController
p << "auth_provider=#{CGI.escape(params[:auth_provider])}" if params[:auth_provider]
if !Rails.configuration.Login.LoginCluster.empty? and Rails.configuration.Login.LoginCluster != Rails.configuration.ClusterID
- cluster = Rails.configuration.RemoteClusters[Rails.configuration.Login.LoginCluster]
- if not cluster
+ host = ApiClientAuthorization.remote_host(uuid_prefix: Rails.configuration.Login.LoginCluster)
+ if not host
raise "LoginCluster #{Rails.configuration.Login.LoginCluster} missing from RemoteClusters"
end
scheme = "https"
- if cluster['Scheme'] and !cluster['Scheme'].empty?
+ cluster = Rails.configuration.RemoteClusters[Rails.configuration.Login.LoginCluster]
+ if cluster and cluster['Scheme'] and !cluster['Scheme'].empty?
scheme = cluster['Scheme']
end
- if !cluster['Host'] or cluster['Host'].empty?
- raise "LoginCluster #{Rails.configuration.Login.LoginCluster} missing 'Host' in RemoteClusters"
- end
- login_cluster = "#{scheme}://#{cluster['Host']}"
+ login_cluster = "#{scheme}://#{host}"
p << "remote=#{CGI.escape(params[:remote])}" if params[:remote]
p << "return_to=#{CGI.escape(params[:return_to])}" if params[:return_to]
redirect_to "#{login_cluster}/login?#{p.join('&')}"
diff --git a/services/api/app/models/api_client_authorization.rb b/services/api/app/models/api_client_authorization.rb
index 606c3e06f..55db16a4b 100644
--- a/services/api/app/models/api_client_authorization.rb
+++ b/services/api/app/models/api_client_authorization.rb
@@ -87,8 +87,8 @@ class ApiClientAuthorization < ArvadosModel
end
def self.remote_host(uuid_prefix:)
- (Rails.configuration.RemoteClusters[uuid_prefix].andand.Host) ||
- (Rails.configuration.RemoteClusters["*"].Proxy &&
+ (Rails.configuration.RemoteClusters[uuid_prefix].andand["Host"]) ||
+ (Rails.configuration.RemoteClusters["*"]["Proxy"] &&
uuid_prefix+".arvadosapi.com")
end
@@ -160,7 +160,7 @@ class ApiClientAuthorization < ArvadosModel
return nil
end
- # Invarient: token_uuid_prefix != Rails.configuration.ClusterID
+ # Invariant: token_uuid_prefix != Rails.configuration.ClusterID
#
# In other words the remaing code in this method below is the
# case that determines whether to accept a token that was issued
@@ -199,7 +199,7 @@ class ApiClientAuthorization < ArvadosModel
return nil
end
- # Invarient: remote_user_prefix == token_uuid_prefix
+ # Invariant: remote_user_prefix == token_uuid_prefix
# therefore: remote_user_prefix != Rails.configuration.ClusterID
# Add or update user and token in local database so we can
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list