projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
17706: Merge branch 'master' into 17706-costanalyzer-uncommitted-container-requests
[arvados.git]
/
services
/
api
/
test
/
unit
/
api_client_test.rb
diff --git
a/services/api/test/unit/api_client_test.rb
b/services/api/test/unit/api_client_test.rb
index 93e4c51abf0e9266a1883ab18bf5634ea45722b0..a0eacfd13bb65ad2f6ff4f77cfa59d0b8fafd402 100644
(file)
--- a/
services/api/test/unit/api_client_test.rb
+++ b/
services/api/test/unit/api_client_test.rb
@@
-10,8
+10,11
@@
class ApiClientTest < ActiveSupport::TestCase
[true, false].each do |token_lifetime_enabled|
test "configured workbench is trusted when token lifetime is#{token_lifetime_enabled ? '': ' not'} enabled" do
Rails.configuration.Login.TokenLifetime = token_lifetime_enabled ? 8.hours : 0
[true, false].each do |token_lifetime_enabled|
test "configured workbench is trusted when token lifetime is#{token_lifetime_enabled ? '': ' not'} enabled" do
Rails.configuration.Login.TokenLifetime = token_lifetime_enabled ? 8.hours : 0
+ Rails.configuration.Login.IssueTrustedTokens = !token_lifetime_enabled;
Rails.configuration.Services.Workbench1.ExternalURL = URI("http://wb1.example.com")
Rails.configuration.Services.Workbench2.ExternalURL = URI("https://wb2.example.com:443")
Rails.configuration.Services.Workbench1.ExternalURL = URI("http://wb1.example.com")
Rails.configuration.Services.Workbench2.ExternalURL = URI("https://wb2.example.com:443")
+ Rails.configuration.Login.TrustedClients = ActiveSupport::OrderedOptions.new
+ Rails.configuration.Login.TrustedClients[:"https://wb3.example.com"] = ActiveSupport::OrderedOptions.new
act_as_system_user do
[["http://wb0.example.com", false],
act_as_system_user do
[["http://wb0.example.com", false],
@@
-19,6
+22,8
@@
class ApiClientTest < ActiveSupport::TestCase
["http://wb2.example.com", false],
["https://wb2.example.com", true],
["https://wb2.example.com/", true],
["http://wb2.example.com", false],
["https://wb2.example.com", true],
["https://wb2.example.com/", true],
+ ["https://wb3.example.com/", true],
+ ["https://wb4.example.com/", false],
].each do |pfx, result|
a = ApiClient.create(url_prefix: pfx, is_trusted: false)
if token_lifetime_enabled
].each do |pfx, result|
a = ApiClient.create(url_prefix: pfx, is_trusted: false)
if token_lifetime_enabled