workarea-core 3.4.32 → 3.4.33

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: 4efeb3ece9613f3cfad48795bd81db270c1c28a95c5c219f84f24d7416cdc111
4
- data.tar.gz: 0e397d42f281689cf24607fa58b53a1abf0dd5f3118320d2b01764ae336aa7f6
3
+ metadata.gz: 9380a926427872b88a127eeca3d80b734d8679e297cd691a409b2125d181b210
4
+ data.tar.gz: 37b763327a0a0f7eec7d34b4f744eae59580a8717f1e0bac3b4fadc830c62f61
5
5
  SHA512:
6
- metadata.gz: 4d5d1be53ba4ab30d7e1ff3e25d4eb47081c3e97bb5e21686a18872f05c0e9894ec53b2803612e7887fa0da66ebc8a2c11cf1805ba14d5532c634e646d6e8cf8
7
- data.tar.gz: 90e07d7eca3d3a7d9daa8064c0e85841d134098f436b7be7bcf1e599b06d7ba42504a3e314a2fe3058b37dda084745eb6c56fd206a885b3e57d906fbdb5dcaf5
6
+ metadata.gz: 6da8af3694f295513a48512a0fd51f2309c04f33b400461dfb90727c8d4b083a7e291e0e66edb69ae23ba9a55a4f8eb5351b34434da153ed915bada8ccdabe7d
7
+ data.tar.gz: f15b4a14d8e5a44f0acbc71c2c780731b0f9b3c3f07c8223e5aa15ba5d9ad48f8a779d81a10dd33b2561503fff5da37f7478ed3dedb7cfd6bfee5e6931b47a37
@@ -6,22 +6,21 @@ module Workarea
6
6
  uri = URI.parse(request_url)
7
7
  url = "#{uri.scheme}://#{uri.host}"
8
8
  url += ":#{uri.port}" unless uri.port.in? [80, 443]
9
-
10
- redis_key = "cors_#{url.optionize}"
11
- return if Workarea.redis.get(redis_key) == 'true'
9
+ id = "direct_upload_#{url}"
12
10
 
13
11
  response = Workarea.s3.get_bucket_cors(Configuration::S3.bucket)
14
12
  cors = response.data[:body]
15
- cors['CORSConfiguration'] << {
16
- 'ID' => "direct_upload_#{url}",
17
- 'AllowedMethod' => 'PUT',
18
- 'AllowedOrigin' => url,
19
- 'AllowedHeader' => '*'
20
- }
21
- cors['CORSConfiguration'].uniq!
22
-
23
- Workarea.s3.put_bucket_cors(Configuration::S3.bucket, cors)
24
- Workarea.redis.set(redis_key, 'true')
13
+
14
+ unless cors['CORSConfiguration'].pluck('ID').include?(id)
15
+ cors['CORSConfiguration'] << {
16
+ 'ID' => id,
17
+ 'AllowedMethod' => 'PUT',
18
+ 'AllowedOrigin' => url,
19
+ 'AllowedHeader' => '*'
20
+ }
21
+
22
+ Workarea.s3.put_bucket_cors(Configuration::S3.bucket, cors)
23
+ end
25
24
  end
26
25
 
27
26
  attr_reader :type, :filename
@@ -17,11 +17,11 @@ module Workarea
17
17
  import.process!
18
18
 
19
19
  ensure
20
- if import.error?
20
+ if import&.error?
21
21
  Admin::DataFileMailer.import_error(id).deliver_now
22
- elsif import.failure?
22
+ elsif import&.failure?
23
23
  Admin::DataFileMailer.import_failure(id).deliver_now
24
- else
24
+ elsif import.present?
25
25
  Admin::DataFileMailer.import(id).deliver_now
26
26
  end
27
27
  end
@@ -118,13 +118,12 @@ db.getSiblingDB("admin").runCommand( { setParameter: 1, notablescan: 0 } )
118
118
  **************************************************
119
119
  ⛔️ WARNING: Dragonfly is configured to use the filesystem.
120
120
 
121
- This means all dragonfly assets (assets, product images, etc.) will be stored
121
+ This means all Dragonfly assets (assets, product images, etc.) will be stored
122
122
  locally and not accessible to all servers within your environment.
123
123
 
124
124
  We recommend using S3 when running in a live environment by setting
125
- WORKAREA_S3_REGION and WORKAREA_S3_BUCKET_NAME in your environment variables.
126
- Workarea will automatically configure Dragonfly to use S3 if those values
127
- are present.
125
+ WORKAREA_S3_REGION and WORKAREA_S3_BUCKET_NAME in your environment variables,
126
+ and setting `Workarea.config.asset_store = :s3` in an initializer.
128
127
  **************************************************
129
128
  eos
130
129
  end
@@ -2,7 +2,7 @@ module Workarea
2
2
  module VERSION
3
3
  MAJOR = 3
4
4
  MINOR = 4
5
- PATCH = 32
5
+ PATCH = 33
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, PRE].compact.join('.')
@@ -108,11 +108,8 @@ module Workarea
108
108
  ).returns(true)
109
109
 
110
110
  assert(DirectUpload.ensure_cors!('http://test.host/admin/content_assets'))
111
- assert_equal('true', Workarea.redis.get('cors_http_test_host'))
112
111
  assert(DirectUpload.ensure_cors!('http://localhost:3000/admin/content_assets'))
113
- assert_equal('true', Workarea.redis.get('cors_http_localhost_3000'))
114
112
  assert(DirectUpload.ensure_cors!('https://example.com/admin/direct_uploads'))
115
- assert_equal('true', Workarea.redis.get('cors_https_example_com'))
116
113
  end
117
114
 
118
115
  private
@@ -53,5 +53,11 @@ module Workarea
53
53
  t('workarea.admin.data_file_mailer.import_failure.errors')
54
54
  )
55
55
  end
56
+
57
+ def test_perform_with_missing_import
58
+ assert_raises Mongoid::Errors::DocumentNotFound do
59
+ ProcessImport.new.perform('foo')
60
+ end
61
+ end
56
62
  end
57
63
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workarea-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.32
4
+ version: 3.4.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Crouse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-28 00:00:00.000000000 Z
11
+ date: 2020-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler