Commit cc02aaaf authored by Fabrice Gangler's avatar Fabrice Gangler 🎨
Browse files

FEAT: allow to use API Entreprise (staging server)

customize API_ENTREPRISE_URL and API_ENTREPRISE_KEY  in DS .env file
parent bff7601b
......@@ -59,6 +59,10 @@ $db_pool = ''
# /!\ Do not forget to change this value in production
$ds_encryption_service_salt = 'aef3153a9829fa4ba10acb02927ac855df6b92795b1ad265d654443c4b14a017'
# Environment variable API_ENTREPRISE_KEY (see: .env file)
# Staging token (see: https://api.gouv.fr/documentation/api-entreprise)
$ds_api_entreprise_key = 'eyJhbGciOiJIUzI1NiJ9.eyJ1aWQiOiI2NjRkZWEyMS02YWFlLTQwZmYtYWM0Mi1kZmQ3ZGE4YjQ3NmUiLCJqdGkiOiJhcGktZW50cmVwcmlzZS1zdGFnaW5nIiwicm9sZXMiOlsiY2VydGlmaWNhdF9jbmV0cCIsInByb2J0cCIsImV0YWJsaXNzZW1lbnRzIiwicHJpdmlsZWdlcyIsInVwdGltZSIsImF0dGVzdGF0aW9uc19hZ2VmaXBoIiwiYWN0ZXNfaW5waSIsImJpbGFuc19pbnBpIiwiYWlkZXNfY292aWRfZWZmZWN0aWZzIiwiY2VydGlmaWNhdF9yZ2VfYWRlbWUiLCJhdHRlc3RhdGlvbnNfc29jaWFsZXMiLCJlbnRyZXByaXNlX2FydGlzYW5hbGUiLCJmbnRwX2NhcnRlX3BybyIsImNvbnZlbnRpb25zX2NvbGxlY3RpdmVzIiwiZXh0cmFpdHNfcmNzIiwiZXh0cmFpdF9jb3VydF9pbnBpIiwiY2VydGlmaWNhdF9hZ2VuY2VfYmlvIiwibXNhX2NvdGlzYXRpb25zIiwiZG9jdW1lbnRzX2Fzc29jaWF0aW9uIiwiZW9yaV9kb3VhbmVzIiwiYXNzb2NpYXRpb25zIiwiYmlsYW5zX2VudHJlcHJpc2VfYmRmIiwiZW50cmVwcmlzZXMiLCJxdWFsaWJhdCIsImNlcnRpZmljYXRfb3BxaWJpIiwiZW50cmVwcmlzZSIsImV0YWJsaXNzZW1lbnQiXSwic3ViIjoic3RhZ2luZyBkZXZlbG9wbWVudCIsImlhdCI6MTY0MTMwNDcxNCwidmVyc2lvbiI6IjEuMCIsImV4cCI6MTY4ODQ3NTUxNH0.xID66pIlMnBR5_6nG-GidFBzK4Tuuy5ZsWfkMEVB_Ek'
# #############################################################################
# System user for Démarches Simplifiées app
accounts::user { $_system_username:
......@@ -151,6 +155,15 @@ file_line { '.env file ENCRYPTION_SERVICE_SALT':
match => '^ENCRYPTION_SERVICE_SALT=""',
require => File["$_ds_project_directory/.env"],
}
file_line { '.env file API_ENTREPRISE_KEY':
# mandatory to use API Entreprise
ensure => present,
path => "$_ds_project_directory/.env",
line => "API_ENTREPRISE_KEY=\"$ds_api_entreprise_key\"",
match => '^API_ENTREPRISE_KEY=""',
require => File["$_ds_project_directory/.env"],
}
# Optional environment variables
file_line { '.env file, optional environment variables':
ensure => present,
......@@ -170,6 +183,14 @@ file_line { '.env file API_PARTICULIER_URL':
line => 'API_PARTICULIER_URL="https://particulier-test.api.gouv.fr/api"',
require => File["$_ds_project_directory/.env"],
}
file_line { '.env file API_ENTREPRISE_URL':
# see: config/initializers/urls.rb file
# https://api.gouv.fr/documentation/api-entreprise
ensure => present,
path => "$_ds_project_directory/.env",
line => 'API_ENTREPRISE_URL="https://staging.entreprise.api.gouv.fr/v2"',
require => File["$_ds_project_directory/.env"],
}
# Modification of bin/setup file.
# As we already created the DB we don't need to recreate it.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment