Use credentials instead of keyfile in GCS sevice

The `keyfile` was renamed to `credentials` in `google-cloud-storage` 1.8.0.
https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/google-cloud-storage/CHANGELOG.md#180--2017-11-14

Although `keyfile` can still be used, but it looks like deprecate.
ddf7b2a856/google-cloud-storage/lib/google/cloud/storage.rb (L589...L590)

Therefore, I think that should use `credentials` in newly generated
applications.

Ref: https://github.com/GoogleCloudPlatform/google-cloud-ruby/issues/1802
This commit is contained in:
yuuji.yaginuma 2017-11-29 13:08:33 +09:00
parent 055493ce05
commit 9d65ac30fd
5 changed files with 23 additions and 21 deletions

@ -92,7 +92,7 @@ end
# Active Storage
group :storage do
gem "aws-sdk-s3", require: false
gem "google-cloud-storage", "~> 1.3", require: false
gem "google-cloud-storage", "~> 1.8", require: false
gem "azure-storage", require: false
gem "mini_magick"

@ -118,8 +118,8 @@ GEM
activerecord-jdbcsqlite3-adapter (1.3.24)
activerecord-jdbc-adapter (~> 1.3.24)
jdbc-sqlite3 (>= 3.7.2, < 3.9)
addressable (2.5.1)
public_suffix (~> 2.0, >= 2.0.2)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
amq-protocol (2.2.0)
archive-zip (0.7.0)
io-like (~> 0.3.0)
@ -209,7 +209,7 @@ GEM
daemons (1.2.4)
dalli (2.7.6)
dante (0.2.0)
declarative (0.0.9)
declarative (0.0.10)
declarative-option (0.1.0)
delayed_job (4.1.3)
activesupport (>= 3.0, < 5.2)
@ -252,25 +252,25 @@ GEM
ffi (1.9.18-x86-mingw32)
globalid (0.4.1)
activesupport (>= 4.2.0)
google-api-client (0.13.1)
google-api-client (0.17.3)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.5)
googleauth (>= 0.5, < 0.7.0)
httpclient (>= 2.8.1, < 3.0)
mime-types (~> 3.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
google-cloud-core (1.0.0)
google-cloud-core (1.1.0)
google-cloud-env (~> 1.0)
googleauth (~> 0.5.1)
google-cloud-env (1.0.1)
faraday (~> 0.11)
google-cloud-storage (1.4.0)
google-cloud-storage (1.9.0)
digest-crc (~> 0.4)
google-api-client (~> 0.13.0)
google-cloud-core (~> 1.0)
googleauth (0.5.3)
google-api-client (~> 0.17.0)
google-cloud-core (~> 1.1)
googleauth (~> 0.6.2)
googleauth (0.6.2)
faraday (~> 0.12)
jwt (~> 1.4)
jwt (>= 1.4, < 3.0)
logging (~> 2.0)
memoist (~> 0.12)
multi_json (~> 1.11)
@ -289,7 +289,7 @@ GEM
jmespath (1.3.1)
json (2.1.0)
json (2.1.0-java)
jwt (1.5.6)
jwt (2.1.0)
kindlerb (1.2.0)
mustache
nokogiri
@ -329,7 +329,7 @@ GEM
msgpack (1.1.0-java)
msgpack (1.1.0-x64-mingw32)
msgpack (1.1.0-x86-mingw32)
multi_json (1.12.1)
multi_json (1.12.2)
multipart-post (2.0.0)
mustache (1.0.5)
mustermann (1.0.0)
@ -354,7 +354,7 @@ GEM
pg (0.19.0-x86-mingw32)
powerpack (0.1.1)
psych (2.2.4)
public_suffix (2.0.5)
public_suffix (3.0.1)
puma (3.9.1)
puma (3.9.1-java)
que (0.14.0)
@ -429,10 +429,10 @@ GEM
rack-protection (>= 1.5.0)
redis (>= 3.3.4, < 5)
sigdump (0.2.4)
signet (0.7.3)
signet (0.8.1)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (~> 1.5)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
sinatra (2.0.0)
mustermann (~> 1.0)
@ -517,7 +517,7 @@ DEPENDENCIES
dalli (>= 2.2.1)
delayed_job
delayed_job_active_record
google-cloud-storage (~> 1.3)
google-cloud-storage (~> 1.8)
hiredis
json (>= 2.0.0)
kindlerb (~> 1.2.0)

@ -1,5 +1,7 @@
# frozen_string_literal: true
gem "google-cloud-storage", "~> 1.8"
require "google/cloud/storage"
require "active_support/core_ext/object/to_query"

@ -7,7 +7,7 @@
#
# gcs:
# service: GCS
# keyfile: {
# credentials: {
# type: "service_account",
# project_id: "",
# private_key_id: "",

@ -18,7 +18,7 @@ local:
# google:
# service: GCS
# project: your_project
# keyfile: <%%= Rails.root.join("path/to/gcs.keyfile") %>
# credentials: <%%= Rails.root.join("path/to/gcs.keyfile") %>
# bucket: your_own_bucket
# Use rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)