proxied 0.2.0 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +128 -112
- data/lib/generators/active_record/proxied_generator.rb +19 -18
- data/lib/generators/active_record/templates/migration.rb +14 -9
- data/lib/generators/mongoid/proxied_generator.rb +5 -0
- data/lib/generators/templates/proxied.rb +31 -1
- data/lib/proxied/checker.rb +25 -19
- data/lib/proxied/configuration.rb +20 -11
- data/lib/proxied/importer.rb +17 -9
- data/lib/proxied/logger.rb +13 -3
- data/lib/proxied/nosql/proxy_methods.rb +7 -6
- data/lib/proxied/shared.rb +12 -8
- data/lib/proxied/sql/proxy_methods.rb +10 -9
- data/lib/proxied/utilities.rb +19 -27
- data/lib/proxied/version.rb +1 -1
- data/lib/tasks/tasks.rake +4 -4
- data/proxied.gemspec +16 -16
- metadata +109 -43
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1efa52c524322a60a208bd12ebc9d8acdc5e9abeaa4f907cb77d4084ad5cd09c
|
4
|
+
data.tar.gz: 16347e22feb2f9059bf52dc9806a7a40b1e2ab484f3bd5db4cbac8af830c3c45
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a53757a72afef8145b241569d2d2be729851a7a243321eb42bf991d2d1944ab260d8e8f6a3f360b06bf626ab36871c7ffd303ed161e3d263a1187d0f57bb344
|
7
|
+
data.tar.gz: 26ebf333aa140ad846422482913834f52d2139bc8900900f8b5d2b66eee67443f3272adab13e2a7b97b9cfea908c6c83d5bfd6892cb5d8d8af8aabfbdd1946cb
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,202 +1,218 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
proxied (0.2.
|
5
|
-
faraday (>= 0.
|
6
|
-
net-ssh (
|
4
|
+
proxied (0.2.6)
|
5
|
+
faraday (~> 1.0, >= 1.0.1)
|
6
|
+
net-ssh (~> 6.1)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (
|
12
|
-
actionpack (=
|
11
|
+
actioncable (6.0.3.2)
|
12
|
+
actionpack (= 6.0.3.2)
|
13
13
|
nio4r (~> 2.0)
|
14
14
|
websocket-driver (>= 0.6.1)
|
15
|
-
|
16
|
-
actionpack (=
|
17
|
-
|
18
|
-
|
15
|
+
actionmailbox (6.0.3.2)
|
16
|
+
actionpack (= 6.0.3.2)
|
17
|
+
activejob (= 6.0.3.2)
|
18
|
+
activerecord (= 6.0.3.2)
|
19
|
+
activestorage (= 6.0.3.2)
|
20
|
+
activesupport (= 6.0.3.2)
|
21
|
+
mail (>= 2.7.1)
|
22
|
+
actionmailer (6.0.3.2)
|
23
|
+
actionpack (= 6.0.3.2)
|
24
|
+
actionview (= 6.0.3.2)
|
25
|
+
activejob (= 6.0.3.2)
|
19
26
|
mail (~> 2.5, >= 2.5.4)
|
20
27
|
rails-dom-testing (~> 2.0)
|
21
|
-
actionpack (
|
22
|
-
actionview (=
|
23
|
-
activesupport (=
|
24
|
-
rack (~> 2.0)
|
28
|
+
actionpack (6.0.3.2)
|
29
|
+
actionview (= 6.0.3.2)
|
30
|
+
activesupport (= 6.0.3.2)
|
31
|
+
rack (~> 2.0, >= 2.0.8)
|
25
32
|
rack-test (>= 0.6.3)
|
26
33
|
rails-dom-testing (~> 2.0)
|
27
|
-
rails-html-sanitizer (~> 1.0, >= 1.0
|
28
|
-
|
29
|
-
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
35
|
+
actiontext (6.0.3.2)
|
36
|
+
actionpack (= 6.0.3.2)
|
37
|
+
activerecord (= 6.0.3.2)
|
38
|
+
activestorage (= 6.0.3.2)
|
39
|
+
activesupport (= 6.0.3.2)
|
40
|
+
nokogiri (>= 1.8.5)
|
41
|
+
actionview (6.0.3.2)
|
42
|
+
activesupport (= 6.0.3.2)
|
30
43
|
builder (~> 3.1)
|
31
44
|
erubi (~> 1.4)
|
32
45
|
rails-dom-testing (~> 2.0)
|
33
|
-
rails-html-sanitizer (~> 1.
|
34
|
-
activejob (
|
35
|
-
activesupport (=
|
46
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
47
|
+
activejob (6.0.3.2)
|
48
|
+
activesupport (= 6.0.3.2)
|
36
49
|
globalid (>= 0.3.6)
|
37
|
-
activemodel (
|
38
|
-
activesupport (=
|
39
|
-
activerecord (
|
40
|
-
activemodel (=
|
41
|
-
activesupport (=
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
activerecord (=
|
50
|
+
activemodel (6.0.3.2)
|
51
|
+
activesupport (= 6.0.3.2)
|
52
|
+
activerecord (6.0.3.2)
|
53
|
+
activemodel (= 6.0.3.2)
|
54
|
+
activesupport (= 6.0.3.2)
|
55
|
+
activestorage (6.0.3.2)
|
56
|
+
actionpack (= 6.0.3.2)
|
57
|
+
activejob (= 6.0.3.2)
|
58
|
+
activerecord (= 6.0.3.2)
|
46
59
|
marcel (~> 0.3.1)
|
47
|
-
activesupport (
|
60
|
+
activesupport (6.0.3.2)
|
48
61
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
49
62
|
i18n (>= 0.7, < 2)
|
50
63
|
minitest (~> 5.1)
|
51
64
|
tzinfo (~> 1.1)
|
52
|
-
|
53
|
-
|
54
|
-
|
65
|
+
zeitwerk (~> 2.2, >= 2.2.2)
|
66
|
+
addressable (2.7.0)
|
67
|
+
public_suffix (>= 2.0.2, < 5.0)
|
68
|
+
appraisal (2.3.0)
|
55
69
|
bundler
|
56
70
|
rake
|
57
71
|
thor (>= 0.14.0)
|
58
|
-
arel (9.0.0)
|
59
72
|
axiom-types (0.1.1)
|
60
73
|
descendants_tracker (~> 0.0.4)
|
61
74
|
ice_nine (~> 0.11.0)
|
62
75
|
thread_safe (~> 0.3, >= 0.3.1)
|
63
|
-
builder (3.2.
|
64
|
-
coderay (1.1.
|
76
|
+
builder (3.2.4)
|
77
|
+
coderay (1.1.3)
|
65
78
|
coercible (1.0.0)
|
66
79
|
descendants_tracker (~> 0.0.1)
|
67
|
-
concurrent-ruby (1.1.
|
80
|
+
concurrent-ruby (1.1.6)
|
68
81
|
crack (0.4.3)
|
69
82
|
safe_yaml (~> 1.0.0)
|
70
|
-
crass (1.0.
|
83
|
+
crass (1.0.6)
|
71
84
|
descendants_tracker (0.0.4)
|
72
85
|
thread_safe (~> 0.3, >= 0.3.1)
|
73
|
-
diff-lcs (1.
|
86
|
+
diff-lcs (1.4.4)
|
74
87
|
equalizer (0.0.11)
|
75
|
-
erubi (1.
|
76
|
-
faraday (0.
|
88
|
+
erubi (1.9.0)
|
89
|
+
faraday (1.0.1)
|
77
90
|
multipart-post (>= 1.2, < 3)
|
78
91
|
generator_spec (0.9.4)
|
79
92
|
activesupport (>= 3.0.0)
|
80
93
|
railties (>= 3.0.0)
|
81
94
|
globalid (0.4.2)
|
82
95
|
activesupport (>= 4.2.0)
|
83
|
-
hashdiff (0.
|
84
|
-
i18n (1.
|
96
|
+
hashdiff (1.0.1)
|
97
|
+
i18n (1.8.3)
|
85
98
|
concurrent-ruby (~> 1.0)
|
86
99
|
ice_nine (0.11.2)
|
87
|
-
loofah (2.
|
100
|
+
loofah (2.6.0)
|
88
101
|
crass (~> 1.0.2)
|
89
102
|
nokogiri (>= 1.5.9)
|
90
103
|
mail (2.7.1)
|
91
104
|
mini_mime (>= 0.1.1)
|
92
105
|
marcel (0.3.3)
|
93
106
|
mimemagic (~> 0.3.2)
|
94
|
-
method_source (0.
|
95
|
-
mimemagic (0.3.
|
96
|
-
mini_mime (1.0.
|
107
|
+
method_source (1.0.0)
|
108
|
+
mimemagic (0.3.5)
|
109
|
+
mini_mime (1.0.2)
|
97
110
|
mini_portile2 (2.4.0)
|
98
|
-
minitest (5.
|
111
|
+
minitest (5.14.1)
|
99
112
|
multipart-post (2.1.1)
|
100
|
-
net-ssh (
|
101
|
-
nio4r (2.
|
102
|
-
nokogiri (1.10.
|
113
|
+
net-ssh (6.1.0)
|
114
|
+
nio4r (2.5.2)
|
115
|
+
nokogiri (1.10.10)
|
103
116
|
mini_portile2 (~> 2.4.0)
|
104
|
-
pry (0.
|
105
|
-
coderay (~> 1.1
|
106
|
-
method_source (~>
|
107
|
-
public_suffix (
|
108
|
-
rack (2.
|
117
|
+
pry (0.13.1)
|
118
|
+
coderay (~> 1.1)
|
119
|
+
method_source (~> 1.0)
|
120
|
+
public_suffix (4.0.5)
|
121
|
+
rack (2.2.3)
|
109
122
|
rack-test (1.1.0)
|
110
123
|
rack (>= 1.0, < 3)
|
111
|
-
rails (
|
112
|
-
actioncable (=
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
124
|
+
rails (6.0.3.2)
|
125
|
+
actioncable (= 6.0.3.2)
|
126
|
+
actionmailbox (= 6.0.3.2)
|
127
|
+
actionmailer (= 6.0.3.2)
|
128
|
+
actionpack (= 6.0.3.2)
|
129
|
+
actiontext (= 6.0.3.2)
|
130
|
+
actionview (= 6.0.3.2)
|
131
|
+
activejob (= 6.0.3.2)
|
132
|
+
activemodel (= 6.0.3.2)
|
133
|
+
activerecord (= 6.0.3.2)
|
134
|
+
activestorage (= 6.0.3.2)
|
135
|
+
activesupport (= 6.0.3.2)
|
121
136
|
bundler (>= 1.3.0)
|
122
|
-
railties (=
|
137
|
+
railties (= 6.0.3.2)
|
123
138
|
sprockets-rails (>= 2.0.0)
|
124
139
|
rails-dom-testing (2.0.3)
|
125
140
|
activesupport (>= 4.2.0)
|
126
141
|
nokogiri (>= 1.6)
|
127
|
-
rails-html-sanitizer (1.0
|
128
|
-
loofah (~> 2.
|
129
|
-
railties (
|
130
|
-
actionpack (=
|
131
|
-
activesupport (=
|
142
|
+
rails-html-sanitizer (1.3.0)
|
143
|
+
loofah (~> 2.3)
|
144
|
+
railties (6.0.3.2)
|
145
|
+
actionpack (= 6.0.3.2)
|
146
|
+
activesupport (= 6.0.3.2)
|
132
147
|
method_source
|
133
148
|
rake (>= 0.8.7)
|
134
|
-
thor (>= 0.
|
135
|
-
rake (
|
136
|
-
rdoc (6.
|
137
|
-
rspec-core (3.
|
138
|
-
rspec-support (~> 3.
|
139
|
-
rspec-expectations (3.
|
149
|
+
thor (>= 0.20.3, < 2.0)
|
150
|
+
rake (13.0.1)
|
151
|
+
rdoc (6.2.1)
|
152
|
+
rspec-core (3.9.2)
|
153
|
+
rspec-support (~> 3.9.3)
|
154
|
+
rspec-expectations (3.9.2)
|
140
155
|
diff-lcs (>= 1.2.0, < 2.0)
|
141
|
-
rspec-support (~> 3.
|
142
|
-
rspec-mocks (3.
|
156
|
+
rspec-support (~> 3.9.0)
|
157
|
+
rspec-mocks (3.9.1)
|
143
158
|
diff-lcs (>= 1.2.0, < 2.0)
|
144
|
-
rspec-support (~> 3.
|
145
|
-
rspec-rails (
|
146
|
-
actionpack (>=
|
147
|
-
activesupport (>=
|
148
|
-
railties (>=
|
149
|
-
rspec-core (~> 3.
|
150
|
-
rspec-expectations (~> 3.
|
151
|
-
rspec-mocks (~> 3.
|
152
|
-
rspec-support (~> 3.
|
153
|
-
rspec-support (3.
|
159
|
+
rspec-support (~> 3.9.0)
|
160
|
+
rspec-rails (4.0.1)
|
161
|
+
actionpack (>= 4.2)
|
162
|
+
activesupport (>= 4.2)
|
163
|
+
railties (>= 4.2)
|
164
|
+
rspec-core (~> 3.9)
|
165
|
+
rspec-expectations (~> 3.9)
|
166
|
+
rspec-mocks (~> 3.9)
|
167
|
+
rspec-support (~> 3.9)
|
168
|
+
rspec-support (3.9.3)
|
154
169
|
safe_yaml (1.0.5)
|
155
|
-
sprockets (
|
170
|
+
sprockets (4.0.2)
|
156
171
|
concurrent-ruby (~> 1.0)
|
157
172
|
rack (> 1, < 3)
|
158
173
|
sprockets-rails (3.2.1)
|
159
174
|
actionpack (>= 4.0)
|
160
175
|
activesupport (>= 4.0)
|
161
176
|
sprockets (>= 3.0.0)
|
162
|
-
thor (0.
|
177
|
+
thor (1.0.1)
|
163
178
|
thread_safe (0.3.6)
|
164
|
-
tzinfo (1.2.
|
179
|
+
tzinfo (1.2.7)
|
165
180
|
thread_safe (~> 0.1)
|
166
|
-
vcr (
|
181
|
+
vcr (6.0.0)
|
167
182
|
virtus (1.0.5)
|
168
183
|
axiom-types (~> 0.1)
|
169
184
|
coercible (~> 1.0)
|
170
185
|
descendants_tracker (~> 0.0, >= 0.0.3)
|
171
186
|
equalizer (~> 0.0, >= 0.0.9)
|
172
|
-
webmock (3.
|
187
|
+
webmock (3.8.3)
|
173
188
|
addressable (>= 2.3.6)
|
174
189
|
crack (>= 0.3.2)
|
175
190
|
hashdiff (>= 0.4.0, < 2.0.0)
|
176
|
-
websocket-driver (0.7.
|
191
|
+
websocket-driver (0.7.3)
|
177
192
|
websocket-extensions (>= 0.1.0)
|
178
|
-
websocket-extensions (0.1.
|
193
|
+
websocket-extensions (0.1.5)
|
194
|
+
zeitwerk (2.3.1)
|
179
195
|
|
180
196
|
PLATFORMS
|
181
197
|
ruby
|
182
198
|
|
183
199
|
DEPENDENCIES
|
184
|
-
appraisal (
|
185
|
-
bundler (>= 1.
|
186
|
-
generator_spec (
|
200
|
+
appraisal (~> 2.3)
|
201
|
+
bundler (~> 2.1, >= 2.1.4)
|
202
|
+
generator_spec (~> 0.9.4)
|
187
203
|
proxied!
|
188
|
-
pry (
|
189
|
-
rails (~>
|
190
|
-
rake (>=
|
191
|
-
rdoc (>= 6.
|
192
|
-
rspec-core (>= 3.
|
193
|
-
rspec-expectations (>= 3.
|
194
|
-
rspec-mocks (>= 3.
|
195
|
-
rspec-rails (>=
|
196
|
-
rspec-support (>= 3.
|
197
|
-
vcr (
|
198
|
-
virtus (>= 1.0)
|
199
|
-
webmock (>= 3.
|
204
|
+
pry (~> 0.13.1)
|
205
|
+
rails (~> 6.0, >= 6.0.3.2)
|
206
|
+
rake (~> 13.0, >= 13.0.1)
|
207
|
+
rdoc (~> 6.2, >= 6.2.1)
|
208
|
+
rspec-core (~> 3.9, >= 3.9.2)
|
209
|
+
rspec-expectations (~> 3.9, >= 3.9.2)
|
210
|
+
rspec-mocks (~> 3.9, >= 3.9.1)
|
211
|
+
rspec-rails (~> 4.0, >= 4.0.1)
|
212
|
+
rspec-support (~> 3.9, >= 3.9.3)
|
213
|
+
vcr (~> 6.0)
|
214
|
+
virtus (~> 1.0, >= 1.0.5)
|
215
|
+
webmock (~> 3.8, >= 3.8.3)
|
200
216
|
|
201
217
|
BUNDLED WITH
|
202
|
-
1.
|
218
|
+
2.1.4
|
@@ -20,16 +20,16 @@ module ActiveRecord
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def inject_proxied_content
|
23
|
-
content
|
23
|
+
content = model_contents
|
24
24
|
|
25
|
-
class_path
|
25
|
+
class_path = if namespaced?
|
26
26
|
class_name.to_s.split("::")
|
27
27
|
else
|
28
28
|
[class_name]
|
29
29
|
end
|
30
30
|
|
31
|
-
indent_depth
|
32
|
-
content
|
31
|
+
indent_depth = class_path.size - 1
|
32
|
+
content = content.split("\n").map { |line| " " * indent_depth + line } .join("\n") << "\n"
|
33
33
|
|
34
34
|
inject_into_class(model_path, class_path.last, content) if model_exists?
|
35
35
|
end
|
@@ -40,8 +40,8 @@ module ActiveRecord
|
|
40
40
|
RUBY
|
41
41
|
end
|
42
42
|
|
43
|
-
def
|
44
|
-
Rails.version.
|
43
|
+
def should_version_migration?
|
44
|
+
!(Rails.version.to_s =~ /^(5|6)/i).nil?
|
45
45
|
end
|
46
46
|
|
47
47
|
def postgresql?
|
@@ -49,20 +49,21 @@ RUBY
|
|
49
49
|
config && config['adapter'] == 'postgresql'
|
50
50
|
end
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
52
|
+
def migration_version
|
53
|
+
if should_version_migration?
|
54
|
+
"[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
|
55
|
+
end
|
56
|
+
end
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
58
|
+
def primary_key_type
|
59
|
+
primary_key_string if should_version_migration?
|
60
|
+
end
|
61
61
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
62
|
+
def primary_key_string
|
63
|
+
key_string = options[:primary_key_type]
|
64
|
+
", id: :#{key_string}" if key_string
|
65
|
+
end
|
66
|
+
|
66
67
|
end
|
67
68
|
end
|
68
69
|
end
|
@@ -3,18 +3,23 @@
|
|
3
3
|
class ProxiedCreate<%= table_name.camelize %> < ActiveRecord::Migration<%= migration_version %>
|
4
4
|
def change
|
5
5
|
create_table :<%= table_name %><%= primary_key_type %> do |t|
|
6
|
-
t.string
|
7
|
-
t.
|
8
|
-
t.
|
9
|
-
t.string :password
|
6
|
+
t.string :host, null: false, index: true
|
7
|
+
t.string :ip_address, null: false, index: true
|
8
|
+
t.integer :port, null: false, index: true
|
10
9
|
|
11
|
-
t.string
|
12
|
-
t.string
|
13
|
-
t.string
|
10
|
+
t.string :username
|
11
|
+
t.string :password
|
12
|
+
t.string :auth_mode, null: false, default: 'credentials', index: true
|
14
13
|
|
15
|
-
t.string
|
16
|
-
t.string
|
14
|
+
t.string :protocol, null: false, default: 'http', index: true
|
15
|
+
t.string :proxy_type, null: false, default: 'public', index: true
|
16
|
+
t.string :category
|
17
17
|
|
18
|
+
t.string :country, index: true
|
19
|
+
t.string :city, index: true
|
20
|
+
|
21
|
+
t.boolean :checkable, null: false, default: true, index: true
|
22
|
+
t.boolean :asyncable, null: false, default: true, index: true
|
18
23
|
t.datetime :last_checked_at, index: true
|
19
24
|
|
20
25
|
t.boolean :valid_proxy, null: false, default: false, index: true
|
@@ -22,10 +22,12 @@ module Mongoid
|
|
22
22
|
|
23
23
|
# Fields
|
24
24
|
field :host, type: String
|
25
|
+
field :ip_address, type: String
|
25
26
|
field :port, type: Integer
|
26
27
|
|
27
28
|
field :username, type: String
|
28
29
|
field :password, type: String
|
30
|
+
field :auth_mode, type: String, default: :credentials
|
29
31
|
|
30
32
|
field :protocol, type: String, default: :http
|
31
33
|
field :proxy_type, type: String, default: :public
|
@@ -38,6 +40,9 @@ module Mongoid
|
|
38
40
|
field :successful_attempts, type: Integer, default: 0
|
39
41
|
field :failed_attempts, type: Integer, default: 0
|
40
42
|
|
43
|
+
field :checkable, type: Boolean, default: true
|
44
|
+
field :asyncable, type: Boolean, default: true
|
45
|
+
|
41
46
|
field :last_checked_at, type: DateTime
|
42
47
|
|
43
48
|
# Validations
|