ecodev-core 0.0.24__tar.gz → 0.0.26__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.24 → ecodev_core-0.0.26}/PKG-INFO +1 -1
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/__init__.py +2 -1
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/authentication.py +4 -9
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/pyproject.toml +1 -1
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/LICENSE.md +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/README.md +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/app_activity.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/app_rights.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/app_user.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/auth_configuration.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/backup.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/check_dependencies.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/custom_equal.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/db_connection.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/db_filters.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/db_insertion.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/db_retrieval.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/enum_utils.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/list_utils.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/logger.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/pandas_utils.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/permissions.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/pydantic_utils.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/read_write.py +0 -0
- {ecodev_core-0.0.24 → ecodev_core-0.0.26}/ecodev_core/safe_utils.py +0 -0
|
@@ -51,6 +51,7 @@ from ecodev_core.logger import log_critical
|
|
|
51
51
|
from ecodev_core.logger import logger_get
|
|
52
52
|
from ecodev_core.pandas_utils import get_excelfile
|
|
53
53
|
from ecodev_core.pandas_utils import get_value
|
|
54
|
+
from ecodev_core.pandas_utils import is_null
|
|
54
55
|
from ecodev_core.pandas_utils import jsonify_series
|
|
55
56
|
from ecodev_core.pandas_utils import pd_equals
|
|
56
57
|
from ecodev_core.pandas_utils import safe_drop_columns
|
|
@@ -83,4 +84,4 @@ __all__ = [
|
|
|
83
84
|
'generic_insertion', 'custom_equal', 'is_authorized_user', 'get_method', 'AppActivity',
|
|
84
85
|
'fastapi_monitor', 'dash_monitor', 'is_monitoring_user', 'get_recent_activities', 'select_user',
|
|
85
86
|
'get_access_token', 'safe_get_user', 'backup', 'group_by', 'get_excelfile', 'upsert_new_user',
|
|
86
|
-
'datify', 'safe_drop_columns', 'get_value']
|
|
87
|
+
'datify', 'safe_drop_columns', 'get_value', 'is_null']
|
|
@@ -152,14 +152,12 @@ def attempt_to_log(user: str,
|
|
|
152
152
|
'token_type': 'bearer'}
|
|
153
153
|
|
|
154
154
|
|
|
155
|
-
def is_authorized_user(token: str = Depends(SCHEME)
|
|
156
|
-
tfa_value: Optional[str] = None,
|
|
157
|
-
tfa_check: bool = False) -> bool:
|
|
155
|
+
def is_authorized_user(token: str = Depends(SCHEME)) -> bool:
|
|
158
156
|
"""
|
|
159
157
|
Check if the passed token corresponds to an authorized user
|
|
160
158
|
"""
|
|
161
159
|
try:
|
|
162
|
-
return get_current_user(token
|
|
160
|
+
return get_current_user(token) is not None
|
|
163
161
|
except Exception:
|
|
164
162
|
return False
|
|
165
163
|
|
|
@@ -198,14 +196,11 @@ def get_current_user(token: str,
|
|
|
198
196
|
return session.exec(select(AppUser).where(col(AppUser.id) == token.id)).first()
|
|
199
197
|
|
|
200
198
|
|
|
201
|
-
def is_admin_user(token: str = Depends(SCHEME)
|
|
202
|
-
tfa_value: Optional[str] = None,
|
|
203
|
-
tfa_check: bool = False) -> AppUser:
|
|
199
|
+
def is_admin_user(token: str = Depends(SCHEME)) -> AppUser:
|
|
204
200
|
"""
|
|
205
201
|
Retrieves (if it exists) the admin (meaning who has valid credentials) user from the db
|
|
206
202
|
"""
|
|
207
|
-
if (user := get_current_user(
|
|
208
|
-
token, tfa_value, tfa_check)) and user.permission == Permission.ADMIN:
|
|
203
|
+
if (user := get_current_user(token)) and user.permission == Permission.ADMIN:
|
|
209
204
|
return user
|
|
210
205
|
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail=ADMIN_ERROR,
|
|
211
206
|
headers={'WWW-Authenticate': 'Bearer'})
|
|
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
|