|
|
@ -39,8 +39,8 @@ module OmniAuth |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def self.load_generic_providers |
|
|
|
def self.load_generic_providers |
|
|
|
providers = Hash(OpenProject::Configuration["openid_connect"]).reject do |key, value| |
|
|
|
providers = configs.reject do |pro, config| |
|
|
|
all.any? { |p| p.provider_name == key } |
|
|
|
all.any? { |p| p.provider_name == pro } |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
providers.each do |name, config| |
|
|
|
providers.each do |name, config| |
|
|
@ -83,17 +83,17 @@ module OmniAuth |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def self.config |
|
|
|
def self.config |
|
|
|
|
|
|
|
Hash(configs[provider_name]) |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def self.configs |
|
|
|
from_settings = if Setting.plugin_openproject_openid_connect.is_a? Hash |
|
|
|
from_settings = if Setting.plugin_openproject_openid_connect.is_a? Hash |
|
|
|
Hash(Hash(Setting.plugin_openproject_openid_connect["providers"])[provider_name]) |
|
|
|
Hash(Setting.plugin_openproject_openid_connect["providers"]) |
|
|
|
else |
|
|
|
else |
|
|
|
{} |
|
|
|
{} |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
# Settings override configuration.yml |
|
|
|
if from_settings.empty? |
|
|
|
Hash(OpenProject::Configuration["openid_connect"]).merge(from_settings) |
|
|
|
Hash(Hash(OpenProject::Configuration["openid_connect"])[provider_name]) |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
from_settings |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def to_hash |
|
|
|
def to_hash |
|
|
|