sorbet-runtime 0.5.10799 → 0.5.10801
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/types/props/decorator.rb +17 -14
- data/lib/types/props/type_validation.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba54a82310e9ffdf36ed09764075c214e2d764ba9bc7b3458c632ec1b6f214ba
|
4
|
+
data.tar.gz: aa7aae3663dd6f3996cf061402abdb0ccca41ba5cf68b0e17ce7bf1f067ec866
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 482e8190e0085bfae922f9845041c557a95effa46a819c61e003731afa65e351f51fe78ea438ded4eb2d9de3beb77116b51538e8b01b4fa48805ecc7b4a4edc3
|
7
|
+
data.tar.gz: b2c3783a81f5913ca21eeb9c520697d8e4878e35dffd2a47f0550e1e5ba09cc0e3a1ffacd61ee57675dc3eea15eae12a49412e6e459ef31e742555edb17f77c9
|
@@ -338,20 +338,23 @@ class T::Props::Decorator
|
|
338
338
|
# Retrive the possible underlying object with T.nilable.
|
339
339
|
type = T::Utils::Nilable.get_underlying_type(type)
|
340
340
|
|
341
|
-
|
342
|
-
|
343
|
-
if
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
341
|
+
rules_sensitivity = rules[:sensitivity]
|
342
|
+
sensitivity_and_pii = {sensitivity: rules_sensitivity}
|
343
|
+
if !rules_sensitivity.nil?
|
344
|
+
normalize = T::Configuration.normalize_sensitivity_and_pii_handler
|
345
|
+
if normalize
|
346
|
+
sensitivity_and_pii = normalize.call(sensitivity_and_pii)
|
347
|
+
|
348
|
+
# We check for Class so this is only applied on concrete
|
349
|
+
# documents/models; We allow mixins containing props to not
|
350
|
+
# specify their PII nature, as long as every class into which they
|
351
|
+
# are ultimately included does.
|
352
|
+
#
|
353
|
+
if sensitivity_and_pii[:pii] && @class.is_a?(Class) && !T.unsafe(@class).contains_pii?
|
354
|
+
raise ArgumentError.new(
|
355
|
+
'Cannot include a pii prop in a class that declares `contains_no_pii`'
|
356
|
+
)
|
357
|
+
end
|
355
358
|
end
|
356
359
|
end
|
357
360
|
|
@@ -29,7 +29,7 @@ module T::Props::TypeValidation
|
|
29
29
|
super
|
30
30
|
|
31
31
|
if !rules[:DEPRECATED_underspecified_type]
|
32
|
-
validate_type(type,
|
32
|
+
validate_type(type, name)
|
33
33
|
elsif rules[:DEPRECATED_underspecified_type] && find_invalid_subtype(type).nil?
|
34
34
|
raise ArgumentError.new("DEPRECATED_underspecified_type set unnecessarily for #{@class.name}.#{name} - #{type} is a valid type")
|
35
35
|
end
|
@@ -41,8 +41,9 @@ module T::Props::TypeValidation
|
|
41
41
|
field_name: T.any(Symbol, String),
|
42
42
|
)
|
43
43
|
.void
|
44
|
+
.checked(:never)
|
44
45
|
end
|
45
|
-
private def validate_type(type, field_name
|
46
|
+
private def validate_type(type, field_name)
|
46
47
|
if (invalid_subtype = find_invalid_subtype(type))
|
47
48
|
raise UnderspecifiedType.new(type_error_message(invalid_subtype, field_name, type))
|
48
49
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sorbet-runtime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.10801
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stripe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|