aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-03-12 12:01:28 +0100
committerLuc Donnet2018-03-23 17:16:43 +0100
commitf1594a97c37509eb218a0336ae6d0ddaef9ddd71 (patch)
tree9c19f1a4fd49c19cb14922cddb83f75ec0ff36ad
parent908128461e185f7fbf65f2e17ae478b6df123fb8 (diff)
downloadchouette-core-f1594a97c37509eb218a0336ae6d0ddaef9ddd71.tar.bz2
secrets.yml: Add `tomtom_api_key`
Make the TomTom API key accessible to the application. It gets set in Docker via an environment variable. Still need to work out how we're setting it in development. For now I'm just saving it in `secrets.yml` without committing it. Refs #6095
-rw-r--r--config/secrets.yml2
-rw-r--r--config/secrets.yml.docker1
-rw-r--r--lib/tom_tom.rb2
3 files changed, 4 insertions, 1 deletions
diff --git a/config/secrets.yml b/config/secrets.yml
index 0de3fd6ef..963bacd36 100644
--- a/config/secrets.yml
+++ b/config/secrets.yml
@@ -18,6 +18,7 @@ development:
# geoportail_api_key: "aaaaaaaaaaaaaaaaaaaaaa"
newrelic_licence_key: ""
osrm_endpoint: "http://router.project-osrm.org"
+ tomtom_api_key: ""
test:
secret_key_base: 54f61aab23322611dd0bbf73b7f034db34281f7f4b3c4992eaaff20ecc9673bbd467beaa6fcb48379ca69b80bc5662deac4e33ca144f2482146123d3e966016a
@@ -37,3 +38,4 @@ production:
# geoportail_api_key: "aaaaaaaaaaaaaaaaaaaaaa"
newrelic_licence_key: ""
osrm_endpoint: "http://router.project-osrm.org"
+ tomtom_api_key: ""
diff --git a/config/secrets.yml.docker b/config/secrets.yml.docker
index f9bbf5fa0..e35dd3d33 100644
--- a/config/secrets.yml.docker
+++ b/config/secrets.yml.docker
@@ -15,3 +15,4 @@
api_endpoint: <%= ENV.fetch 'IEV_API_ENDPOINT', 'http://iev:8080/chouette_iev/' %>
api_token: <%= ENV.fetch 'IEV_API_TOKEN', 'change this according to IEV configuration' %>
newrelic_licence_key: <%= ENV.fetch 'NR_LICENCE_KEY', 'will_not_work' %>
+ tomtom_api_key: <%= ENV.fetch 'TOMTOM_API_KEY', 'will_not_work' %>
diff --git a/lib/tom_tom.rb b/lib/tom_tom.rb
index 4a6a58df0..58604c347 100644
--- a/lib/tom_tom.rb
+++ b/lib/tom_tom.rb
@@ -1,6 +1,6 @@
class TomTom
BASE_URL = 'https://api.tomtom.com'
- API_KEY = ''
+ API_KEY = Rails.application.secrets.tomtom_api_key
def initialize
@connection = Faraday.new(