edri 2025.10.2rc1__py3-none-any.whl → 2025.11.1rc1__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.
@@ -486,7 +486,7 @@ class HTTPHandler[T: HTTPResponseDirective](BaseHandler, ABC):
486
486
 
487
487
  async def parse_body(self, event: Type[Event]) -> None:
488
488
  if not self.headers["content-type"]:
489
- return
489
+ self.headers["content-type"] = ["application/octet-stream"]
490
490
 
491
491
  if event._is_file_only is None:
492
492
  while self.body.tell() < MAX_BODY_SIZE:
@@ -1,5 +1,6 @@
1
1
  from datetime import date, datetime, time
2
2
  from re import Pattern
3
+ from typing import Self
3
4
 
4
5
 
5
6
  class StringValidation(str):
@@ -11,7 +12,7 @@ class StringValidation(str):
11
12
  - Minimum and maximum allowed lengths.
12
13
 
13
14
  Args:
14
- data (str): The input string to validate.
15
+ value (str): The input string to validate.
15
16
  maximum_length (int, optional): Maximum allowed length of the string.
16
17
  minimum_length (int, optional): Minimum required length of the string.
17
18
  regex (Pattern, optional): A compiled regex pattern the string must match.
@@ -27,20 +28,26 @@ class StringValidation(str):
27
28
  def __new__(cls, value, /, *,
28
29
  maximum_length: int = None,
29
30
  minimum_length: int = None,
30
- regex: Pattern | None = None,
31
- ):
31
+ regex: Pattern[str] | None = None,
32
+ ) -> Self:
32
33
 
33
34
  value = super().__new__(cls, value)
34
35
  if regex is not None:
35
- if not regex.match(value):
36
- raise ValueError(f"Invalid data provided. Data '{value}' not match pattern '{regex.pattern}'")
36
+ if not regex.fullmatch(value):
37
+ raise ValueError(
38
+ f"Invalid data provided. Data '{cls.safe_val(value)}' does not match pattern '{regex.pattern}'")
37
39
  if minimum_length is not None and len(value) < minimum_length:
38
- raise ValueError(f"Invalid data provided. Data '{value}' is too short")
40
+ raise ValueError(f"Invalid data provided. Data '{cls.safe_val(value)}' is too short")
39
41
  if maximum_length is not None and len(value) > maximum_length:
40
- raise ValueError(f"Invalid data provided. Data '{value}' is too long")
42
+ raise ValueError(f"Invalid data provided. Data '{cls.safe_val(value)}' is too long")
41
43
 
42
44
  return value
43
45
 
46
+ @staticmethod
47
+ def safe_val(v, max_len=20):
48
+ """Return truncated display string, not full content."""
49
+ return (v[:max_len] + "…") if len(v) > max_len else v
50
+
44
51
 
45
52
  class IntegerValidation(int):
46
53
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: edri
3
- Version: 2025.10.2rc1
3
+ Version: 2025.11.1rc1
4
4
  Summary: Event Driven Routing Infrastructure
5
5
  Author: Marek Olšan
6
6
  Author-email: marek.olsan@gmail.com
@@ -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=iuVXOmWeCB1ZgLIpq_1QCtAvB7QL1NhPdx064NC2b50,7529
24
24
  edri/api/handlers/html_handler.py,sha256=OprcTg1IQDI7eBK-_oHqA60P1H30LA9xIQpD7iV-Neg,7464
25
- edri/api/handlers/http_handler.py,sha256=_UizS2CTeHMzpWdVT7hU_SRmij6k5P0C9xuYHegJI88,35514
25
+ edri/api/handlers/http_handler.py,sha256=Il16LpIMjSreUXohn4c2R79Bx9mKqz7a08LfTVvPwws,35567
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
@@ -112,7 +112,7 @@ edri/utility/queue.py,sha256=xBbeu1DT3Krdxni0YABk7gDZ5fLQL9eX-H3U-1jSqag,3628
112
112
  edri/utility/shared_memory_pipe.py,sha256=kmtd-1999s-cUVThxXVtw4N-rp_WgrHtl-h4hhEliXA,6396
113
113
  edri/utility/storage.py,sha256=AbZwtj8py0OBy3dM5C0fJ97uV88TERZO79heEmyE9Yk,3781
114
114
  edri/utility/transformation.py,sha256=4FeRNav-ifxuqgwq9ys3G5WtMzUAC3_2B3tnFhMENho,1450
115
- edri/utility/validation.py,sha256=oPyI97-3kxeT10LE-IJ5_9MGa6utkGYiMFvLX87OS3A,7934
115
+ edri/utility/validation.py,sha256=bLFgfBLc_nu8tK3-imS2pLdd_IOh-uR7CHjV_r6QodY,8225
116
116
  edri/utility/watcher.py,sha256=9nwU-h6B_QCd02-z-2-Hvf6huro8B9yVcZAepoFtXQ4,4623
117
117
  edri/utility/manager/__init__.py,sha256=bNyqET60wyq-QFmNwk52UKRweK5lYTDH_TF2UgS6enk,73
118
118
  edri/utility/manager/scheduler.py,sha256=3wRPph-FGNrVMN3TG7SvZ_PDW8mNK7UdM3PnjI_QTH8,11624
@@ -156,7 +156,7 @@ tests/utility/test_validation.py,sha256=OEM9hGzlFoSvZdwf5_pyH-Xg9ISxw0QJFbgMaDP8
156
156
  tests/utility/manager/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
157
157
  tests/utility/manager/test_scheduler.py,sha256=sROffYvSOaWsYQxQGTy6l9Mn_qeNPRmJoXLVPKU3XNY,9153
158
158
  tests/utility/manager/test_store.py,sha256=xlo1JUsPLIhPJyQn7AXldAgWDo_O8ba2ns25TEaaGdQ,2821
159
- edri-2025.10.2rc1.dist-info/METADATA,sha256=oy8LSYi-cTCMX1WBwU2GWIBfDwU4iCC09aCAVzhuNrI,8346
160
- edri-2025.10.2rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
161
- edri-2025.10.2rc1.dist-info/top_level.txt,sha256=himES6JgPlx4Zt8aDrQEj2fxAd7IDD6MBOsiNZkzKHQ,11
162
- edri-2025.10.2rc1.dist-info/RECORD,,
159
+ edri-2025.11.1rc1.dist-info/METADATA,sha256=jmz9RW0qiyHSTTzFrkG-t27E81VAwjajriXyxgQO7G0,8346
160
+ edri-2025.11.1rc1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
161
+ edri-2025.11.1rc1.dist-info/top_level.txt,sha256=himES6JgPlx4Zt8aDrQEj2fxAd7IDD6MBOsiNZkzKHQ,11
162
+ edri-2025.11.1rc1.dist-info/RECORD,,