orionis 0.421.0__py3-none-any.whl → 0.422.0__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,6 @@
1
1
  from enum import Enum
2
2
 
3
- class EnvCastType(Enum):
3
+ class EnvironmentValueType(Enum):
4
4
  """
5
5
  Enum representing supported environment variable cast types.
6
6
 
@@ -31,12 +31,13 @@ class EnvCastType(Enum):
31
31
  An enumeration member representing the desired cast type.
32
32
  """
33
33
 
34
- PATH = 'path' # Represents a file system path
35
- STR = 'str' # Represents a string type
36
- INT = 'int' # Represents an integer type
37
- FLOAT = 'float' # Represents a floating-point type
38
- BOOL = 'bool' # Represents a boolean type
39
- LIST = 'list' # Represents a list type
40
- DICT = 'dict' # Represents a dictionary type
41
- TUPLE = 'tuple' # Represents a tuple type
42
- SET = 'set' # Represents a set type
34
+ BASE64 = 'base64' # Represents a base64 encoded type
35
+ PATH = 'path' # Represents a file system path
36
+ STR = 'str' # Represents a string type
37
+ INT = 'int' # Represents an integer type
38
+ FLOAT = 'float' # Represents a floating-point type
39
+ BOOL = 'bool' # Represents a boolean type
40
+ LIST = 'list' # Represents a list type
41
+ DICT = 'dict' # Represents a dictionary type
42
+ TUPLE = 'tuple' # Represents a tuple type
43
+ SET = 'set' # Represents a set type
@@ -1,5 +1,4 @@
1
1
  import os
2
- import base64
3
2
 
4
3
  class SecureKeyGenerator:
5
4
  """
@@ -14,24 +13,17 @@ class SecureKeyGenerator:
14
13
  @staticmethod
15
14
  def generate() -> str:
16
15
  """
17
- Generates a secure random key and encodes it in base64 format.
16
+ Generates a cryptographically secure random key and encodes it in hexadecimal format.
18
17
 
19
- This method creates a cryptographically secure random key of 32 bytes,
20
- encodes it using base64 encoding, and returns the result as a string
21
- prefixed with 'base64:'.
18
+ This method uses the operating system's cryptographic random number generator to
19
+ produce a 32-byte random value, which is then encoded as a hexadecimal string.
22
20
 
23
21
  Returns
24
22
  -------
25
23
  str
