demarches-normaliennes/config/initializers/france_connect.rb

21 lines
645 B
Ruby
Raw Normal View History

FRANCE_CONNECT = if !Rails.env.test?
file_path = "#{Rails.root}/config/france_connect.yml"
config_hash = YAML.safe_load(File.read(file_path))
.reduce({}) { |acc, (key, value)| acc[key.gsub('particulier_', '')] = value, acc }
2018-01-11 14:04:24 +01:00
.symbolize_keys
2018-01-11 14:04:24 +01:00
{ particulier: config_hash }
else
2018-01-11 14:04:24 +01:00
{
particulier: {
identifier: 'plop',
secret: 'plip',
redirect_uri: 'https://bidon.com/endpoint',
authorization_endpoint: 'https://bidon.com/endpoint',
token_endpoint: 'https://bidon.com/endpoint',
userinfo_endpoint: 'https://bidon.com/endpoint',
logout_endpoint: 'https://bidon.com/endpoint',
}
2018-01-11 14:04:24 +01:00
}
end