pgdump_scrambler 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/main.yml +40 -0
- data/.gitignore +2 -0
- data/.rubocop.yml +45 -1
- data/CHANGELOG.md +11 -0
- data/Gemfile +13 -2
- data/Gemfile.lock +148 -101
- data/README.md +1 -1
- data/Rakefile +5 -3
- data/bin/console +4 -3
- data/bin/pgdump-obfuscator +7 -3
- data/lib/config/table.rb +8 -10
- data/lib/pgdump_scrambler/config.rb +31 -30
- data/lib/pgdump_scrambler/dumper.rb +26 -18
- data/lib/pgdump_scrambler/railtie.rb +2 -1
- data/lib/pgdump_scrambler/s3_request.rb +31 -36
- data/lib/pgdump_scrambler/s3_uploader.rb +17 -8
- data/lib/pgdump_scrambler/utils.rb +21 -0
- data/lib/pgdump_scrambler/version.rb +2 -1
- data/lib/pgdump_scrambler.rb +6 -7
- data/lib/tasks/pgdump_scrambler_tasks.rake +8 -6
- data/pgdump_scrambler.gemspec +17 -24
- metadata +13 -67
- data/.rubocop_todo.yml +0 -173
- data/.ruby-version +0 -1
- data/.travis.yml +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e7f5dfba9c232b88797b7bd41d467f2d78522df69c709923c8a37ad73258aa7
|
4
|
+
data.tar.gz: e4afb18633a51c9349af4182ea4c25f27b377d10c2b7c2b784dda45d942cec37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 182f6d023f2343404876af457a404b2e2c1c9410d951d8b1f68c1408861c42bd132db424ffe7fb292cbebaf78c7d355f83ecdb571c7cfa6f7d28c6c6b10cbe98
|
7
|
+
data.tar.gz: 79174375c3ae4f02a0d9b244d602fbba6258a8d8bfffe7be2e72c2939c25ae77e7acd73e074b1a60ce18519c3ad31562a74ba2dd2a68e47e38e671d34ad27370
|
@@ -0,0 +1,40 @@
|
|
1
|
+
name: Ruby
|
2
|
+
|
3
|
+
on: [pull_request]
|
4
|
+
|
5
|
+
concurrency:
|
6
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
7
|
+
cancel-in-progress: true
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby-version:
|
16
|
+
- "3.2"
|
17
|
+
- "3.1"
|
18
|
+
- "3.0"
|
19
|
+
# - "3.3.0-preview2"
|
20
|
+
|
21
|
+
# services:
|
22
|
+
# postgres:
|
23
|
+
# image: postgres:14
|
24
|
+
# ports: ["5432:5432"]
|
25
|
+
# options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
26
|
+
# env:
|
27
|
+
# POSTGRES_USER: postgres
|
28
|
+
# POSTGRES_PASSWORD: postgres
|
29
|
+
|
30
|
+
steps:
|
31
|
+
- uses: actions/checkout@v4
|
32
|
+
- name: Set up Ruby ${{ matrix.ruby-version }}
|
33
|
+
uses: ruby/setup-ruby@v1
|
34
|
+
with:
|
35
|
+
ruby-version: ${{ matrix.ruby-version }}
|
36
|
+
bundler-cache: true
|
37
|
+
- name: rspec
|
38
|
+
run: bundle exec rspec
|
39
|
+
- name: rubocop
|
40
|
+
run: bundle exec rubocop
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,2 +1,46 @@
|
|
1
|
-
|
1
|
+
require: rubocop-rspec
|
2
2
|
|
3
|
+
AllCops:
|
4
|
+
TargetRubyVersion: 3.0
|
5
|
+
NewCops: enable
|
6
|
+
|
7
|
+
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutargumentalignment
|
8
|
+
Layout/ArgumentAlignment:
|
9
|
+
EnforcedStyle: with_fixed_indentation
|
10
|
+
|
11
|
+
# https://docs.rubocop.org/rubocop/cops_layout.html#layoutmultilinemethodcallindentation
|
12
|
+
Layout/MultilineMethodCallIndentation:
|
13
|
+
EnforcedStyle: indented
|
14
|
+
|
15
|
+
Style/Documentation:
|
16
|
+
Enabled: false
|
17
|
+
|
18
|
+
Style/FormatString:
|
19
|
+
Enabled: false
|
20
|
+
|
21
|
+
Metrics/AbcSize:
|
22
|
+
Enabled: false
|
23
|
+
|
24
|
+
Metrics/ClassLength:
|
25
|
+
Enabled: false
|
26
|
+
|
27
|
+
Metrics/MethodLength:
|
28
|
+
Enabled: false
|
29
|
+
|
30
|
+
Metrics/BlockLength:
|
31
|
+
Enabled: false
|
32
|
+
|
33
|
+
Metrics/CyclomaticComplexity:
|
34
|
+
Enabled: false
|
35
|
+
|
36
|
+
Metrics/PerceivedComplexity:
|
37
|
+
Enabled: false
|
38
|
+
|
39
|
+
RSpec/ExampleLength:
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
RSpec/DescribedClass:
|
43
|
+
Enabled: false
|
44
|
+
|
45
|
+
RSpec/MultipleExpectations:
|
46
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,21 @@
|
|
1
|
+
## [0.5.0] - 2024-03-01
|
2
|
+
|
3
|
+
- Resolve ERB on loading config/database.yml
|
4
|
+
|
5
|
+
## [0.4.1] - 2023-10-19
|
6
|
+
|
7
|
+
- Fix S3 upload
|
8
|
+
|
1
9
|
## [0.4.0] - 2023-10-18
|
10
|
+
|
2
11
|
- Add scramble functions
|
3
12
|
- Support ARM64 Linux/Mac
|
4
13
|
|
5
14
|
## [0.3.0] - 2023-04-13
|
15
|
+
|
6
16
|
- Prefer using YAML.safe_load over YAML.load
|
7
17
|
- Test with Rails 7.0
|
8
18
|
|
9
19
|
### Fixes
|
20
|
+
|
10
21
|
- Fix JSON number format error
|
data/Gemfile
CHANGED
@@ -1,6 +1,17 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
|
5
|
+
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
|
4
6
|
|
5
7
|
# Specify your gem's dependencies in pgdump_scrambler.gemspec
|
6
8
|
gemspec
|
9
|
+
|
10
|
+
gem 'rails', '~> 7.0'
|
11
|
+
|
12
|
+
gem 'rake', '~> 13.0'
|
13
|
+
|
14
|
+
gem 'rspec', '~> 3.12'
|
15
|
+
|
16
|
+
gem 'rubocop', '1.57.1'
|
17
|
+
gem 'rubocop-rspec', '2.24.1'
|
data/Gemfile.lock
CHANGED
@@ -1,184 +1,230 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pgdump_scrambler (0.
|
4
|
+
pgdump_scrambler (0.5.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
actioncable (7.
|
10
|
-
actionpack (= 7.
|
11
|
-
activesupport (= 7.
|
9
|
+
actioncable (7.1.1)
|
10
|
+
actionpack (= 7.1.1)
|
11
|
+
activesupport (= 7.1.1)
|
12
12
|
nio4r (~> 2.0)
|
13
13
|
websocket-driver (>= 0.6.1)
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
zeitwerk (~> 2.6)
|
15
|
+
actionmailbox (7.1.1)
|
16
|
+
actionpack (= 7.1.1)
|
17
|
+
activejob (= 7.1.1)
|
18
|
+
activerecord (= 7.1.1)
|
19
|
+
activestorage (= 7.1.1)
|
20
|
+
activesupport (= 7.1.1)
|
20
21
|
mail (>= 2.7.1)
|
21
22
|
net-imap
|
22
23
|
net-pop
|
23
24
|
net-smtp
|
24
|
-
actionmailer (7.
|
25
|
-
actionpack (= 7.
|
26
|
-
actionview (= 7.
|
27
|
-
activejob (= 7.
|
28
|
-
activesupport (= 7.
|
25
|
+
actionmailer (7.1.1)
|
26
|
+
actionpack (= 7.1.1)
|
27
|
+
actionview (= 7.1.1)
|
28
|
+
activejob (= 7.1.1)
|
29
|
+
activesupport (= 7.1.1)
|
29
30
|
mail (~> 2.5, >= 2.5.4)
|
30
31
|
net-imap
|
31
32
|
net-pop
|
32
33
|
net-smtp
|
33
|
-
rails-dom-testing (~> 2.
|
34
|
-
actionpack (7.
|
35
|
-
actionview (= 7.
|
36
|
-
activesupport (= 7.
|
37
|
-
|
34
|
+
rails-dom-testing (~> 2.2)
|
35
|
+
actionpack (7.1.1)
|
36
|
+
actionview (= 7.1.1)
|
37
|
+
activesupport (= 7.1.1)
|
38
|
+
nokogiri (>= 1.8.5)
|
39
|
+
rack (>= 2.2.4)
|
40
|
+
rack-session (>= 1.0.1)
|
38
41
|
rack-test (>= 0.6.3)
|
39
|
-
rails-dom-testing (~> 2.
|
40
|
-
rails-html-sanitizer (~> 1.
|
41
|
-
actiontext (7.
|
42
|
-
actionpack (= 7.
|
43
|
-
activerecord (= 7.
|
44
|
-
activestorage (= 7.
|
45
|
-
activesupport (= 7.
|
42
|
+
rails-dom-testing (~> 2.2)
|
43
|
+
rails-html-sanitizer (~> 1.6)
|
44
|
+
actiontext (7.1.1)
|
45
|
+
actionpack (= 7.1.1)
|
46
|
+
activerecord (= 7.1.1)
|
47
|
+
activestorage (= 7.1.1)
|
48
|
+
activesupport (= 7.1.1)
|
46
49
|
globalid (>= 0.6.0)
|
47
50
|
nokogiri (>= 1.8.5)
|
48
|
-
actionview (7.
|
49
|
-
activesupport (= 7.
|
51
|
+
actionview (7.1.1)
|
52
|
+
activesupport (= 7.1.1)
|
50
53
|
builder (~> 3.1)
|
51
|
-
erubi (~> 1.
|
52
|
-
rails-dom-testing (~> 2.
|
53
|
-
rails-html-sanitizer (~> 1.
|
54
|
-
activejob (7.
|
55
|
-
activesupport (= 7.
|
54
|
+
erubi (~> 1.11)
|
55
|
+
rails-dom-testing (~> 2.2)
|
56
|
+
rails-html-sanitizer (~> 1.6)
|
57
|
+
activejob (7.1.1)
|
58
|
+
activesupport (= 7.1.1)
|
56
59
|
globalid (>= 0.3.6)
|
57
|
-
activemodel (7.
|
58
|
-
activesupport (= 7.
|
59
|
-
activerecord (7.
|
60
|
-
activemodel (= 7.
|
61
|
-
activesupport (= 7.
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
60
|
+
activemodel (7.1.1)
|
61
|
+
activesupport (= 7.1.1)
|
62
|
+
activerecord (7.1.1)
|
63
|
+
activemodel (= 7.1.1)
|
64
|
+
activesupport (= 7.1.1)
|
65
|
+
timeout (>= 0.4.0)
|
66
|
+
activestorage (7.1.1)
|
67
|
+
actionpack (= 7.1.1)
|
68
|
+
activejob (= 7.1.1)
|
69
|
+
activerecord (= 7.1.1)
|
70
|
+
activesupport (= 7.1.1)
|
67
71
|
marcel (~> 1.0)
|
68
|
-
|
69
|
-
|
72
|
+
activesupport (7.1.1)
|
73
|
+
base64
|
74
|
+
bigdecimal
|
70
75
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
76
|
+
connection_pool (>= 2.2.5)
|
77
|
+
drb
|
71
78
|
i18n (>= 1.6, < 2)
|
72
79
|
minitest (>= 5.1)
|
80
|
+
mutex_m
|
73
81
|
tzinfo (~> 2.0)
|
74
82
|
ast (2.4.2)
|
83
|
+
base64 (0.1.1)
|
84
|
+
bigdecimal (3.1.4)
|
75
85
|
builder (3.2.4)
|
76
86
|
concurrent-ruby (1.2.2)
|
87
|
+
connection_pool (2.4.1)
|
77
88
|
crass (1.0.6)
|
78
89
|
date (3.3.3)
|
79
90
|
diff-lcs (1.5.0)
|
91
|
+
drb (2.1.1)
|
92
|
+
ruby2_keywords
|
80
93
|
erubi (1.12.0)
|
81
|
-
globalid (1.1
|
82
|
-
activesupport (>=
|
83
|
-
i18n (1.
|
94
|
+
globalid (1.2.1)
|
95
|
+
activesupport (>= 6.1)
|
96
|
+
i18n (1.14.1)
|
84
97
|
concurrent-ruby (~> 1.0)
|
98
|
+
io-console (0.6.0)
|
99
|
+
irb (1.8.3)
|
100
|
+
rdoc
|
101
|
+
reline (>= 0.3.8)
|
85
102
|
json (2.6.3)
|
86
|
-
|
103
|
+
language_server-protocol (3.17.0.3)
|
104
|
+
loofah (2.21.4)
|
87
105
|
crass (~> 1.0.2)
|
88
|
-
nokogiri (>= 1.
|
106
|
+
nokogiri (>= 1.12.0)
|
89
107
|
mail (2.8.1)
|
90
108
|
mini_mime (>= 0.1.1)
|
91
109
|
net-imap
|
92
110
|
net-pop
|
93
111
|
net-smtp
|
94
112
|
marcel (1.0.2)
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
net-imap (0.
|
113
|
+
mini_mime (1.1.5)
|
114
|
+
minitest (5.20.0)
|
115
|
+
mutex_m (0.1.2)
|
116
|
+
net-imap (0.4.1)
|
99
117
|
date
|
100
118
|
net-protocol
|
101
119
|
net-pop (0.1.2)
|
102
120
|
net-protocol
|
103
121
|
net-protocol (0.2.1)
|
104
122
|
timeout
|
105
|
-
net-smtp (0.
|
123
|
+
net-smtp (0.4.0)
|
106
124
|
net-protocol
|
107
125
|
nio4r (2.5.9)
|
108
|
-
nokogiri (1.
|
126
|
+
nokogiri (1.15.4-x86_64-linux)
|
109
127
|
racc (~> 1.4)
|
110
|
-
parallel (1.
|
111
|
-
parser (3.2.2.
|
128
|
+
parallel (1.23.0)
|
129
|
+
parser (3.2.2.4)
|
112
130
|
ast (~> 2.4.1)
|
113
|
-
|
114
|
-
|
131
|
+
racc
|
132
|
+
psych (5.1.1.1)
|
133
|
+
stringio
|
134
|
+
racc (1.7.1)
|
135
|
+
rack (3.0.8)
|
136
|
+
rack-session (2.0.0)
|
137
|
+
rack (>= 3.0.0)
|
115
138
|
rack-test (2.1.0)
|
116
139
|
rack (>= 1.3)
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
140
|
+
rackup (2.1.0)
|
141
|
+
rack (>= 3)
|
142
|
+
webrick (~> 1.8)
|
143
|
+
rails (7.1.1)
|
144
|
+
actioncable (= 7.1.1)
|
145
|
+
actionmailbox (= 7.1.1)
|
146
|
+
actionmailer (= 7.1.1)
|
147
|
+
actionpack (= 7.1.1)
|
148
|
+
actiontext (= 7.1.1)
|
149
|
+
actionview (= 7.1.1)
|
150
|
+
activejob (= 7.1.1)
|
151
|
+
activemodel (= 7.1.1)
|
152
|
+
activerecord (= 7.1.1)
|
153
|
+
activestorage (= 7.1.1)
|
154
|
+
activesupport (= 7.1.1)
|
129
155
|
bundler (>= 1.15.0)
|
130
|
-
railties (= 7.
|
131
|
-
rails-dom-testing (2.0
|
132
|
-
activesupport (>=
|
156
|
+
railties (= 7.1.1)
|
157
|
+
rails-dom-testing (2.2.0)
|
158
|
+
activesupport (>= 5.0.0)
|
159
|
+
minitest
|
133
160
|
nokogiri (>= 1.6)
|
134
|
-
rails-html-sanitizer (1.
|
135
|
-
loofah (~> 2.
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
161
|
+
rails-html-sanitizer (1.6.0)
|
162
|
+
loofah (~> 2.21)
|
163
|
+
nokogiri (~> 1.14)
|
164
|
+
railties (7.1.1)
|
165
|
+
actionpack (= 7.1.1)
|
166
|
+
activesupport (= 7.1.1)
|
167
|
+
irb
|
168
|
+
rackup (>= 1.0.0)
|
140
169
|
rake (>= 12.2)
|
141
|
-
thor (~> 1.0)
|
142
|
-
zeitwerk (~> 2.
|
170
|
+
thor (~> 1.0, >= 1.2.2)
|
171
|
+
zeitwerk (~> 2.6)
|
143
172
|
rainbow (3.1.1)
|
144
173
|
rake (13.0.6)
|
145
|
-
|
146
|
-
|
174
|
+
rdoc (6.5.0)
|
175
|
+
psych (>= 4.0.0)
|
176
|
+
regexp_parser (2.8.2)
|
177
|
+
reline (0.3.9)
|
178
|
+
io-console (~> 0.5)
|
179
|
+
rexml (3.2.6)
|
147
180
|
rspec (3.12.0)
|
148
181
|
rspec-core (~> 3.12.0)
|
149
182
|
rspec-expectations (~> 3.12.0)
|
150
183
|
rspec-mocks (~> 3.12.0)
|
151
|
-
rspec-core (3.12.
|
184
|
+
rspec-core (3.12.2)
|
152
185
|
rspec-support (~> 3.12.0)
|
153
|
-
rspec-expectations (3.12.
|
186
|
+
rspec-expectations (3.12.3)
|
154
187
|
diff-lcs (>= 1.2.0, < 2.0)
|
155
188
|
rspec-support (~> 3.12.0)
|
156
|
-
rspec-mocks (3.12.
|
189
|
+
rspec-mocks (3.12.6)
|
157
190
|
diff-lcs (>= 1.2.0, < 2.0)
|
158
191
|
rspec-support (~> 3.12.0)
|
159
|
-
rspec-support (3.12.
|
160
|
-
rubocop (1.
|
192
|
+
rspec-support (3.12.1)
|
193
|
+
rubocop (1.57.1)
|
194
|
+
base64 (~> 0.1.1)
|
161
195
|
json (~> 2.3)
|
196
|
+
language_server-protocol (>= 3.17.0)
|
162
197
|
parallel (~> 1.10)
|
163
|
-
parser (>= 3.2.
|
198
|
+
parser (>= 3.2.2.4)
|
164
199
|
rainbow (>= 2.2.2, < 4.0)
|
165
200
|
regexp_parser (>= 1.8, < 3.0)
|
166
201
|
rexml (>= 3.2.5, < 4.0)
|
167
|
-
rubocop-ast (>= 1.28.
|
202
|
+
rubocop-ast (>= 1.28.1, < 2.0)
|
168
203
|
ruby-progressbar (~> 1.7)
|
169
204
|
unicode-display_width (>= 2.4.0, < 3.0)
|
170
|
-
rubocop-ast (1.
|
205
|
+
rubocop-ast (1.29.0)
|
171
206
|
parser (>= 3.2.1.0)
|
207
|
+
rubocop-capybara (2.19.0)
|
208
|
+
rubocop (~> 1.41)
|
209
|
+
rubocop-factory_bot (2.24.0)
|
210
|
+
rubocop (~> 1.33)
|
211
|
+
rubocop-rspec (2.24.1)
|
212
|
+
rubocop (~> 1.33)
|
213
|
+
rubocop-capybara (~> 2.17)
|
214
|
+
rubocop-factory_bot (~> 2.22)
|
172
215
|
ruby-progressbar (1.13.0)
|
173
|
-
|
174
|
-
|
216
|
+
ruby2_keywords (0.0.5)
|
217
|
+
stringio (3.0.8)
|
218
|
+
thor (1.3.0)
|
219
|
+
timeout (0.4.0)
|
175
220
|
tzinfo (2.0.6)
|
176
221
|
concurrent-ruby (~> 1.0)
|
177
|
-
unicode-display_width (2.
|
178
|
-
|
222
|
+
unicode-display_width (2.5.0)
|
223
|
+
webrick (1.8.1)
|
224
|
+
websocket-driver (0.7.6)
|
179
225
|
websocket-extensions (>= 0.1.0)
|
180
226
|
websocket-extensions (0.1.5)
|
181
|
-
zeitwerk (2.6.
|
227
|
+
zeitwerk (2.6.12)
|
182
228
|
|
183
229
|
PLATFORMS
|
184
230
|
x86_64-linux
|
@@ -188,7 +234,8 @@ DEPENDENCIES
|
|
188
234
|
rails (~> 7.0)
|
189
235
|
rake (~> 13.0)
|
190
236
|
rspec (~> 3.12)
|
191
|
-
rubocop
|
237
|
+
rubocop (= 1.57.1)
|
238
|
+
rubocop-rspec (= 2.24.1)
|
192
239
|
|
193
240
|
BUNDLED WITH
|
194
|
-
2.4.
|
241
|
+
2.4.20
|
data/README.md
CHANGED
data/Rakefile
CHANGED
data/bin/console
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'pgdump_scrambler'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
@@ -10,5 +11,5 @@ require "pgdump_scrambler"
|
|
10
11
|
# require "pry"
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start(__FILE__)
|
data/bin/pgdump-obfuscator
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'English'
|
2
5
|
require 'shellwords'
|
3
6
|
|
4
|
-
arch =
|
7
|
+
arch =
|
8
|
+
case RUBY_PLATFORM
|
5
9
|
when /aarch64-linux/
|
6
10
|
'linux-arm64'
|
7
11
|
when /x86_64-linux/
|
@@ -12,8 +16,8 @@ arch = case RUBY_PLATFORM
|
|
12
16
|
'darwin-arm64'
|
13
17
|
else
|
14
18
|
raise "Unsupported platform: #{RUBY_PLATFORM}"
|
15
|
-
end
|
19
|
+
end
|
16
20
|
|
17
21
|
cmd = File.expand_path "#{File.dirname(__FILE__)}/../libexec/pgdump-obfuscator-#{arch}"
|
18
22
|
|
19
|
-
exec "#{cmd} #{Shellwords.join(
|
23
|
+
exec "#{cmd} #{Shellwords.join($ARGV)}"
|
data/lib/config/table.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module PgdumpScrambler
|
3
4
|
class Config
|
4
5
|
class Table
|
@@ -6,7 +7,7 @@ module PgdumpScrambler
|
|
6
7
|
|
7
8
|
def initialize(name, columns)
|
8
9
|
@name = name
|
9
|
-
@column_hash = columns.sort_by(&:name).
|
10
|
+
@column_hash = columns.sort_by(&:name).to_h { |column| [column.name, column] }
|
10
11
|
end
|
11
12
|
|
12
13
|
def columns
|
@@ -39,29 +40,26 @@ module PgdumpScrambler
|
|
39
40
|
SCRAMBLE_CONST_REGEXP = /\Aconst\[.+\]\z/
|
40
41
|
NOP_METHODS = %w[unspecified nop].freeze
|
41
42
|
UNSPECIFIED = 'unspecified'
|
42
|
-
attr_reader :name
|
43
|
+
attr_reader :name, :scramble_method
|
43
44
|
|
44
45
|
def initialize(name, scramble_method = UNSPECIFIED)
|
45
46
|
unless self.class.valid_scramble_method?(scramble_method)
|
46
47
|
raise ArgumentError, "invalid scramble_method: #{scramble_method}"
|
47
48
|
end
|
49
|
+
|
48
50
|
@name = name
|
49
51
|
@scramble_method = scramble_method
|
50
52
|
end
|
51
53
|
|
52
|
-
def scramble_method
|
53
|
-
@scramble_method
|
54
|
-
end
|
55
|
-
|
56
54
|
def unspecifiled?
|
57
55
|
@scramble_method == UNSPECIFIED
|
58
56
|
end
|
59
57
|
|
60
58
|
def option
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
59
|
+
return if NOP_METHODS.member?(@scramble_method)
|
60
|
+
|
61
|
+
m = Shellwords.escape(scramble_method)
|
62
|
+
"#{@name}:#{m}"
|
65
63
|
end
|
66
64
|
|
67
65
|
class << self
|