asset_sync 2.17.0 → 2.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -1
- data/lib/asset_sync/config.rb +6 -3
- data/lib/asset_sync/version.rb +1 -1
- data/spec/unit/google_spec.rb +24 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b64084370fbccba4e315b80d8877893f7e556fc24eecc938f1dda2a328a78e3b
|
4
|
+
data.tar.gz: f387731557d333a5d295c4c62ac9fedc3d6b23c57509f1cefb306d823d91845e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f64ebb5f182457d6010c0c2c5ad8535668f980594c8d59bc7c59838d105e64d2ae7c067dca99604bca9e1dacccd2dedc5104cc88cedd2dfc7679aab7ebbe0d22
|
7
|
+
data.tar.gz: 87bf1e02addf61a30abfddd4ea082f2d730db5428425d2676808624349d3f2f987967051a85b9d075155e1555dbdfe3dcd34ab2d18580e39d272280d1436596f
|
data/CHANGELOG.md
CHANGED
@@ -7,7 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
7
7
|
|
8
8
|
### Added
|
9
9
|
|
10
|
-
-
|
10
|
+
- Nothing
|
11
11
|
|
12
12
|
### Changed
|
13
13
|
|
@@ -18,6 +18,14 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
18
18
|
- Nothing
|
19
19
|
|
20
20
|
|
21
|
+
## [2.18.0] - 2023-01-30
|
22
|
+
|
23
|
+
### Added
|
24
|
+
|
25
|
+
- Add `google_auth` configuration option
|
26
|
+
(https://github.com/AssetSync/asset_sync/pull/432)
|
27
|
+
|
28
|
+
|
21
29
|
## [2.17.0] - 2023-01-13
|
22
30
|
|
23
31
|
### Added
|
data/lib/asset_sync/config.rb
CHANGED
@@ -56,6 +56,7 @@ module AssetSync
|
|
56
56
|
attr_accessor :rackspace_username, :rackspace_api_key, :rackspace_auth_url
|
57
57
|
|
58
58
|
# Google Storage
|
59
|
+
attr_accessor :google_auth # when using generic auth (like access tokens)
|
59
60
|
attr_accessor :google_storage_secret_access_key, :google_storage_access_key_id # when using S3 interop
|
60
61
|
attr_accessor :google_json_key_location # when using service accounts
|
61
62
|
attr_accessor :google_json_key_string # when using service accounts
|
@@ -81,7 +82,7 @@ module AssetSync
|
|
81
82
|
validates :rackspace_api_key, :presence => true, :if => :rackspace?
|
82
83
|
validates :google_storage_secret_access_key, :presence => true, :if => :google_interop?
|
83
84
|
validates :google_storage_access_key_id, :presence => true, :if => :google_interop?
|
84
|
-
validates :google_project, :presence => true, :if =>
|
85
|
+
validates :google_project, :presence => true, :if => -> (c) { c.google_auth || c.google_service_account? }
|
85
86
|
validate(:if => :google_service_account?) do
|
86
87
|
unless google_json_key_location.present? || google_json_key_string.present?
|
87
88
|
errors.add(:base, 'must provide either google_json_key_location or google_json_key_string if using Google service account')
|
@@ -162,7 +163,7 @@ module AssetSync
|
|
162
163
|
end
|
163
164
|
|
164
165
|
def google_interop?
|
165
|
-
google? && google_json_key_location.nil? && google_json_key_string.nil?
|
166
|
+
google? && google_auth.nil? && google_json_key_location.nil? && google_json_key_string.nil?
|
166
167
|
end
|
167
168
|
|
168
169
|
def google_service_account?
|
@@ -310,7 +311,9 @@ module AssetSync
|
|
310
311
|
options.merge!({ :rackspace_region => fog_region }) if fog_region
|
311
312
|
options.merge!({ :rackspace_auth_url => rackspace_auth_url }) if rackspace_auth_url
|
312
313
|
elsif google?
|
313
|
-
if
|
314
|
+
if google_auth
|
315
|
+
options.merge!({:google_auth => google_auth, :google_project => google_project})
|
316
|
+
elsif google_json_key_location
|
314
317
|
options.merge!({:google_json_key_location => google_json_key_location, :google_project => google_project})
|
315
318
|
elsif google_json_key_string
|
316
319
|
options.merge!({:google_json_key_string => google_json_key_string, :google_project => google_project})
|
data/lib/asset_sync/version.rb
CHANGED
data/spec/unit/google_spec.rb
CHANGED
@@ -38,6 +38,30 @@ describe AssetSync do
|
|
38
38
|
expect(AssetSync.config.manifest).to be_falsey
|
39
39
|
end
|
40
40
|
|
41
|
+
describe "when using user-specified google credentials" do
|
42
|
+
before(:each) do
|
43
|
+
AssetSync.configure do |config|
|
44
|
+
config.google_auth = "access-token"
|
45
|
+
config.google_project = 'a-google-project-name'
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
it "should configure google_auth" do
|
50
|
+
expect(AssetSync.config.google_auth).to eq("access-token")
|
51
|
+
end
|
52
|
+
|
53
|
+
it "should return the correct fog_options" do
|
54
|
+
expected_fog_options = { google_auth: "access-token",
|
55
|
+
google_project: 'a-google-project-name',
|
56
|
+
provider: "Google"}
|
57
|
+
expect(AssetSync.config.fog_options).to eq(expected_fog_options)
|
58
|
+
end
|
59
|
+
|
60
|
+
it "should not require that other parameters be set" do
|
61
|
+
expect(AssetSync.config.valid?).to eq(true)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
41
65
|
describe "when using S3 interop API" do
|
42
66
|
before(:each) do
|
43
67
|
AssetSync.configure do |config|
|
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.
|
4
|
+
version: 2.18.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: 2023-01-
|
14
|
+
date: 2023-01-30 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: fog-core
|
@@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
- !ruby/object:Gem::Version
|
289
289
|
version: '0'
|
290
290
|
requirements: []
|
291
|
-
rubygems_version: 3.4.
|
291
|
+
rubygems_version: 3.4.5
|
292
292
|
signing_key:
|
293
293
|
specification_version: 4
|
294
294
|
summary: Synchronises Assets in a Rails 3 application and Amazon S3/Cloudfront and
|