cuenca-validations 0.11.19.dev2__py3-none-any.whl → 0.11.19.dev4__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/errors.py +9 -0
- cuenca_validations/validators.py +0 -3
- cuenca_validations/version.py +1 -1
- {cuenca_validations-0.11.19.dev2.dist-info → cuenca_validations-0.11.19.dev4.dist-info}/METADATA +5 -5
- {cuenca_validations-0.11.19.dev2.dist-info → cuenca_validations-0.11.19.dev4.dist-info}/RECORD +8 -8
- {cuenca_validations-0.11.19.dev2.dist-info → cuenca_validations-0.11.19.dev4.dist-info}/WHEEL +1 -1
- {cuenca_validations-0.11.19.dev2.dist-info → cuenca_validations-0.11.19.dev4.dist-info}/LICENSE +0 -0
- {cuenca_validations-0.11.19.dev2.dist-info → cuenca_validations-0.11.19.dev4.dist-info}/top_level.txt +0 -0
cuenca_validations/errors.py
CHANGED
|
@@ -8,6 +8,7 @@ __all__ = [
|
|
|
8
8
|
'NoPasswordFoundError',
|
|
9
9
|
'NotDigitError',
|
|
10
10
|
'TooManyAttemptsError',
|
|
11
|
+
'UserLocationError',
|
|
11
12
|
'UserNotLoggedInError',
|
|
12
13
|
'WrongCredsError',
|
|
13
14
|
]
|
|
@@ -82,6 +83,13 @@ class TooManyAttemptsError(CuencaError):
|
|
|
82
83
|
status_code = 403
|
|
83
84
|
|
|
84
85
|
|
|
86
|
+
class UserLocationError(CuencaError):
|
|
87
|
+
"""User not in the same location from which they logged in."""
|
|
88
|
+
|
|
89
|
+
code = 108
|
|
90
|
+
status_code = 401
|
|
91
|
+
|
|
92
|
+
|
|
85
93
|
class ApiError(CuencaError):
|
|
86
94
|
"""Internal error"""
|
|
87
95
|
|
|
@@ -98,5 +106,6 @@ ERROR_CODES = {
|
|
|
98
106
|
NoPasswordFoundError,
|
|
99
107
|
AuthMethodNotAllowedError,
|
|
100
108
|
TooManyAttemptsError,
|
|
109
|
+
UserLocationError,
|
|
101
110
|
]
|
|
102
111
|
}
|
cuenca_validations/validators.py
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import base64
|
|
2
1
|
import datetime as dt
|
|
3
2
|
from enum import Enum
|
|
4
3
|
from typing import Any, Callable, List, Union
|
|
@@ -31,8 +30,6 @@ def sanitize_item(item: Any, default: Callable = None) -> Any:
|
|
|
31
30
|
sanitize_dict(e) if isinstance(e, dict) else sanitize_item(e)
|
|
32
31
|
for e in item
|
|
33
32
|
]
|
|
34
|
-
elif isinstance(item, bytes):
|
|
35
|
-
rv = base64.b64encode(item).decode('utf-8')
|
|
36
33
|
elif isinstance(item, Enum):
|
|
37
34
|
rv = item.value
|
|
38
35
|
elif hasattr(item, 'to_dict'):
|
cuenca_validations/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '0.11.19.
|
|
1
|
+
__version__ = '0.11.19.dev4'
|
{cuenca_validations-0.11.19.dev2.dist-info → cuenca_validations-0.11.19.dev4.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: cuenca-validations
|
|
3
|
-
Version: 0.11.19.
|
|
3
|
+
Version: 0.11.19.dev4
|
|
4
4
|
Summary: Cuenca common validations
|
|
5
5
|
Home-page: https://github.com/cuenca-mx/cuenca-validations
|
|
6
6
|
Author: Cuenca
|
|
@@ -14,10 +14,10 @@ Classifier: Operating System :: OS Independent
|
|
|
14
14
|
Requires-Python: >=3.6
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: clabe
|
|
18
|
-
Requires-Dist: pydantic[email]
|
|
19
|
-
Requires-Dist: python-dateutil
|
|
20
|
-
Requires-Dist: dataclasses
|
|
17
|
+
Requires-Dist: clabe <1.3,>=1.2
|
|
18
|
+
Requires-Dist: pydantic[email] <1.9,>=1.6
|
|
19
|
+
Requires-Dist: python-dateutil >=2.7.0
|
|
20
|
+
Requires-Dist: dataclasses >=0.6 ; python_version < "3.7"
|
|
21
21
|
|
|
22
22
|
# Cuenca - validations
|
|
23
23
|
|
{cuenca_validations-0.11.19.dev2.dist-info → cuenca_validations-0.11.19.dev4.dist-info}/RECORD
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
cuenca_validations/__init__.py,sha256=5ufR_PsujY9zHsBs3unr7iu0uQi_jTx0-IRqT0sSwHo,152
|
|
2
2
|
cuenca_validations/card_bins.py,sha256=9OpK0mCrG7DlmRI8UoyXj962uFkP9J6eCbYeF-C1SKQ,2500
|
|
3
|
-
cuenca_validations/errors.py,sha256=
|
|
3
|
+
cuenca_validations/errors.py,sha256=Avsqb3eOBbFBwCiVLTQymaweJJTCUabwzcL0JcQSiCg,2336
|
|
4
4
|
cuenca_validations/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
cuenca_validations/typing.py,sha256=5l2IfV8ff2LRKQLBrhgIjeV08nGClm_NBk5DYnqF0Rs,210
|
|
6
|
-
cuenca_validations/validators.py,sha256=
|
|
7
|
-
cuenca_validations/version.py,sha256=
|
|
6
|
+
cuenca_validations/validators.py,sha256=nyDplSnfh7wB1zWWhSRmM9OjKUzqcEXkw2W5joNKJ9o,1504
|
|
7
|
+
cuenca_validations/version.py,sha256=cNfDjo4VDNe0P0V_DEXuNquNvjMqNdI589FYB0C4TTc,29
|
|
8
8
|
cuenca_validations/types/__init__.py,sha256=HOrTOhIl2_fBx0IDOs_u6Af58HAwPYqjaCt_-3dmnks,4655
|
|
9
9
|
cuenca_validations/types/card.py,sha256=c_0Xhr0LwOjceqDEmt2b4inFtzOdSsl08IbX8d3zPAo,1525
|
|
10
10
|
cuenca_validations/types/enums.py,sha256=o2la9doPVOo7jbobIeOuUY6Bz30Ebv9yeK3Hk2eZ8Lo,18446
|
|
@@ -17,8 +17,8 @@ tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
17
17
|
tests/test_card.py,sha256=jHXopISA7Ey9b0ZVisoQUp1uGq0S5GqHXehRMu-hnh4,1041
|
|
18
18
|
tests/test_statement.py,sha256=fhj64YebzvI-MHxL79PARXO716Z3Dr_rYVKGL4CG8DA,1239
|
|
19
19
|
tests/test_types.py,sha256=Y_RPS5FUshpU8eWbLUvsq4D_pYfOn4ToYwGt77O5ZgY,14691
|
|
20
|
-
cuenca_validations-0.11.19.
|
|
21
|
-
cuenca_validations-0.11.19.
|
|
22
|
-
cuenca_validations-0.11.19.
|
|
23
|
-
cuenca_validations-0.11.19.
|
|
24
|
-
cuenca_validations-0.11.19.
|
|
20
|
+
cuenca_validations-0.11.19.dev4.dist-info/LICENSE,sha256=wR76FmxBbfnQpwELkkE5iMF8sFIafEMgXLTE4N4WPTc,1063
|
|
21
|
+
cuenca_validations-0.11.19.dev4.dist-info/METADATA,sha256=9Piibo3pnnwGTWr3zkTXzv1zhy4q3mNkjj1xp9W4GMQ,1264
|
|
22
|
+
cuenca_validations-0.11.19.dev4.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
|
|
23
|
+
cuenca_validations-0.11.19.dev4.dist-info/top_level.txt,sha256=4233xdOs2HtuT-GFRjcDcwK0IwdwvWdczOtk0fPB6Gw,25
|
|
24
|
+
cuenca_validations-0.11.19.dev4.dist-info/RECORD,,
|
{cuenca_validations-0.11.19.dev2.dist-info → cuenca_validations-0.11.19.dev4.dist-info}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|