aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-11-29 13:08:33 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2017-11-29 13:17:04 +0900
commit9d65ac30fde3977d4773ff6052f31b99a5084f0f (patch)
treee08b107308b56d6a463ab380c064d9967707e583
parent055493ce056a663a7b61ae4f88f657d1a355995d (diff)
downloadrails-9d65ac30fde3977d4773ff6052f31b99a5084f0f.tar.gz
rails-9d65ac30fde3977d4773ff6052f31b99a5084f0f.tar.bz2
rails-9d65ac30fde3977d4773ff6052f31b99a5084f0f.zip
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. https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/ddf7b2a856d676316525eb581c1a4cc83ca6097b/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
-rw-r--r--Gemfile2
-rw-r--r--Gemfile.lock36
-rw-r--r--activestorage/lib/active_storage/service/gcs_service.rb2
-rw-r--r--activestorage/test/service/configurations.example.yml2
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/storage.yml.tt2
5 files changed, 23 insertions, 21 deletions
diff --git a/Gemfile b/Gemfile
index 3c26d1eb18..32ec87b501 100644
--- a/Gemfile
+++ b/Gemfile
@@ -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"
diff --git a/Gemfile.lock b/Gemfile.lock
index 70c4097798..1453bddb34 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -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)
diff --git a/activestorage/lib/active_storage/service/gcs_service.rb b/activestorage/lib/active_storage/service/gcs_service.rb
index be6ddf32a0..fd9916634a 100644
--- a/activestorage/lib/active_storage/service/gcs_service.rb
+++ b/activestorage/lib/active_storage/service/gcs_service.rb
@@ -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"
diff --git a/activestorage/test/service/configurations.example.yml b/activestorage/test/service/configurations.example.yml
index 56ed37be5d..43cc013bc8 100644
--- a/activestorage/test/service/configurations.example.yml
+++ b/activestorage/test/service/configurations.example.yml
@@ -7,7 +7,7 @@
#
# gcs:
# service: GCS
-# keyfile: {
+# credentials: {
# type: "service_account",
# project_id: "",
# private_key_id: "",
diff --git a/railties/lib/rails/generators/rails/app/templates/config/storage.yml.tt b/railties/lib/rails/generators/rails/app/templates/config/storage.yml.tt
index 9bada4b66d..1c0cde0b09 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/storage.yml.tt
+++ b/railties/lib/rails/generators/rails/app/templates/config/storage.yml.tt
@@ -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)