FIX: support comma in 'sso_provider_secrets' site setting

This commit is contained in:
Régis Hanol 2018-10-24 21:23:18 +02:00
parent 05438d99a8
commit addf6f6d17
2 changed files with 7 additions and 2 deletions

View File

@ -89,7 +89,7 @@ class SingleSignOn
end
def self.provider_secret(return_sso_url)
provider_secrets = SiteSetting.sso_provider_secrets.split(/[\|,\n]/)
provider_secrets = SiteSetting.sso_provider_secrets.split(/[|\n]/)
provider_secrets_hash = Hash[*provider_secrets]
return_url_host = URI.parse(return_sso_url).host
# moves wildcard domains to the end of hash

View File

@ -589,7 +589,12 @@ RSpec.describe SessionController do
SiteSetting.enable_sso_provider = true
SiteSetting.enable_sso = false
SiteSetting.enable_local_logins = true
SiteSetting.sso_provider_secrets = "*|secretforAll\n*.rainbow|wrongSecretForOverRainbow\nwww.random.site|secretForRandomSite\nsomewhere.over.rainbow|secretForOverRainbow"
SiteSetting.sso_provider_secrets = [
"*|secret,forAll",
"*.rainbow|wrongSecretForOverRainbow",
"www.random.site|secretForRandomSite",
"somewhere.over.rainbow|secretForOverRainbow",
].join("\n")
@sso = SingleSignOn.new
@sso.nonce = "mynonce"