edri 2025.12.1rc1__py3-none-any.whl → 2025.12.1rc3__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.
@@ -17,7 +17,7 @@ from typing import Optional, Type, Tuple, Callable, Union, TypeVar, Never, get_a
17
17
  from edri.abstract.manager.worker import Worker
18
18
  from edri.abstract.worker import WorkerProcess
19
19
  from edri.api.dataclass.api_event import api_events
20
- from edri.config.setting import API_CACHE_CONTROL
20
+ from edri.config.setting import API_CACHE_CONTROL, API_CACHE_HEADERS
21
21
  from edri.dataclass.directive.http import NotModifiedResponseDirective, HeaderResponseDirective
22
22
  from edri.dataclass.event import Event
23
23
  from edri.dataclass.health_checker import Status
@@ -127,6 +127,9 @@ class ManagerBase(ABC, Process, metaclass=ManagerBaseMeta):
127
127
  self._store_get: Optional[Callable] = None
128
128
  self._exceptions: list[tuple[str, dict, Exception, str]] = []
129
129
  self._cache: Cache
130
+ self._cache_vary = "Accept,Accept-Encoding"
131
+ if API_CACHE_HEADERS:
132
+ self._cache_vary += f",{API_CACHE_HEADERS}"
130
133
 
131
134
  def _subscribe(self) -> None:
