ecodev-core 0.0.61__tar.gz → 0.0.62__tar.gz
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.
Potentially problematic release.
This version of ecodev-core might be problematic. Click here for more details.
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/PKG-INFO +1 -1
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/__init__.py +4 -1
- ecodev_core-0.0.62/ecodev_core/encryption.py +32 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/pyproject.toml +1 -1
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/LICENSE.md +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/README.md +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/app_activity.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/app_rights.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/app_user.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/auth_configuration.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/authentication.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/backup.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/check_dependencies.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/custom_equal.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/db_connection.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/db_filters.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/db_i18n.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/db_insertion.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/db_retrieval.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/db_upsertion.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/deployment.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/email_sender.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/enum_utils.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/es_connection.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/list_utils.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/logger.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/pandas_utils.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/permissions.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/pydantic_utils.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/read_write.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/safe_utils.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/settings.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/sqlmodel_utils.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/token_banlist.py +0 -0
- {ecodev_core-0.0.61 → ecodev_core-0.0.62}/ecodev_core/version.py +0 -0
|
@@ -59,6 +59,8 @@ from ecodev_core.db_upsertion import upsert_df_data
|
|
|
59
59
|
from ecodev_core.db_upsertion import upsert_selector
|
|
60
60
|
from ecodev_core.deployment import Deployment
|
|
61
61
|
from ecodev_core.email_sender import send_email
|
|
62
|
+
from ecodev_core.encryption import decrypt_value
|
|
63
|
+
from ecodev_core.encryption import encrypt_value
|
|
62
64
|
from ecodev_core.enum_utils import enum_converter
|
|
63
65
|
from ecodev_core.list_utils import first_func_or_default
|
|
64
66
|
from ecodev_core.list_utils import first_or_default
|
|
@@ -118,4 +120,5 @@ __all__ = [
|
|
|
118
120
|
'sfield', 'field', 'upsert_df_data', 'upsert_deletor', 'get_row_versions', 'get_versions',
|
|
119
121
|
'db_to_value', 'upsert_data', 'upsert_selector', 'get_sfield_columns', 'filter_to_sfield_dict',
|
|
120
122
|
'SETTINGS', 'add_missing_enum_values', 'ban_token', 'TokenBanlist', 'is_banned',
|
|
121
|
-
'get_lang', 'set_lang', 'Lang', 'localized_col', 'I18nMixin', 'add_missing_columns'
|
|
123
|
+
'get_lang', 'set_lang', 'Lang', 'localized_col', 'I18nMixin', 'add_missing_columns',
|
|
124
|
+
'encrypt_value', 'decrypt_value']
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from cryptography.fernet import Fernet
|
|
2
|
+
|
|
3
|
+
from ecodev_core import SETTINGS
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
FERNET = Fernet(SETTINGS.fernet_key.encode())
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def encrypt_value(value):
|
|
10
|
+
"""
|
|
11
|
+
Encrypt a value using Fernet symmetric encryption.
|
|
12
|
+
|
|
13
|
+
Args:
|
|
14
|
+
value: Value to encrypt (will be converted to string)
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
Encrypted bytes
|
|
18
|
+
"""
|
|
19
|
+
return FERNET.encrypt(str(value).encode())
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def decrypt_value(encrypted):
|
|
23
|
+
"""
|
|
24
|
+
Decrypt an encrypted value and convert to float.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
encrypted: Encrypted bytes to decrypt
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
Decrypted value as float
|
|
31
|
+
"""
|
|
32
|
+
return float(FERNET.decrypt(encrypted).decode())
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|