active_enquo 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/active_enquo.gemspec +1 -1
- data/lib/active_enquo.rb +16 -8
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49718410bbe14df7336b1fea307ee9657b3f30e9285a81402a97e783fd68f7b1
|
4
|
+
data.tar.gz: d4686e5fc488f9f5769ae412077e802249017c6f6b0de6639a5652c141392582
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65f06c88ba27143f51ed8c791f5e9e6948fa9a65a1bf7c53ec03131ea736a383569c3e9144cca5269dd6b27ce90132b3219fde1f547846145d5d291e72faffaf
|
7
|
+
data.tar.gz: 7b4d316abfb7a49268c1a063f60173307ab7175e2ee1ac3c49e45409ae3f8e2f8b854334455c2b3ae55625a312ef968aa648a452f9ab04b272d4572c6b8b7db0
|
data/active_enquo.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |s|
|
|
27
27
|
|
28
28
|
s.required_ruby_version = ">= 2.7.0"
|
29
29
|
|
30
|
-
s.add_runtime_dependency "enquo-core", "~> 0.
|
30
|
+
s.add_runtime_dependency "enquo-core", "~> 0.8"
|
31
31
|
s.add_runtime_dependency "activerecord", ">= 6"
|
32
32
|
|
33
33
|
s.add_development_dependency "bundler"
|
data/lib/active_enquo.rb
CHANGED
@@ -125,8 +125,8 @@ module ActiveEnquo
|
|
125
125
|
|
126
126
|
t = self.attribute_types[attr_name.to_s]
|
127
127
|
if t.is_a?(::ActiveEnquo::Type)
|
128
|
-
relation = self.arel_table.name
|
129
|
-
field = ::ActiveEnquo.root.field(relation, attr_name)
|
128
|
+
relation = self.arel_table.name.to_s
|
129
|
+
field = ::ActiveEnquo.root.field(relation, attr_name.to_s)
|
130
130
|
if meta_id.nil?
|
131
131
|
t.encrypt(value, "", field, enable_reduced_security_operations: true)
|
132
132
|
else
|
@@ -140,8 +140,8 @@ module ActiveEnquo
|
|
140
140
|
def unenquo(attr_name, value, ctx)
|
141
141
|
t = self.attribute_types[attr_name.to_s]
|
142
142
|
if t.is_a?(::ActiveEnquo::Type)
|
143
|
-
relation = self.arel_table.name
|
144
|
-
field = ::ActiveEnquo.root.field(relation, attr_name)
|
143
|
+
relation = self.arel_table.name.to_s
|
144
|
+
field = ::ActiveEnquo.root.field(relation, attr_name.to_s)
|
145
145
|
begin
|
146
146
|
t.decrypt(value, ctx, field)
|
147
147
|
rescue Enquo::Error
|
@@ -270,7 +270,7 @@ module ActiveEnquo
|
|
270
270
|
if value.nil? || value.is_a?(::ActiveRecord::StatementCache::Substitute)
|
271
271
|
value
|
272
272
|
else
|
273
|
-
field.encrypt_boolean(value, context,
|
273
|
+
field.encrypt_boolean(value, context, unsafe: enable_reduced_security_operations, no_query: no_query)
|
274
274
|
end
|
275
275
|
end
|
276
276
|
|
@@ -288,7 +288,7 @@ module ActiveEnquo
|
|
288
288
|
if value.nil? || value.is_a?(::ActiveRecord::StatementCache::Substitute)
|
289
289
|
value
|
290
290
|
else
|
291
|
-
field.encrypt_i64(value, context,
|
291
|
+
field.encrypt_i64(value, context, unsafe: enable_reduced_security_operations, no_query: no_query)
|
292
292
|
end
|
293
293
|
end
|
294
294
|
|
@@ -307,7 +307,7 @@ module ActiveEnquo
|
|
307
307
|
if value.nil?
|
308
308
|
value
|
309
309
|
else
|
310
|
-
field.encrypt_date(value, context,
|
310
|
+
field.encrypt_date(value, context, unsafe: enable_reduced_security_operations, no_query: no_query)
|
311
311
|
end
|
312
312
|
end
|
313
313
|
|
@@ -343,7 +343,15 @@ module ActiveEnquo
|
|
343
343
|
if value.nil? || value.is_a?(::ActiveRecord::StatementCache::Substitute)
|
344
344
|
value
|
345
345
|
else
|
346
|
-
|
346
|
+
opts = {
|
347
|
+
unsafe: enable_reduced_security_operations,
|
348
|
+
no_query: no_query,
|
349
|
+
}
|
350
|
+
if enable_ordering
|
351
|
+
opts[:order_prefix_length] = 8
|
352
|
+
end
|
353
|
+
|
354
|
+
field.encrypt_text(value.respond_to?(:encode) ? value.encode("UTF-8") : value, context, **opts)
|
347
355
|
end
|
348
356
|
end
|
349
357
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_enquo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Palmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: enquo-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.8'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.8'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activerecord
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|