132
135
  """
@@ -645,6 +648,7 @@ class ManagerBase(ABC, Process, metaclass=ManagerBaseMeta):
645
648
  else:
646
649
  event.response.add_directive(HeaderResponseDirective(name="ETag", value=etag))
647
650
  event.response.add_directive(HeaderResponseDirective(name="Cache-Control", value=API_CACHE_CONTROL))
651
+ event.response.add_directive(HeaderResponseDirective(name="Vary", value=self._cache_vary))
648
652
  self.router_queue.put(event)
649
653
 
650
654
  def get_pipes(self) -> set[Connection]:
@@ -696,7 +700,7 @@ class ManagerBase(ABC, Process, metaclass=ManagerBaseMeta):
696
700
  self.logger.debug("Received event: %s", event)
697
701
  except EOFError as e:
698
702
  self.logger.error("Communication problems", exc_info=e)
699
- continue
703
+ return
700
704
  except OSError as e:
701
705
  self.logger.error("OS problems", exc_info=e)
702
706
  continue
@@ -32,7 +32,7 @@ from edri.dataclass.directive.base import InternalServerErrorResponseDirective,
32
32
  from edri.dataclass.directive.http import CookieResponseDirective, AccessDeniedResponseDirective, \
33
33
  NotFoundResponseDirective, \
34
34
  ConflictResponseDirective, HeaderResponseDirective, UnprocessableContentResponseDirective, \
35
- BadRequestResponseDirective, NotModifiedResponseDirective
35
+ BadRequestResponseDirective, NotModifiedResponseDirective, ServiceUnavailableResponseDirective
36
36
  from edri.dataclass.event import Event
37
37
  from edri.dataclass.injection import Injection
38
38
  from edri.utility import NormalizedDefaultDict
@@ -276,6 +276,9 @@ class HTTPHandler[T: HTTPResponseDirective](BaseHandler, ABC):
276
276
  },
277
277
  NotModifiedResponseDirective: {
278
278
  "status": HTTPStatus.NOT_MODIFIED,
279
+ },
280
+ ServiceUnavailableResponseDirective: {
281
+ "status": HTTPStatus.SERVICE_UNAVAILABLE,
279
282
  }
280
283
  }
281
284
 
edri/api/listener.py CHANGED
@@ -147,7 +147,7 @@ class Listener(Process):
147
147
  if isinstance(handler, HTMLHandler):
148
148
  if await handler.response_assets(scope["path"]):
149
149
  return
150
- self.logger.debug("Unknown url %s", scope["path"])
150
+ self.logger.warning("Unknown url %s", scope["path"])
151
151
  await handler.response_error(HTTPStatus.NOT_FOUND, {
152
152
  "reasons": [{
153
153
  "status_code": HTTPStatus.NOT_FOUND,
edri/config/setting.py CHANGED
@@ -15,11 +15,18 @@ ENVIRONMENT: Literal["development", "production"] = "production" if getenv("ENVI
15
15
 
16
16
  HEALTH_CHECK_TIMEOUT = int(getenv("EDRI_HEALTH_CHECK_TIMEOUT", 10))
17
17
  HEALTH_CHECK_FAILURE_LIMIT = int(getenv("EDRI_HEALTH_CHECK_FAILURE_LIMIT", 3))
18
+
19
+ CORS_ORIGINS = getenv("EDRI_CORS_ORIGINS")
20
+ CORS_HEADERS = getenv("EDRI_CORS_HEADERS")
21
+ CORS_CREDENTIALS = bool(getenv("EDRI_CORS_CREDENTIALS", False))
22
+ CORS_MAX_AGE = getenv("EDRI_CORS_MAX_AGE", None)
23
+
18
24
  TIMEZONE = timezone(getenv("EDRI_TIMEZONE", "UTC"))
19
25
  API_RESPONSE_TIMEOUT = int(getenv("EDRI_API_RESPONSE_TIMEOUT", 60))
20
26
  API_RESPONSE_WRAPPED = getenv_bool("EDRI_API_RESPONSE_WRAPPED", True)
21
27
  API_RESPONSE_TIMING = getenv_bool("EDRI_API_RESPONSE_TIMING", ENVIRONMENT == 'development')
22
28
  API_CACHE_CONTROL = getenv("EDRI_API_CACHE_CONTROL", "max-age=0, must-revalidate")
29
+ API_CACHE_HEADERS = getenv("EDRI_API_CACHE_HEADERS", CORS_HEADERS)
23
30
 
24
31
  SWITCH_KEY_LENGTH = int(getenv("EDRI_SWITCH_KEY_LENGTH ", 8))
25
32
  SWITCH_HOST = getenv("EDRI_SWITCH_HOST", "localhost")
@@ -41,7 +48,4 @@ ASSETS_PATH = getenv("EDRI_ASSETS_PATH", "assets")
41
48
  MAX_BODY_SIZE = int(getenv("EDRI_MAX_BODY_SIZE", 4096 * 1024))
42
49
  CHUNK_SIZE = int(getenv("EDRI_CHUNK_SIZE", 256 * 1024))
43
50
 
44
- CORS_ORIGINS = getenv("EDRI_CORS_ORIGINS")
45
- CORS_HEADERS = getenv("EDRI_CORS_HEADERS")
46
- CORS_CREDENTIALS = bool(getenv("EDRI_CORS_CREDENTIALS", False))
47
- CORS_MAX_AGE = getenv("EDRI_CORS_MAX_AGE", None)
51
+
@@ -69,3 +69,7 @@ class BadRequestResponseDirective(HTTPResponseDirective):
69
69
  @dataclass
70
70
  class NotModifiedResponseDirective(HTTPResponseDirective):
71
71
  pass
72
+
73
+ @dataclass
74
+ class ServiceUnavailableResponseDirective(HTTPResponseDirective):
75
+ message: str | None = None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edri
3
- Version: 2025.12.1rc1
3
+ Version: 2025.12.1rc3
4
4
  Summary: Event Driven Routing Infrastructure
5
5
  Author: Marek Olšan
6
6
  Author-email: marek.olsan@gmail.com
@@ -1,7 +1,7 @@
1
1
  edri/__init__.py,sha256=bBVs4ynkUzMRudKZyuRScpPmUZTIL1LDfIytZ_L7oKE,6257
2
2
  edri/abstract/__init__.py,sha256=C6ew041GNVcQlfkE77kHeZ9Ts1rIaWRqqh3bKz7Kb1E,488
3
3
  edri/abstract/manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- edri/abstract/manager/manager_base.py,sha256=jzz1C9CoK5g0eyMSFynOSyTdu9LFuU_WdmV0Q2uraUU,42097
4
+ edri/abstract/manager/manager_base.py,sha256=UADyYf5RIIX6Ge8bis7RPEaoTQpVXdzPhFHRrQF_Usg,42371
5
5
  edri/abstract/manager/manager_priority_base.py,sha256=1bUGsIr6MUrCNsJsLNF_tYaiFDX5t8vK2794vdZumQo,8219
6
6
  edri/abstract/manager/worker.py,sha256=xMJMDQtcH-j8s37cUoMsF_ZrWS4elbU7vnjdKfAv0gM,403
7
7
  edri/abstract/worker/__init__.py,sha256=qcCF2MnReil9G9ojrr7I3hjMks-1tsap4yrYH5Vr07Q,164
@@ -10,7 +10,7 @@ edri/abstract/worker/worker_process.py,sha256=QiNxOuwkMds0sV2MBLyp7bjrovm5xColC7
10
10
  edri/abstract/worker/worker_thread.py,sha256=xoMPuDn-hAkWk6kFY3Xf8mxOVP__5t7-x7f-b396-8M,2176
11
11
  edri/api/__init__.py,sha256=ZDxCpHKFGajJ1RwDpV7CzxLDUaKpozJRfOCv1OPv5ZY,142
12
12
  edri/api/broker.py,sha256=I3z_bKbcTDnKXk82yteGEQmuxpqHgp5KrhQaJmk3US0,37258
13
- edri/api/listener.py,sha256=B2RgqQmCkcJOYWtTlYkyb2H7xCM233iNfsa5LG4qZZ0,20401
13
+ edri/api/listener.py,sha256=8ffX8ntJ5XbHAqT5hM38teMRsd1cBjcJ7PJAMa4Ez7c,20403
14
14
  edri/api/middleware.py,sha256=6_x55swthVDczT-fu_1ufY1cDsHTZ04jMx6J6xfjbsM,5483
15
15
  edri/api/dataclass/__init__.py,sha256=8Y-zcaJtzMdALnNG7M9jsCaB1qAJKM8Ld3h9MDajYjA,292
16
16
  edri/api/dataclass/api_event.py,sha256=08edshexI9FxdebPIgTQMSQ4fEtGpAa3K_VYCmN1jFs,6587
@@ -22,7 +22,7 @@ edri/api/extensions/url_prefix.py,sha256=kNI6g5ZlW0w-J_IMacYLco1EQvmTtMJyEkN6-SK
22
22
  edri/api/handlers/__init__.py,sha256=MI6OGDf1rM8jf_uCKK_JYeOGMts62CNy10BwwNlG0Tk,200
23
23
  edri/api/handlers/base_handler.py,sha256=aZN95tWX7hkmJ3D401c-JPfF2azjH0t1jJy_zsjPc_4,13113
24
24
  edri/api/handlers/html_handler.py,sha256=OprcTg1IQDI7eBK-_oHqA60P1H30LA9xIQpD7iV-Neg,7464
25
- edri/api/handlers/http_handler.py,sha256=oTyVxbA0xgOLAyt2n4E5dRXrnfdVRpS8-GrXAe5SSeY,36219
25
+ edri/api/handlers/http_handler.py,sha256=AC-8oi4ez5LcNfCd-wrkGSc9fLo2fBNw51yEg8MDiPs,36368
26
26
  edri/api/handlers/rest_handler.py,sha256=GAG5lVTsRMCf9IUmYb_pokxyPcOfbnKZ2p3jxfy_-Dw,3300
27
27
  edri/api/handlers/websocket_handler.py,sha256=Dh2XannDuW0eFj5CEzf3owlGc1VTyQ8ehjpxYRrCYW8,8144
28
28
  edri/api/static_pages/documentation.j2,sha256=Fe7KLsbqp9P-pQYqG2z8rbhhGVDDFf3m6SQ2mc3PFG4,8934
@@ -32,7 +32,7 @@ edri/api/static_pages/status_400.j2,sha256=ArSvsNy9GG-Gbqt6fbRSqETmGV4aTJa3Zgwwt
32
32
  edri/api/static_pages/status_500.j2,sha256=39T6VeU_7m-6-RJyVsS48dD56Hp3ZcOeVC397T8GlsY,1468
33
33
  edri/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
34
34
  edri/config/constant.py,sha256=5angk0yL3LlMWShzt0D7TflK5d2yLj2HDWoVqCqSLbY,783
35
- edri/config/setting.py,sha256=f4mS9-KmWTlOgFYt5N7E509jM_gRqJ0MlOwS_C_pPPI,1995
35
+ edri/config/setting.py,sha256=kzii_wmx4C8-uE_TNfBvRlJMkpJrvVLXvZam-2pm3eE,2065
36
36
  edri/dataclass/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
37
  edri/dataclass/event.py,sha256=3XwbS_8Nst0V5D6vQ0FYhrX5rx6KfLGd3-9ba71xUMQ,9866
38
38
  edri/dataclass/health_checker.py,sha256=62H5wGUtOhql3acPwFtMhpGKPUTmFwWQ4hlqIn6tjfo,1784
@@ -41,7 +41,7 @@ edri/dataclass/response.py,sha256=VBMmVdna1IOKC5YGBXor6AayYOoiEYb9xx_RZ3bpKnw,38
41
41
  edri/dataclass/directive/__init__.py,sha256=nfvsh1BmxhACW7Q8gnwy7y3l3_cI1P0k2WP0jV5RJhI,608
42
42
  edri/dataclass/directive/base.py,sha256=2ghQpv1bGcNHYEMA0nyWGumIplXBzj9cPQ34aJ7uVr0,296
43
43
  edri/dataclass/directive/html.py,sha256=UCuwksxt_Q9b1wha1DjEygJWAyq2Hdnir5zG9lGi8as,946
44
- edri/dataclass/directive/http.py,sha256=6Y4LYlERcddg4UXVCFG3ry6PUwMpS1fAGL-WEM_1A3c,2616
44
+ edri/dataclass/directive/http.py,sha256=Kboiv2-tTluzvUkGJTxL9Hx9Hxa_dEoP5bY6JppQ6LM,2725
45
45
  edri/events/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
46
  edri/events/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  edri/events/api/client/__init__.py,sha256=6q7CJ4eLMAuz_EFIs7us-xDXudy0Z5DIHd0YCVtTeuo,170
@@ -157,7 +157,7 @@ tests/utility/test_validation.py,sha256=wZcXjLrj3JheVLKnYKkkYfyC8CCpHVAw9Jn_uDnu
157
157
  tests/utility/manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
158
158
  tests/utility/manager/test_scheduler.py,sha256=sROffYvSOaWsYQxQGTy6l9Mn_qeNPRmJoXLVPKU3XNY,9153
159
159
  tests/utility/manager/test_store.py,sha256=xlo1JUsPLIhPJyQn7AXldAgWDo_O8ba2ns25TEaaGdQ,2821
160
- edri-2025.12.1rc1.dist-info/METADATA,sha256=7cDoLUgm5GGkhfQcpY1FLw14TpnrQmPC1wNk-YGeugU,8374
161
- edri-2025.12.1rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
162
- edri-2025.12.1rc1.dist-info/top_level.txt,sha256=himES6JgPlx4Zt8aDrQEj2fxAd7IDD6MBOsiNZkzKHQ,11
163
- edri-2025.12.1rc1.dist-info/RECORD,,
160
+ edri-2025.12.1rc3.dist-info/METADATA,sha256=nHxS9JeF5FBAaC0Y_gRo7Y64axxn9wemd1lo7baJrxI,8374
161
+ edri-2025.12.1rc3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
162
+ edri-2025.12.1rc3.dist-info/top_level.txt,sha256=himES6JgPlx4Zt8aDrQEj2fxAd7IDD6MBOsiNZkzKHQ,11
163
+ edri-2025.12.1rc3.dist-info/RECORD,,