elody 0.0.184__tar.gz → 0.0.187__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.
- {elody-0.0.184 → elody-0.0.187}/PKG-INFO +1 -1
- {elody-0.0.184 → elody-0.0.187}/pyproject.toml +1 -1
- {elody-0.0.184 → elody-0.0.187}/src/elody/job.py +2 -1
- {elody-0.0.184 → elody-0.0.187}/src/elody/object_configurations/elody_configuration.py +2 -2
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/generic_object_detail_policy.py +7 -1
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/permission_handler.py +16 -1
- {elody-0.0.184 → elody-0.0.187}/src/elody.egg-info/PKG-INFO +1 -1
- {elody-0.0.184 → elody-0.0.187}/LICENSE +0 -0
- {elody-0.0.184 → elody-0.0.187}/README.md +0 -0
- {elody-0.0.184 → elody-0.0.187}/setup.cfg +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/__init__.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/__init__.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/client.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/csv.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/error_codes.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/exceptions.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/loader.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/migration/__init__.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/migration/base_object_migrator.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/object_configurations/__init__.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/object_configurations/base_object_configuration.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/object_configurations/job_configuration.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/__init__.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authentication/__init__.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authentication/base_user_tenant_validation_policy.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authentication/multi_tenant_policy.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/__init__.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/filter_generic_objects_policy.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/filter_generic_objects_policy_v2.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/generic_object_mediafiles_policy.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/generic_object_metadata_policy.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/generic_object_relations_policy.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/generic_object_request_policy.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/generic_object_request_policy_v2.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/mediafile_derivatives_policy.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/mediafile_download_policy.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/multi_tenant_policy.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/tenant_request_policy.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/helpers.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/policies/tenant_id_resolver.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/schemas.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/util.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody/validator.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody.egg-info/SOURCES.txt +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody.egg-info/dependency_links.txt +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody.egg-info/requires.txt +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/elody.egg-info/top_level.txt +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/tests/__init_.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/tests/data.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/tests/unit/__init__.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/tests/unit/test_csv.py +0 -0
- {elody-0.0.184 → elody-0.0.187}/src/tests/unit/test_utils.py +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from elody.object_configurations.job_configuration import JobConfiguration
|
|
2
|
-
|
|
2
|
+
from datetime import datetime, timezone
|
|
3
3
|
|
|
4
4
|
_config = JobConfiguration()
|
|
5
5
|
_create = _config.crud()["creator"]
|
|
@@ -88,6 +88,7 @@ def start_job(
|
|
|
88
88
|
document = {
|
|
89
89
|
"id": id,
|
|
90
90
|
"patch": {
|
|
91
|
+
"started_at": datetime.now(timezone.utc),
|
|
91
92
|
"metadata": [{"key": "status", "value": "running"}],
|
|
92
93
|
"relations": ([] if id_of_document_job_was_initiated_for else []),
|
|
93
94
|
},
|
|
@@ -160,8 +160,8 @@ class ElodyConfiguration(BaseObjectConfiguration):
|
|
|
160
160
|
}
|
|
161
161
|
)
|
|
162
162
|
sort.update({key: order})
|
|
163
|
-
|
|
164
|
-
pipeline = [{"$sort": sort}]
|
|
163
|
+
pipeline = []
|
|
165
164
|
if addFields:
|
|
166
165
|
pipeline.append({"$addFields": addFields})
|
|
166
|
+
pipeline.append({"$sort": sort})
|
|
167
167
|
return pipeline
|
{elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/generic_object_detail_policy.py
RENAMED
|
@@ -68,7 +68,13 @@ class GetRequestRules:
|
|
|
68
68
|
if request.method != "GET":
|
|
69
69
|
return None
|
|
70
70
|
|
|
71
|
-
return handle_single_item_request(
|
|
71
|
+
return handle_single_item_request(
|
|
72
|
+
user_context,
|
|
73
|
+
item,
|
|
74
|
+
permissions,
|
|
75
|
+
"read",
|
|
76
|
+
key_to_check=request.args.get("key_to_check"),
|
|
77
|
+
)
|
|
72
78
|
|
|
73
79
|
|
|
74
80
|
class PutRequestRules:
|
|
@@ -49,7 +49,13 @@ def __replace_permission_placeholders(data, placeholder_key, placeholder_value):
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
def handle_single_item_request(
|
|
52
|
-
user_context: UserContext,
|
|
52
|
+
user_context: UserContext,
|
|
53
|
+
item,
|
|
54
|
+
permissions,
|
|
55
|
+
crud,
|
|
56
|
+
request_body: dict = {},
|
|
57
|
+
*,
|
|
58
|
+
key_to_check=None,
|
|
53
59
|
):
|
|
54
60
|
try:
|
|
55
61
|
item_in_storage_format, flat_item, object_lists, restrictions_schema = (
|
|
@@ -72,6 +78,7 @@ def handle_single_item_request(
|
|
|
72
78
|
crud,
|
|
73
79
|
object_lists,
|
|
74
80
|
flatten_dict(object_lists, request_body),
|
|
81
|
+
key_to_check=key_to_check,
|
|
75
82
|
)
|
|
76
83
|
except Exception as exception:
|
|
77
84
|
log.debug(
|
|
@@ -174,6 +181,8 @@ def __is_allowed_to_crud_item_keys(
|
|
|
174
181
|
crud,
|
|
175
182
|
object_lists,
|
|
176
183
|
flat_request_body: dict = {},
|
|
184
|
+
*,
|
|
185
|
+
key_to_check=None,
|
|
177
186
|
):
|
|
178
187
|
user_context.bag["restricted_keys"] = []
|
|
179
188
|
restrictions = restrictions_schema.get("key_restrictions", {})
|
|
@@ -201,12 +210,18 @@ def __is_allowed_to_crud_item_keys(
|
|
|
201
210
|
)
|
|
202
211
|
if element:
|
|
203
212
|
item_in_storage_format[info["key"]].remove(element)
|
|
213
|
+
if key_to_check and key_to_check == restricted_key:
|
|
214
|
+
user_context.bag["restricted_keys"].append(
|
|
215
|
+
restricted_key
|
|
216
|
+
)
|
|
204
217
|
break
|
|
205
218
|
else:
|
|
206
219
|
try:
|
|
207
220
|
del item_in_storage_format[keys_info[0]["key"]][
|
|
208
221
|
keys_info[1]["key"]
|
|
209
222
|
]
|
|
223
|
+
if key_to_check and key_to_check == restricted_key:
|
|
224
|
+
user_context.bag["restricted_keys"].append(restricted_key)
|
|
210
225
|
except KeyError:
|
|
211
226
|
pass
|
|
212
227
|
else:
|
|
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
|
{elody-0.0.184 → elody-0.0.187}/src/elody/object_configurations/base_object_configuration.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/filter_generic_objects_policy.py
RENAMED
|
File without changes
|
{elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/filter_generic_objects_policy_v2.py
RENAMED
|
File without changes
|
{elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/generic_object_mediafiles_policy.py
RENAMED
|
File without changes
|
{elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/generic_object_metadata_policy.py
RENAMED
|
File without changes
|
{elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/generic_object_relations_policy.py
RENAMED
|
File without changes
|
{elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/generic_object_request_policy.py
RENAMED
|
File without changes
|
{elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/generic_object_request_policy_v2.py
RENAMED
|
File without changes
|
{elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/mediafile_derivatives_policy.py
RENAMED
|
File without changes
|
{elody-0.0.184 → elody-0.0.187}/src/elody/policies/authorization/mediafile_download_policy.py
RENAMED
|
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
|