FC: move FC constants under particulier namespace

This commit is contained in:
Simon Lehericey 2018-01-15 12:07:54 +01:00
parent 06d9c4356e
commit 0d46f92795
5 changed files with 24 additions and 21 deletions

View file

@ -1,14 +1,19 @@
FRANCE_CONNECT = if !Rails.env.test?
file_path = "#{Rails.root}/config/france_connect.yml"
Hashie::Mash.load(file_path)
config_hash = YAML.safe_load(File.read(file_path))
.reduce({}) { |acc, (key, value)| acc[key.gsub('particulier_', '')] = value, acc }
Hashie::Mash.new(particulier: config_hash)
else
Hashie::Mash.new({
particulier_identifier: 'plop',
particulier_secret: 'plip',
particulier_redirect_uri: 'https://bidon.com/endpoint',
particulier_authorization_endpoint: 'https://bidon.com/endpoint',
particulier_token_endpoint: 'https://bidon.com/endpoint',
particulier_userinfo_endpoint: 'https://bidon.com/endpoint',
particulier_logout_endpoint: 'https://bidon.com/endpoint',
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',
}
})
end