26
- A string in the format 'base64:<key>', where <key> is a base64-encoded
27
- representation of a securely generated 32-byte random key.
24
+ A 64-character hexadecimal string representing a 32-byte secure random key.
28
25
  """
29
26
 
30
- # Generate 32 bytes of cryptographically secure random data
31
- key = os.urandom(32)
32
-
33
- # Encode the random bytes using base64 and decode to a UTF-8 string
34
- encoded = base64.b64encode(key).decode('utf-8')
35
-
36
- # Return the key in the required format
37
- return f"base64:{encoded}"
27
+ # Generate 32 random bytes using a cryptographically secure RNG
28
+ # Encode the bytes as a hexadecimal string and return
29
+ return os.urandom(32).hex()
@@ -1,11 +1,11 @@
1
1
  import re
2
- from typing import Any, Union
3
- from orionis.services.environment.enums.cast_type import EnvCastType
2
+ from typing import Union
3
+ from orionis.services.environment.enums.value_type import EnvironmentValueType
4
4
  from orionis.services.environment.exceptions.value import OrionisEnvironmentValueError
5
5
 
6
6
  class __ValidateTypes:
7
7
 
8
- def __call__(self, value: Union[str, int, float, bool, list, dict, tuple, set], type_hint: str | EnvCastType = None) -> str:
8
+ def __call__(self, value: Union[str, int, float, bool, list, dict, tuple, set], type_hint: str | EnvironmentValueType = None) -> str:
9
9
 
10
10
  # Ensure the value is a valid type.
11
11
  if not isinstance(value, (str, int, float, bool, list, dict, tuple, set)):
@@ -14,23 +14,23 @@ class __ValidateTypes:
14
14
  )
15
15
 
16
16
  # If a type hint is provided, ensure it is valid.
17
- if type_hint and not isinstance(type_hint, (str, EnvCastType)):
17
+ if type_hint and not isinstance(type_hint, (str, EnvironmentValueType)):
18
18
  raise OrionisEnvironmentValueError(
19
- f"Type hint must be a string or EnvCastType, got {type(type_hint).__name__}."
19
+ f"Type hint must be a string or EnvironmentValueType, got {type(type_hint).__name__}."
20
20
  )
21
21
 
22
- # If type_hint is provided, convert it to a string if it's an EnvCastType.
22
+ # If type_hint is provided, convert it to a string if it's an EnvironmentValueType.
23
23
  if type_hint:
24
24
 
25
- # If type_hint is a string, convert it to EnvCastType if valid.
25
+ # If type_hint is a string, convert it to EnvironmentValueType if valid.
26
26
  if isinstance(type_hint, str):
27
27
  try:
28
- type_hint = EnvCastType[type_hint.upper()].value
28
+ type_hint = EnvironmentValueType[type_hint.upper()].value
29
29
  except KeyError:
30
30
  raise OrionisEnvironmentValueError(
31
- f"Invalid type hint: {type_hint}. Allowed types are {[e.value for e in EnvCastType]}"
31
+ f"Invalid type hint: {type_hint}. Allowed types are: {[e.value for e in EnvironmentValueType]}"
32
32
  )
33
- elif isinstance(type_hint, EnvCastType):
33
+ elif isinstance(type_hint, EnvironmentValueType):
34
34
  type_hint = type_hint.value
35
35
 
36
36
  # If no type hint is provided, use the type of the value.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: orionis
3
- Version: 0.421.0
3
+ Version: 0.422.0
4
4
  Summary: Orionis Framework – Elegant, Fast, and Powerful.
5
5
  Home-page: https://github.com/orionis-framework/framework
6
6
  Author: Raul Mauricio Uñate Castro
@@ -187,7 +187,7 @@ orionis/foundation/providers/progress_bar_provider.py,sha256=WW3grNgH-yV2meSSTeO
187
187
  orionis/foundation/providers/testing_provider.py,sha256=iJSN2RIChbYIL-1ue6vmPmDMCSrvERDkti4Er9MPiLA,1102
188
188
  orionis/foundation/providers/workers_provider.py,sha256=kiQjQRyUEyiBX2zcbF_KmqRgvc7Bvxsvg5oMtIvYniM,1075
189
189
  orionis/metadata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
190
- orionis/metadata/framework.py,sha256=Z_k5Op43n9NO2-4Tg4QDG9HjX9NK-Yi1CzWhnvOpkPg,4960
190
+ orionis/metadata/framework.py,sha256=TN0bWAwI_0NXglzLrTW6uOK-Oq8T4PwkGoWeuBrZsUM,4960
191
191
  orionis/metadata/package.py,sha256=tqLfBRo-w1j_GN4xvzUNFyweWYFS-qhSgAEc-AmCH1M,5452
192
192
  orionis/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
193
193
  orionis/services/asynchrony/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -199,26 +199,24 @@ orionis/services/asynchrony/exceptions/exception.py,sha256=yAVsjZ2lLAoFgNIiMcOtC
199
199
  orionis/services/environment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
200
200
  orionis/services/environment/env.py,sha256=vKx9zO2DpUK089fL17qxQ4X4tLYzN3exGAKg3d-rp3c,2272
201
201
  orionis/services/environment/contracts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
202
+ orionis/services/environment/contracts/caster.py,sha256=f5OsgsUCu-cqjmfWF6fqyKmXocHZGIjZgXw7F7g05yw,1211
202
203
  orionis/services/environment/contracts/env.py,sha256=7lezGxABAG63pEEvzAmHXgr9izBI6TCp05Trx_SRvc4,2054
203
- orionis/services/environment/contracts/types.py,sha256=n0USxUblz0Ofbo1ef0hnGHGkuGjSiWk-SBWVPXv33mE,1994
204
204
  orionis/services/environment/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
205
- orionis/services/environment/core/dot_env.py,sha256=Dgkmy0juaFKZPEkv7nN7VvdYryX8fDs0JgRGOIHj7PM,10090
205
+ orionis/services/environment/core/dot_env.py,sha256=1371GV5mxkBH4iPFHccBz9V-6JoZZfy_hSukqJWQjdE,14278
206
206
  orionis/services/environment/dynamic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
207
- orionis/services/environment/dynamic/types.py,sha256=nf7HJjm-1S-BH2YnuBQNNWvb3Aqu-QYPUTfJRgVYZ1Y,18336
207
+ orionis/services/environment/dynamic/caster.py,sha256=8j1yVcOhdS3WTTgzc19CzmxZFWyY6vRVGT__76mU5JI,35040
208
208
  orionis/services/environment/enums/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
209
- orionis/services/environment/enums/cast_type.py,sha256=hoZhljXHNn03VYbg6VTauGyppmcoRjaepylrOKSBvu8,1217
209
+ orionis/services/environment/enums/value_type.py,sha256=C-JQGGz1GtdoggKG-rBykUm9lUTS2JmU232D8lWTB2Q,1302
210
210
  orionis/services/environment/exceptions/__init__.py,sha256=YwLc8GsB0swlwu9T9Qt2vevaCoq5V2vmPUSlEUAqg2Q,199
211
211
  orionis/services/environment/exceptions/exception.py,sha256=NnxWmgoSca7LXi7GLDa95HSBPKotFfy8u729d1OAmCc,479
212
212
  orionis/services/environment/exceptions/value.py,sha256=Pe1qNHRrM9T0AzESN284CzA3GQYxzokfXPMOVqOTlyQ,475
213
213
  orionis/services/environment/helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
214
214
  orionis/services/environment/helpers/functions.py,sha256=MtlDTA1W8KVJu0cohh4TsuPg8CPcnySf36cp9E9tpJI,595
215
215
  orionis/services/environment/key/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
216
- orionis/services/environment/key/key_generator.py,sha256=BHvcFiPOmJHQotstMNkUdoEwb0mNxQk5iyvQU3JlJ94,1134
217
- orionis/services/environment/serializer/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
218
- orionis/services/environment/serializer/values.py,sha256=ERnQWgCAljhJ9pRSd-knnGD5i6ne5Ho-4bh93pgDtwY,364
216
+ orionis/services/environment/key/key_generator.py,sha256=uFHOPH0YtYU_vEG7Oc3a51O15QxZl1USD_KlYcS9SsQ,912
219
217
  orionis/services/environment/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
220
218
  orionis/services/environment/validators/key_name.py,sha256=heMQoMY4vF9sIYAlET7noTQz383daGPvJnJOb62nxFo,1577
221
- orionis/services/environment/validators/types.py,sha256=AQvIZzBWxZ6-iJhzRkroim5CKBvWq2lTttRyXzc-6GU,1922
219
+ orionis/services/environment/validators/types.py,sha256=t3G-JlJz1jDcYKrS7iljBL2q3m-KpmcCFBGoQIhRtK0,2000
222
220
  orionis/services/introspection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
223
221
  orionis/services/introspection/reflection.py,sha256=_Wdy8Wtt3RKXAqg9o5rvYa_Hyu-Z4674LKnNVg7u7pU,11467
224
222
  orionis/services/introspection/abstract/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -357,7 +355,7 @@ orionis/test/validators/web_report.py,sha256=-h3Fe9jY93_kzUhd2NBIqEfCcBpu-8Ei9x3
357
355
  orionis/test/validators/workers.py,sha256=LGffDKtK6SKixFKzIYPQpI5aFeQPAGXpv_LUtmEu6g4,1102
358
356
  orionis/test/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
359
357
  orionis/test/view/render.py,sha256=3ICz68l-WF3BtnYqH5m-ktN9UD00MELMbmMnyJDV74A,4768
360
- orionis-0.421.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
358
+ orionis-0.422.0.dist-info/licenses/LICENCE,sha256=-_4cF2EBKuYVS_SQpy1uapq0oJPUU1vl_RUWSy2jJTo,1111
361
359
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
362
360
  tests/container/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
363
361
  tests/container/test_container.py,sha256=asv8TkkupVoex6SWod74NBl4dSs7wb9mLmu_glNdNy8,14815
@@ -500,8 +498,8 @@ tests/testing/validators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
500
498
  tests/testing/validators/test_testing_validators.py,sha256=QdcF0Vhnnl_kD-PzceHJbUYOqwPTB1Td7YaTv8LTr30,19612
501
499
  tests/testing/view/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
502
500
  tests/testing/view/test_render.py,sha256=-ghGG8rimyb2b2wtvMuSPPH7Zac5_NlVCiUcHRA5SNg,1172
503
- orionis-0.421.0.dist-info/METADATA,sha256=LuYV7Rv2dQBgwy1Ztkz-8mlxiodXlvEPpSJmEw8Gzx0,4772
504
- orionis-0.421.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
505
- orionis-0.421.0.dist-info/top_level.txt,sha256=0G1WIo0HbkZ6hNbKp6cdXLoKj1SfULEORhCuPIV_Dqw,26
506
- orionis-0.421.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
507
- orionis-0.421.0.dist-info/RECORD,,
501
+ orionis-0.422.0.dist-info/METADATA,sha256=uT4PtXxf3WCmccOyQhLgYtP9EsMs9gWS1dq_RQnZwts,4772
502
+ orionis-0.422.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
503
+ orionis-0.422.0.dist-info/top_level.txt,sha256=0G1WIo0HbkZ6hNbKp6cdXLoKj1SfULEORhCuPIV_Dqw,26
504
+ orionis-0.422.0.dist-info/zip-safe,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
505
+ orionis-0.422.0.dist-info/RECORD,,