elody 0.0.157__py3-none-any.whl → 0.0.158__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,7 +1,6 @@
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 policy_factory import get_user_context # pyright: ignore
5
4
 
6
5
 
7
6
  class BaseObjectConfiguration(ABC):
@@ -38,6 +37,8 @@ class BaseObjectConfiguration(ABC):
38
37
  "schema": f"{flat_document.get('schema.type')}:{flat_document.get('schema.version')}",
39
38
  }
40
39
  try:
40
+ from policy_factory import get_user_context # pyright: ignore
41
+
41
42
  user_context = get_user_context()
42
43
  info_labels["http_method"] = user_context.bag.get("http_method")
43
44
  info_labels["requested_endpoint"] = user_context.bag.get(
@@ -86,6 +87,8 @@ class BaseObjectConfiguration(ABC):
86
87
 
87
88
  def _get_user_context_id(self):
88
89
  try:
90
+ from policy_factory import get_user_context # pyright: ignore
91
+
89
92
  return get_user_context().id
90
93
  except Exception:
91
94
  return None
@@ -106,6 +109,8 @@ class BaseObjectConfiguration(ABC):
106
109
 
107
110
  def _should_create_history_object(self):
108
111
  try:
112
+ from policy_factory import get_user_context # pyright: ignore
113
+
109
114
  get_user_context()
110
115
  return bool(self.crud().get("collection_history"))
111
116
  except Exception:
@@ -28,6 +28,12 @@ class JobConfiguration(ElodyConfiguration):
28
28
  def validation(self):
29
29
  return super().validation()
30
30
 
31
+ def _creator(self, post_body, *, get_user_context={}, **_):
32
+ document = super()._creator(post_body)
33
+ if email := get_user_context().email:
34
+ document["computed_values"]["created_by"] = email
35
+ return document
36
+
31
37
  def _post_crud_hook(self, *, crud, document, get_rabbit, **kwargs):
32
38
  if crud == "create":
33
39
  send_cloudevent(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: elody
3
- Version: 0.0.157
3
+ Version: 0.0.158
4
4
  Summary: elody SDK for Python
5
5
  Author-email: Inuits <developers@inuits.eu>
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -12,9 +12,9 @@ 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=2yL8cCgWyT9lwTrpwjL_6TOYynWXRj6XdaHcCGC4RPM,6373
15
+ elody/object_configurations/base_object_configuration.py,sha256=L8K2AW-A3Bo4_Q_jl3S4hnwEGuZo3XmJH5Izditf6CM,6538
16
16
  elody/object_configurations/elody_configuration.py,sha256=Bp3OSHBHuyPs-ubIULzl9wqZd3akYD2idh3mhYo7zu0,5339
17
- elody/object_configurations/job_configuration.py,sha256=FagGQ7WBAcRHTeftezGOa7ykuYQvMB2GKeri80GkcMw,1813
17
+ elody/object_configurations/job_configuration.py,sha256=simi4TBiZ5cQePlzFHAd-C-khViWN9VUbAOKq9FYwk8,2057
18
18
  elody/policies/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  elody/policies/helpers.py,sha256=AV3wtvthJafW6ueEYGxggB5kk5knWTWzh3zq29Y1-ws,1434
20
20
  elody/policies/permission_handler.py,sha256=1aXA_xfRxdTfHZY5xRwQqJp5pjSzBrhko4eGRT38WLQ,9505
@@ -38,8 +38,8 @@ tests/data.py,sha256=Q3oxduf-E3m-Z5G_p3fcs8jVy6g10I7zXKL1m94UVMI,2906
38
38
  tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  tests/unit/test_csv.py,sha256=NQaOhehfQ4GuXku0Y1SA8DYjJeqqidbF50zEHAi8RZA,15923
40
40
  tests/unit/test_utils.py,sha256=g63szcEZyHhCOtrW4BnNbcgVca3oYPIOLjBdIzNwwN0,8784
41
- elody-0.0.157.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
42
- elody-0.0.157.dist-info/METADATA,sha256=ZI5G47P1QM9FsrLjWu7b16W7htJ4B7wxFUptsUHNAy4,23283
43
- elody-0.0.157.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
44
- elody-0.0.157.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
45
- elody-0.0.157.dist-info/RECORD,,
41
+ elody-0.0.158.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
42
+ elody-0.0.158.dist-info/METADATA,sha256=aGFDMi4tnUeUA1bh3x1xuUgLQEHM5hSl240-xroWCng,23283
43
+ elody-0.0.158.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
44
+ elody-0.0.158.dist-info/top_level.txt,sha256=E0mImupLj0KmtUUCXRYEoLDRaSkuiGaOIIseAa0oQ-M,21
45
+ elody-0.0.158.dist-info/RECORD,,