active_record_importer 1.0.0 → 1.0.1
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 +2 -0
- data/README.md +9 -0
- data/active_record_importer.gemspec +1 -1
- data/lib/active_record_importer/version.rb +1 -1
- data/spec/active_record_importer_spec.rb +26 -0
- metadata +8 -8
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 930b3b6e3e51fbcf8558ea19900d24eb3ba4343d1d826dc5a9ec44fbc1e92f83
|
|
4
|
+
data.tar.gz: 15c62e17028d2aabdfe9a9769ab494f702d9f1f149b0861d3589db6de2da4b35
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 813d0f9dd1d2eb35226376b33c88cfff7c5e5a0df8c854df9b53624a75bef5f29a1b2d2c018276ab97ad11231b3e948c4f20c7252f550ddb2823061eae073f32
|
|
7
|
+
data.tar.gz: d203ca011e084dbe16c3c401eac87976ec5b103b2e53aff5cd16445bc32a04ab5f0acc13f3e9329cde64ac34829a74edfbb773503fb1a3e447bfc8cae946fd94
|
data/CHANGELOG.md
CHANGED
|
@@ -27,6 +27,8 @@
|
|
|
27
27
|
- RSpec 3 for development.
|
|
28
28
|
|
|
29
29
|
### Fixed
|
|
30
|
+
- Require Paperclip >= 5.2.0 to address CVE-2017-0889 (SSRF). URI attachment
|
|
31
|
+
adapters are no longer enabled by default; local file uploads remain supported.
|
|
30
32
|
- Importer options were stored in a class variable shared by every importable model;
|
|
31
33
|
each model now keeps its own options.
|
|
32
34
|
- `default_attributes` given as `Proc` or `Symbol` were never evaluated, and
|
data/README.md
CHANGED
|
@@ -14,6 +14,15 @@ The spec suite runs against PostgreSQL and MySQL (ActiveRecord 7.2); see [Develo
|
|
|
14
14
|
|
|
15
15
|
* Ruby >= 2.7
|
|
16
16
|
* ActiveRecord >= 6.0
|
|
17
|
+
* Paperclip >= 5.2.0 and < 7.0
|
|
18
|
+
|
|
19
|
+
Paperclip's URI attachment adapters are disabled by default to prevent SSRF
|
|
20
|
+
(CVE-2017-0889). Use local file uploads; do not re-enable URI adapters for
|
|
21
|
+
untrusted input.
|
|
22
|
+
|
|
23
|
+
When upgrading from Paperclip 4.x with S3 storage, use `aws-sdk-s3`, configure
|
|
24
|
+
`s3_region`, and change explicit permissions such as `:public_read` to
|
|
25
|
+
`'public-read'`.
|
|
17
26
|
* PostgreSQL (>= 9.5) or MySQL for bulk upserts; other databases fall back to row-by-row saving
|
|
18
27
|
|
|
19
28
|
I'll release an update to enable this on background job.
|
|
@@ -30,5 +30,5 @@ Gem::Specification.new do |spec|
|
|
|
30
30
|
spec.add_runtime_dependency 'enumerize', '>= 2.0', '~> 2.0.1'
|
|
31
31
|
spec.add_runtime_dependency 'virtus', '>= 1.0', '~> 1.0'
|
|
32
32
|
spec.add_runtime_dependency 'smarter_csv', '>= 1.0', '~> 1.0'
|
|
33
|
-
spec.add_runtime_dependency 'paperclip', '>=
|
|
33
|
+
spec.add_runtime_dependency 'paperclip', '>= 5.2.0', '< 7.0'
|
|
34
34
|
end
|
|
@@ -4,4 +4,30 @@ RSpec.describe ActiveRecordImporter do
|
|
|
4
4
|
it 'has a version number' do
|
|
5
5
|
expect(ActiveRecordImporter::VERSION).not_to be nil
|
|
6
6
|
end
|
|
7
|
+
|
|
8
|
+
it 'requires a Paperclip version patched for CVE-2017-0889' do
|
|
9
|
+
spec = Gem::Specification.load(File.expand_path('../active_record_importer.gemspec', __dir__))
|
|
10
|
+
requirement = spec.runtime_dependencies.find { |dependency| dependency.name == 'paperclip' }.requirement
|
|
11
|
+
|
|
12
|
+
%w(3.1.4 4.2.4 5.1.0).each do |version|
|
|
13
|
+
expect(requirement.satisfied_by?(Gem::Version.new(version))).to be false
|
|
14
|
+
end
|
|
15
|
+
%w(5.2.0 6.1.0).each do |version|
|
|
16
|
+
expect(requirement.satisfied_by?(Gem::Version.new(version))).to be true
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it 'does not register URI attachment adapters by default' do
|
|
21
|
+
adapters = Paperclip.io_adapters.registered_handlers.map(&:first)
|
|
22
|
+
|
|
23
|
+
expect(adapters).not_to include(Paperclip::UriAdapter, Paperclip::HttpUrlProxyAdapter)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
it 'still accepts local CSV files as attachments' do
|
|
27
|
+
path = csv_file([{ first_name: 'Jane' }])
|
|
28
|
+
|
|
29
|
+
File.open(path) do |file|
|
|
30
|
+
expect(Paperclip.io_adapters.handler_for(file)).to eq(Paperclip::FileAdapter)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
7
33
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: active_record_importer
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Michael Nera
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-10-
|
|
11
|
+
date: 2026-10-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -146,20 +146,20 @@ dependencies:
|
|
|
146
146
|
requirements:
|
|
147
147
|
- - ">="
|
|
148
148
|
- !ruby/object:Gem::Version
|
|
149
|
-
version:
|
|
150
|
-
- - "
|
|
149
|
+
version: 5.2.0
|
|
150
|
+
- - "<"
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: '
|
|
152
|
+
version: '7.0'
|
|
153
153
|
type: :runtime
|
|
154
154
|
prerelease: false
|
|
155
155
|
version_requirements: !ruby/object:Gem::Requirement
|
|
156
156
|
requirements:
|
|
157
157
|
- - ">="
|
|
158
158
|
- !ruby/object:Gem::Version
|
|
159
|
-
version:
|
|
160
|
-
- - "
|
|
159
|
+
version: 5.2.0
|
|
160
|
+
- - "<"
|
|
161
161
|
- !ruby/object:Gem::Version
|
|
162
|
-
version: '
|
|
162
|
+
version: '7.0'
|
|
163
163
|
description: Smart gem for importing CSV files to ActiveRecord models
|
|
164
164
|
email:
|
|
165
165
|
- kapitan_03@yahoo.com
|