asset_sync 2.13.1 → 2.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c593c361046c4faf574342749aced526c101c823c60b7ab8be5e39c7d029efe7
4
- data.tar.gz: 63d1361cfa79cfea245eb5cc63bf889cefa239fdf7ba863164414d48e861d444
3
+ metadata.gz: fb865a74b05c9a16ce39367906e4b4e98e95aa1ee6513cce217c84bea8a832b6
4
+ data.tar.gz: 4684411bd7bddcf9daf4e6e9c1ba0b92fbf85cf67f2c9a42825b3c910e151c49
5
5
  SHA512:
6
- metadata.gz: 4be760845b518f72bdad531311817b2d449bcaaada2b3ea3feb316af17e6c77fe29c1d7c2b72a46c866ba3b3d94fe0c751fa6a8206936c6d19e935bb0cae93a3
7
- data.tar.gz: 1a3bb12b3db320cd566d130eb0abce3a4209c7466324c12dc963822bb0edefb9f04926ece5379a6c74b392cfccc751a5097400ccf922f0ec2dcb9e1b620d43d8
6
+ metadata.gz: f02951393035ba6db862849187d74f41d49529206d6d8a13b84ccca91b7d7c533fee6f0ea2440ea4b4e35ed72967d2d7489cfb6118c9fb8895e201964f146f64
7
+ data.tar.gz: 51e1bd03d2acd5a528fa5960ff5986c29303bb8ec03ce643cb57bce30958fc5d1fab981de815459fc9b16eab176a1717ad1873a9b4f08a7659b94f5ed8b7bd5d
data/CHANGELOG.md CHANGED
@@ -18,6 +18,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
18
18
  - Nothing
19
19
 
20
20
 
21
+ ## [2.14.0] - 2020-03-31
22
+
23
+ ### Added
24
+
25
+ - Add support for fog option `google_json_key_string`
26
+ (https://github.com/AssetSync/asset_sync/pull/415)
27
+
28
+
21
29
  ## [2.13.1] - 2021-03-01
22
30
 
23
31
  ### Fixed
@@ -994,7 +1002,8 @@ Changes:
994
1002
  * Merge branch 'sinatra'
995
1003
 
996
1004
 
997
- [Unreleased]: https://github.com/AssetSync/asset_sync/compare/v2.13.1...HEAD
1005
+ [Unreleased]: https://github.com/AssetSync/asset_sync/compare/v2.14.0...HEAD
1006
+ [2.14.0]: https://github.com/AssetSync/asset_sync/compare/v2.13.1...v2.14.0
998
1007
  [2.13.1]: https://github.com/AssetSync/asset_sync/compare/v2.13.0...v2.13.1
999
1008
  [2.13.0]: https://github.com/AssetSync/asset_sync/compare/v2.12.1...v2.13.0
1000
1009
  [2.12.1]: https://github.com/AssetSync/asset_sync/compare/v2.12.0...v2.12.1
@@ -49,6 +49,7 @@ module AssetSync
49
49
  # Google Storage
50
50
  attr_accessor :google_storage_secret_access_key, :google_storage_access_key_id # when using S3 interop
51
51
  attr_accessor :google_json_key_location # when using service accounts
52
+ attr_accessor :google_json_key_string # when using service accounts
52
53
  attr_accessor :google_project # when using service accounts
53
54
 
54
55
  # Azure Blob with Fog::AzureRM
@@ -71,8 +72,12 @@ module AssetSync
71
72
  validates :rackspace_api_key, :presence => true, :if => :rackspace?
72
73
  validates :google_storage_secret_access_key, :presence => true, :if => :google_interop?
73
74
  validates :google_storage_access_key_id, :presence => true, :if => :google_interop?
74
- validates :google_json_key_location, :presence => true, :if => :google_service_account?
75
75
  validates :google_project, :presence => true, :if => :google_service_account?
76
+ validate(:if => :google_service_account?) do
77
+ unless google_json_key_location.present? || google_json_key_string.present?
78
+ errors.add(:base, 'must provide either google_json_key_location or google_json_key_string if using Google service account')
79
+ end
80
+ end
76
81
  validates :concurrent_uploads, :inclusion => { :in => [true, false] }
77
82
 
78
83
  def initialize
@@ -147,11 +152,11 @@ module AssetSync
147
152
  end
148
153
 
149
154
  def google_interop?
150
- google? && google_json_key_location.nil?
155
+ google? && google_json_key_location.nil? && google_json_key_string.nil?
151
156
  end
152
157
 
153
158
  def google_service_account?
154
- google? && google_json_key_location
159
+ google? && (google_json_key_location || google_json_key_string)
155
160
  end
156
161
 
157
162
  def azure_rm?
@@ -292,6 +297,8 @@ module AssetSync
292
297
  elsif google?
293
298
  if google_json_key_location
294
299
  options.merge!({:google_json_key_location => google_json_key_location, :google_project => google_project})
300
+ elsif google_json_key_string
301
+ options.merge!({:google_json_key_string => google_json_key_string, :google_project => google_project})
295
302
  else
296
303
  options.merge!({
297
304
  :google_storage_secret_access_key => google_storage_secret_access_key,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AssetSync
4
- VERSION = "2.13.1"
4
+ VERSION = "2.14.0"
5
5
  end
@@ -99,6 +99,28 @@ describe AssetSync do
99
99
  end
100
100
  end
101
101
 
102
+ describe "when using service account with JSON key string" do
103
+ before(:each) do
104
+ AssetSync.configure do |config|
105
+ config.google_json_key_string = 'a-google-json-key-string'
106
+ config.google_project = 'a-google-project-name'
107
+ end
108
+ end
109
+
110
+ it "should configure google_json_key_string" do
111
+ expect(AssetSync.config.google_json_key_string).to eq("a-google-json-key-string")
112
+ end
113
+
114
+ it "should return the correct fog_options" do
115
+ expected_fog_options = { google_json_key_string: "a-google-json-key-string",
116
+ google_project: 'a-google-project-name',
117
+ provider: "Google"}
118
+ expect(AssetSync.config.fog_options).to eq(expected_fog_options)
119
+ end
120
+ it "should not require that google_storage_secret_access_key or access_key_id be set" do
121
+ expect(AssetSync.config.valid?).to eq(true)
122
+ end
123
+ end
102
124
  end
103
125
 
104
126
  describe 'from yml' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asset_sync
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.13.1
4
+ version: 2.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Hamilton
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-03-01 00:00:00.000000000 Z
14
+ date: 2021-03-31 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: fog-core
@@ -273,7 +273,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
273
273
  - !ruby/object:Gem::Version
274
274
  version: '0'
275
275
  requirements: []
276
- rubygems_version: 3.2.11
276
+ rubygems_version: 3.2.15
277
277
  signing_key:
278
278
  specification_version: 4
279
279
  summary: Synchronises Assets in a Rails 3 application and Amazon S3/Cloudfront and