Use a constant for the API Entreprise URL
This commit is contained in:
parent
625f3696f1
commit
9284afc649
3 changed files with 3 additions and 7 deletions
|
@ -45,7 +45,7 @@ class ApiEntreprise::API
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.url(resource_name, siret_or_siren)
|
def self.url(resource_name, siret_or_siren)
|
||||||
[base_url, resource_name, siret_or_siren].join("/")
|
[API_ENTREPRISE_URL, resource_name, siret_or_siren].join("/")
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.params(siret_or_siren, procedure_id)
|
def self.params(siret_or_siren, procedure_id)
|
||||||
|
@ -62,8 +62,4 @@ class ApiEntreprise::API
|
||||||
def self.token
|
def self.token
|
||||||
Rails.application.secrets.api_entreprise[:key]
|
Rails.application.secrets.api_entreprise[:key]
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.base_url
|
|
||||||
Rails.application.secrets.api_entreprise[:base_url]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
API_CARTO_URL = "https://apicarto.sgmap.fr"
|
API_CARTO_URL = "https://apicarto.sgmap.fr"
|
||||||
|
|
||||||
|
API_ENTREPRISE_URL = "https://entreprise.api.gouv.fr/v2"
|
||||||
|
|
||||||
API_GEO_URL = "https://geo.api.gouv.fr"
|
API_GEO_URL = "https://geo.api.gouv.fr"
|
||||||
|
|
||||||
PIPEDRIVE_API_URL = 'https://api.pipedrive.com/v1'
|
PIPEDRIVE_API_URL = 'https://api.pipedrive.com/v1'
|
||||||
|
|
|
@ -31,7 +31,6 @@ defaults: &defaults
|
||||||
secret_key: <%= ENV['MAILJET_SECRET_KEY'] %>
|
secret_key: <%= ENV['MAILJET_SECRET_KEY'] %>
|
||||||
api_entreprise:
|
api_entreprise:
|
||||||
key: <%= ENV['API_ENTREPRISE_KEY'] %>
|
key: <%= ENV['API_ENTREPRISE_KEY'] %>
|
||||||
base_url: <%= ENV['API_ENTREPRISE_BASE_URL'] %>
|
|
||||||
pipedrive:
|
pipedrive:
|
||||||
key: <%= ENV['PIPEDRIVE_KEY'] %>
|
key: <%= ENV['PIPEDRIVE_KEY'] %>
|
||||||
fog:
|
fog:
|
||||||
|
@ -57,7 +56,6 @@ test:
|
||||||
signing_key: aef3153a9829fa4ba10acb02927ac855df6b92795b1ad265d654443c4b14a017
|
signing_key: aef3153a9829fa4ba10acb02927ac855df6b92795b1ad265d654443c4b14a017
|
||||||
api_entreprise:
|
api_entreprise:
|
||||||
key: api_entreprise_test_key
|
key: api_entreprise_test_key
|
||||||
base_url: https://entreprise.api.gouv.fr/v2
|
|
||||||
fog:
|
fog:
|
||||||
base_url: https://storage.apientreprise.fr
|
base_url: https://storage.apientreprise.fr
|
||||||
directory: tps_dev
|
directory: tps_dev
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue