elody 0.0.221__py3-none-any.whl → 0.0.222__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.
@@ -1,6 +1,7 @@
1
1
  from abc import ABC, abstractmethod
2
2
  from copy import deepcopy
3
3
  from elody.migration.base_object_migrator import BaseObjectMigrator
4
+ from os import getenv
4
5
 
5
6
 
6
7
  class BaseObjectConfiguration(ABC):
@@ -95,6 +96,16 @@ class BaseObjectConfiguration(ABC):
95
96
  except Exception:
96
97
  return None
97
98
 
99
+ def _is_request_from_internal_service(self):
100
+ try:
101
+ from flask import request # pyright: ignore
102
+
103
+ return request.headers.get("Authorization", "").removeprefix(
104
+ "Bearer "
105
+ ) == getenv("STATIC_JWT")
106
+ except Exception:
107
+ return False
108
+
98
109
  def _sanitize_document(self, *, document, **kwargs):
99
110
  sanitized_document = {}
100
111
  document_deepcopy = deepcopy(document)
@@ -177,6 +177,9 @@ class ElodyConfiguration(BaseObjectConfiguration):
177
177
  return sanitized_document
178
178
 
179
179
  def __patch_document_audit_info(self, crud, document, timestamp, audit_override):
180
+ if self._is_request_from_internal_service():
181
+ return document
182
+
180
183
  document.update({f"date_{crud}d": timestamp})
181
184
  if email := self._get_user_context_id():
182
185
  label = f"{crud}d_by" if crud == "create" else "last_editor"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: elody
3
- Version: 0.0.221
3
+ Version: 0.0.222
4
4
  Summary: elody SDK for Python
5
5
  Author-email: Inuits <developers@inuits.eu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -12,8 +12,8 @@ elody/validator.py,sha256=G7Ya538EJHCFzOxEri2OcFMabfLBCtTKxuf4os_KuNw,260
12
12
  elody/migration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  elody/migration/base_object_migrator.py,sha256=n8uvgGfjEUy60G47RD7Y-oxp1vHLOauwPMDl87LcxtU,436
14
14
  elody/object_configurations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- elody/object_configurations/base_object_configuration.py,sha256=AqOE0hCbXQDOdKFnDa9dbi-A-GRTUAaBZUe6_g0-Dc0,7573
16
- elody/object_configurations/elody_configuration.py,sha256=T_gyQykQWC1wdGTwQ9DujmumG8uqgQlH0vbZKmxtpfw,11049
15
+ elody/object_configurations/base_object_configuration.py,sha256=4lk6BmhRSYxwuD2qqGfE8d9H9ak7iwoOM5gqw7EntTI,7905
16
+ elody/object_configurations/elody_configuration.py,sha256=Gf_59TfqjvlkufnkfzTtE4p8cBly613ieJ5beemtv00,11131
17
17
  elody/object_configurations/job_configuration.py,sha256=T6QI2wE-u7ZcNpYE5XjmrCzIJglyKUGJsifaTn0WGyg,7512
18
18
  elody/object_configurations/saved_search_configuration.py,sha256=ddOry4EqYOeEKRF7q2M_fHoqZv8DXpQjFq8VaZ7jhVI,732
19
19
  elody/policies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -35,13 +35,13 @@ elody/policies/authorization/mediafile_derivatives_policy.py,sha256=OwNpbS8i7-Lz
35
35
  elody/policies/authorization/mediafile_download_policy.py,sha256=XMsKavBucmTh4W1kWOzpFWxJ_ZXgHVK1RS7JB4HjtQo,1979
36
36
  elody/policies/authorization/multi_tenant_policy.py,sha256=SA9H7SBjzuh8mY3gYN7pDG8TV7hdI3GEUtNeiZeNL3M,3164
37
37
  elody/policies/authorization/tenant_request_policy.py,sha256=dEgblwRAqwWVcE-O7Jn8hVL3OnwDlQhDEOcPlcElBrk,1185
38
- elody-0.0.221.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
38
+ elody-0.0.222.dist-info/licenses/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
39
39
  tests/__init_.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
40
  tests/data.py,sha256=Q3oxduf-E3m-Z5G_p3fcs8jVy6g10I7zXKL1m94UVMI,2906
41
41
  tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
42
42
  tests/unit/test_csv.py,sha256=NQaOhehfQ4GuXku0Y1SA8DYjJeqqidbF50zEHAi8RZA,15923
43
43
  tests/unit/test_utils.py,sha256=g63szcEZyHhCOtrW4BnNbcgVca3oYPIOLjBdIzNwwN0,8784
44
- elody-0.0.221.dist-info/METADATA,sha256=uIEM5H42sBDimKD8UkKIatHIvjiFiNOIWfJ95lDEDVQ,23358
45
- elody-0.0.221.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
- elody-0.0.221.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
47
- elody-0.0.221.dist-info/RECORD,,
44
+ elody-0.0.222.dist-info/METADATA,sha256=N8xZrzgeNCwpRTo8WLIlxfFE9ZYEegaEJIloyTDXlHw,23358
45
+ elody-0.0.222.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
46
+ elody-0.0.222.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
47
+ elody-0.0.222.dist-info/RECORD,,