Skip to content

Commit

Permalink
Use Google API keys from ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
amree committed Aug 3, 2024
1 parent 04f89e0 commit 98de8b6
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
BUGSNAG_API_KEY=
CLOUDFLARE_TURNSTILE_SITE_KEY=
CLOUDFLARE_TURNSTILE_SECRET_KEY=
CLOUDFLARE_TURNSTILE_SITE_KEY=
DIGITAL_OCEAN_ACCESS_KEY_ID=
DIGITAL_OCEAN_SECRET_ACCESS_KEY=
GOOGLE_API_KEY_API=
GOOGLE_API_KEY_WEB=
GOOGLE_OAUTH_CLIENT_ID=
GOOGLE_OAUTH_CLIENT_SECRET=
MAPBOX_API_KEY=
Expand Down
2 changes: 1 addition & 1 deletion app/services/google_api/google_location_syncer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def call
private

def api_key
Rails.application.credentials.dig(:google_api_key, :api)
ENV.fetch("GOOGLE_API_KEY_API")
end

def validate_params
Expand Down
2 changes: 1 addition & 1 deletion app/services/lat_lng_extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def valid?
end

def google_map_api_key
Rails.application.credentials.dig(:google_api_key, :api)
ENV.fetch("GOOGLE_API_KEY_API")
end

def extract_using_redirection
Expand Down
2 changes: 1 addition & 1 deletion app/services/update_coffee_shop_operation_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def place_id
end

def api_key
Rails.application.credentials.dig(:google_api_key, :api)
ENV.fetch("GOOGLE_API_KEY_API")
end

def service
Expand Down
2 changes: 1 addition & 1 deletion app/use_cases/google_apis/opening_hours/fetch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def call!
private

def api_key
Rails.application.credentials.dig(:google_api_key, :api)
ENV.fetch("GOOGLE_API_KEY_API")
end

def response
Expand Down
2 changes: 1 addition & 1 deletion app/views/coffee_shops/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= content_for(:extra_js) do %>
<%= javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=#{Rails.application.credentials.dig(:google_api_key, :web)}&libraries=places&callback=dispatchMapsFormEvent",
<%= javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=#{ENV.fetch('GOOGLE_API_KEY_WEB')}&libraries=places&callback=dispatchMapsFormEvent",
async: true,
defer: true,
"data-turbolinks-eval": false %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/coffee_shops_v2/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= content_for(:extra_js) do %>
<%= javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=#{Rails.application.credentials.dig(:google_api_key, :web)}&libraries=places&callback=dispatchMapsFormEvent",
<%= javascript_include_tag "https://maps.googleapis.com/maps/api/js?key=#{ENV.fetch('GOOGLE_API_KEY_WEB')}&libraries=places&callback=dispatchMapsFormEvent",
async: true,
defer: true,
"data-turbolinks-eval": false %>
Expand Down
2 changes: 1 addition & 1 deletion config/credentials/production.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
55p2ArB9wGWFIe3O5ZgRIR0ZhTiphiTzkAk8zqDR6D0AtNnGyrP5SPuCq/pPuPne/bi7ZrdV6NkxDr5mGEjuKDm8lr5DXPMBLIRqXWkIwc2KM5xHLAQy2F9vzqDLHBbxn8rXJbfQG3OAaiAQid1fYW2OMhgnUQKHmXli2IvZNdJ4zkF4dHZ4DHFvxAIZY8xpz43IPDpMMYH1HVQ9v9wiGNZ4oBIWiDsVQ49gIVIcG2yZM8rZTl7FrG5G3prTY2In19OJQSajqoLhVZoJAyTt49ZT75KputV/STVaz+JY69LcoJfGTt0C3+15S0rLGS597qVFjXVZRf2DB1DYsKGRyu+x8CyvqDq0JvMC1+Ul5CUtCgNUHr6O842WIAEw71HTszXM7o9D/vf025CYXgZkKZk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