cuenca-validations 2.0.5.dev5__py3-none-any.whl → 2.1.0__py3-none-any.whl
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.
- cuenca_validations/types/general.py +1 -0
- cuenca_validations/version.py +1 -1
- {cuenca_validations-2.0.5.dev5.dist-info → cuenca_validations-2.1.0.dist-info}/METADATA +1 -1
- {cuenca_validations-2.0.5.dev5.dist-info → cuenca_validations-2.1.0.dist-info}/RECORD +8 -8
- tests/test_types.py +23 -22
- {cuenca_validations-2.0.5.dev5.dist-info → cuenca_validations-2.1.0.dist-info}/LICENSE +0 -0
- {cuenca_validations-2.0.5.dev5.dist-info → cuenca_validations-2.1.0.dist-info}/WHEEL +0 -0
- {cuenca_validations-2.0.5.dev5.dist-info → cuenca_validations-2.1.0.dist-info}/top_level.txt +0 -0
cuenca_validations/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '2.0
|
|
1
|
+
__version__ = '2.1.0'
|
|
@@ -4,12 +4,12 @@ cuenca_validations/errors.py,sha256=OtM8EgiKqYdz9Hn66AbBO96orL1or7efkyt0vh0Zxbs,
|
|
|
4
4
|
cuenca_validations/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
cuenca_validations/typing.py,sha256=1QCu81IbVZZpyInjyeAuO-nF36gpT5Gi4o6V9PozuOU,204
|
|
6
6
|
cuenca_validations/validators.py,sha256=wzwLnJ4wHggZvqp3mearbFkzvDERGeTNvJkuofQnuMc,1484
|
|
7
|
-
cuenca_validations/version.py,sha256=
|
|
7
|
+
cuenca_validations/version.py,sha256=LbU43-7hsLmdXWI0wTAl3y6D3Tr7CbJiDOLXwl7clj8,22
|
|
8
8
|
cuenca_validations/types/__init__.py,sha256=8fiuz26oYQT2DriQ7sbD740yFJergVhB1OYoUGETB5A,4783
|
|
9
9
|
cuenca_validations/types/card.py,sha256=UGzz8NTFAverUmdUKAK1oGHnOnjSNTpIRUm93vKSSGY,1295
|
|
10
10
|
cuenca_validations/types/enums.py,sha256=1ACr7I1iknXfm49y0YeP2sY1ZdZfreFC5cV4_6OJCw8,18825
|
|
11
11
|
cuenca_validations/types/files.py,sha256=2CszbwF9ytXV9suFFwyDjYG4XxY8UhCjRw3HttVXXNw,269
|
|
12
|
-
cuenca_validations/types/general.py,sha256=
|
|
12
|
+
cuenca_validations/types/general.py,sha256=c3j5Iv42yEpIGbylZ-64uoURgNiTmaZPiV5WOht0jTI,2249
|
|
13
13
|
cuenca_validations/types/helpers.py,sha256=6rHUhwoQ7jJZtGcW3LX-W5ZDl42PWE1RoBpGme7KCkk,610
|
|
14
14
|
cuenca_validations/types/identities.py,sha256=TivJcz0I_zolAWXZB3RTwt80OUAyW_wGdCL_6VJlxSM,4735
|
|
15
15
|
cuenca_validations/types/morals.py,sha256=m8kAedevmwfSPTA9GYe03l7pkgipynwYgKfejyVtnuI,1813
|
|
@@ -20,9 +20,9 @@ tests/test_card.py,sha256=QAfRz7e11gWICPnFJZ2tiYgUsFV3C9TwzJXrDnDNXFw,1202
|
|
|
20
20
|
tests/test_errors.py,sha256=ixiIgEuBuzfsL5p4uCFdF32XqFRtTPF6EVhGJ0keOrI,930
|
|
21
21
|
tests/test_helpers.py,sha256=ubzpi1UXCryLQdgsT_Zm2IX-XE_4L0dnHnhLwH06xK8,748
|
|
22
22
|
tests/test_statement.py,sha256=IOE0rRRBgBZSJv_FLaETEyn5NzzXKMNTqgjv99GX-68,1436
|
|
23
|
-
tests/test_types.py,sha256=
|
|
24
|
-
cuenca_validations-2.0.
|
|
25
|
-
cuenca_validations-2.0.
|
|
26
|
-
cuenca_validations-2.0.
|
|
27
|
-
cuenca_validations-2.0.
|
|
28
|
-
cuenca_validations-2.0.
|
|
23
|
+
tests/test_types.py,sha256=XpFDDO1N6kRARFLr8cXyY7jDRICAwrhNYkFst7cCKQE,17737
|
|
24
|
+
cuenca_validations-2.1.0.dist-info/LICENSE,sha256=wR76FmxBbfnQpwELkkE5iMF8sFIafEMgXLTE4N4WPTc,1063
|
|
25
|
+
cuenca_validations-2.1.0.dist-info/METADATA,sha256=5BZuDvmKIryj6aP-WROxHUdYwJZ8SII8oBa0BFzOLls,1572
|
|
26
|
+
cuenca_validations-2.1.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
27
|
+
cuenca_validations-2.1.0.dist-info/top_level.txt,sha256=4233xdOs2HtuT-GFRjcDcwK0IwdwvWdczOtk0fPB6Gw,25
|
|
28
|
+
cuenca_validations-2.1.0.dist-info/RECORD,,
|
tests/test_types.py
CHANGED
|
@@ -613,37 +613,38 @@ class LogConfigModel(BaseModel):
|
|
|
613
613
|
partial_secret: Annotated[
|
|
614
614
|
str, LogConfig(masked=True, unmasked_chars_length=4)
|
|
615
615
|
]
|
|
616
|
+
unmasked: Annotated[str, LogConfig(masked=False)]
|
|
617
|
+
excluded: Annotated[str, LogConfig(excluded=True)]
|
|
616
618
|
|
|
617
619
|
|
|
618
|
-
|
|
620
|
+
@pytest.mark.parametrize(
|
|
621
|
+
"field_name,expected_masked,expected_unmasked_length,expected_excluded",
|
|
622
|
+
[
|
|
623
|
+
("password", True, 0, False),
|
|
624
|
+
("validated", True, 0, False),
|
|
625
|
+
("secret", True, 0, False),
|
|
626
|
+
("partial_secret", True, 4, False),
|
|
627
|
+
("unmasked", False, 0, False),
|
|
628
|
+
("excluded", False, 0, True),
|
|
629
|
+
],
|
|
630
|
+
)
|
|
631
|
+
def test_log_config(
|
|
632
|
+
field_name, expected_masked, expected_unmasked_length, expected_excluded
|
|
633
|
+
):
|
|
619
634
|
model = LogConfigModel(
|
|
620
635
|
password="Mypass123.",
|
|
621
636
|
validated="str123",
|
|
622
637
|
secret="super-secret",
|
|
623
638
|
partial_secret="1234567890",
|
|
639
|
+
unmasked="unmasked",
|
|
640
|
+
excluded="excluded",
|
|
624
641
|
)
|
|
625
642
|
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
assert get_log_config(password_field).masked is True
|
|
632
|
-
assert get_log_config(password_field).unmasked_chars_length == 0
|
|
633
|
-
|
|
634
|
-
assert get_log_config(validated_field).masked is True
|
|
635
|
-
assert get_log_config(validated_field).unmasked_chars_length == 0
|
|
636
|
-
|
|
637
|
-
assert get_log_config(secret_field).masked is True
|
|
638
|
-
assert get_log_config(secret_field).unmasked_chars_length == 0
|
|
639
|
-
|
|
640
|
-
assert get_log_config(partial_field).masked is True
|
|
641
|
-
assert get_log_config(partial_field).unmasked_chars_length == 4
|
|
642
|
-
|
|
643
|
-
assert model.password.get_secret_value() == "Mypass123."
|
|
644
|
-
assert model.validated == "str123"
|
|
645
|
-
assert model.secret == "super-secret"
|
|
646
|
-
assert model.partial_secret == "1234567890"
|
|
643
|
+
field = model.model_fields[field_name]
|
|
644
|
+
config = get_log_config(field)
|
|
645
|
+
assert config.masked is expected_masked
|
|
646
|
+
assert config.unmasked_chars_length == expected_unmasked_length
|
|
647
|
+
assert config.excluded is expected_excluded
|
|
647
648
|
|
|
648
649
|
|
|
649
650
|
def test_get_log_config_no_log_config():
|
|
File without changes
|
|
File without changes
|
{cuenca_validations-2.0.5.dev5.dist-info → cuenca_validations-2.1.0.dist-info}/top_level.txt
RENAMED
|
File without changes
|