maleo-foundation 0.3.15__tar.gz → 0.3.17__tar.gz

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.
Files changed (145) hide show
  1. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/PKG-INFO +1 -1
  2. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/authentication.py +4 -6
  3. maleo_foundation-0.3.17/maleo_foundation/managers/cache.py +8 -0
  4. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/client/base.py +7 -11
  5. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/client/maleo.py +3 -4
  6. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/configurations/__init__.py +10 -14
  7. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/configurations/client/__init__.py +3 -4
  8. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/configurations/client/maleo.py +4 -5
  9. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/configurations/middleware.py +5 -8
  10. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/request.py +4 -5
  11. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/client/controllers/http.py +3 -4
  12. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/service/controllers/rest.py +3 -4
  13. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/logging.py +3 -4
  14. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation.egg-info/PKG-INFO +1 -1
  15. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/pyproject.toml +1 -1
  16. maleo_foundation-0.3.15/maleo_foundation/managers/cache.py +0 -9
  17. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/README.md +0 -0
  18. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/__init__.py +0 -0
  19. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/authorization.py +0 -0
  20. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/__init__.py +0 -0
  21. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/manager.py +0 -0
  22. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/services/__init__.py +0 -0
  23. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/services/encryption/__init__.py +0 -0
  24. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/services/encryption/aes.py +0 -0
  25. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/services/encryption/rsa.py +0 -0
  26. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/services/hash/__init__.py +0 -0
  27. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/services/hash/bcrypt.py +0 -0
  28. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/services/hash/hmac.py +0 -0
  29. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/services/hash/sha256.py +0 -0
  30. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/services/key.py +0 -0
  31. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/services/signature.py +0 -0
  32. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/client/services/token.py +0 -0
  33. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/constants.py +0 -0
  34. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/enums.py +0 -0
  35. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/expanded_types/__init__.py +0 -0
  36. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/expanded_types/client.py +0 -0
  37. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/expanded_types/encryption/__init__.py +0 -0
  38. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/expanded_types/encryption/aes.py +0 -0
  39. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/expanded_types/encryption/rsa.py +0 -0
  40. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/expanded_types/general.py +0 -0
  41. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/expanded_types/hash.py +0 -0
  42. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/expanded_types/key.py +0 -0
  43. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/expanded_types/repository.py +0 -0
  44. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/expanded_types/service.py +0 -0
  45. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/expanded_types/signature.py +0 -0
  46. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/expanded_types/token.py +0 -0
  47. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/extended_types.py +0 -0
  48. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/__init__.py +0 -0
  49. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/client/__init__.py +0 -0
  50. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/client/google/__init__.py +0 -0
  51. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/client/google/base.py +0 -0
  52. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/client/google/parameter.py +0 -0
  53. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/client/google/secret.py +0 -0
  54. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/client/google/storage.py +0 -0
  55. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/client/google/subscription.py +0 -0
  56. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/configuration.py +0 -0
  57. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/credential.py +0 -0
  58. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/db.py +0 -0
  59. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/middleware.py +0 -0
  60. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/managers/service.py +0 -0
  61. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/middlewares/authentication.py +0 -0
  62. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/middlewares/base.py +0 -0
  63. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/middlewares/cors.py +0 -0
  64. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/__init__.py +0 -0
  65. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/responses.py +0 -0
  66. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/schemas/__init__.py +0 -0
  67. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/schemas/encryption.py +0 -0
  68. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/schemas/general.py +0 -0
  69. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/schemas/hash.py +0 -0
  70. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/schemas/key.py +0 -0
  71. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/schemas/parameter.py +0 -0
  72. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/schemas/result.py +0 -0
  73. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/schemas/signature.py +0 -0
  74. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/schemas/token.py +0 -0
  75. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/table.py +0 -0
  76. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/__init__.py +0 -0
  77. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/__init__.py +0 -0
  78. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/configurations/cache/__init__.py +0 -0
  79. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/configurations/cache/redis.py +0 -0
  80. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/configurations/database.py +0 -0
  81. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/configurations/service.py +0 -0
  82. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/credentials.py +0 -0
  83. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/database.py +0 -0
  84. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/key.py +0 -0
  85. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/settings.py +0 -0
  86. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/signature.py +0 -0
  87. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/general/token.py +0 -0
  88. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/__init__.py +0 -0
  89. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/client.py +0 -0
  90. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/encryption/__init__.py +0 -0
  91. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/encryption/aes.py +0 -0
  92. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/encryption/rsa.py +0 -0
  93. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/general.py +0 -0
  94. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/hash/__init__.py +0 -0
  95. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/hash/bcrypt.py +0 -0
  96. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/hash/hmac.py +0 -0
  97. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/hash/sha256.py +0 -0
  98. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/key.py +0 -0
  99. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/service.py +0 -0
  100. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/signature.py +0 -0
  101. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/parameters/token.py +0 -0
  102. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/__init__.py +0 -0
  103. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/client/__init__.py +0 -0
  104. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/client/controllers/__init__.py +0 -0
  105. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/client/service.py +0 -0
  106. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/encryption/__init__.py +0 -0
  107. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/encryption/aes.py +0 -0
  108. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/encryption/rsa.py +0 -0
  109. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/hash.py +0 -0
  110. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/key.py +0 -0
  111. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/service/__init__.py +0 -0
  112. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/service/controllers/__init__.py +0 -0
  113. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/service/general.py +0 -0
  114. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/service/repository.py +0 -0
  115. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/signature.py +0 -0
  116. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/models/transfers/results/token.py +0 -0
  117. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/rest_controller_result.py +0 -0
  118. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/types.py +0 -0
  119. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/__init__.py +0 -0
  120. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/cache.py +0 -0
  121. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/client.py +0 -0
  122. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/controller.py +0 -0
  123. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/dependencies/__init__.py +0 -0
  124. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/dependencies/auth.py +0 -0
  125. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/dependencies/context.py +0 -0
  126. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/exceptions.py +0 -0
  127. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/extractor.py +0 -0
  128. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/formatter/__init__.py +0 -0
  129. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/formatter/case.py +0 -0
  130. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/loaders/__init__.py +0 -0
  131. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/loaders/credential/__init__.py +0 -0
  132. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/loaders/credential/google.py +0 -0
  133. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/loaders/json.py +0 -0
  134. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/loaders/key/__init__.py +0 -0
  135. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/loaders/key/rsa.py +0 -0
  136. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/loaders/yaml.py +0 -0
  137. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/merger.py +0 -0
  138. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/query.py +0 -0
  139. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/repository.py +0 -0
  140. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation/utils/searcher.py +0 -0
  141. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation.egg-info/SOURCES.txt +0 -0
  142. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation.egg-info/dependency_links.txt +0 -0
  143. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation.egg-info/requires.txt +0 -0
  144. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/maleo_foundation.egg-info/top_level.txt +0 -0
  145. {maleo_foundation-0.3.15 → maleo_foundation-0.3.17}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.3.15
3
+ Version: 0.3.17
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -1,9 +1,8 @@
1
- from pydantic import BaseModel, Field
1
+ from pydantic import BaseModel, ConfigDict, Field
2
2
  from starlette.authentication import AuthCredentials, BaseUser
3
3
  from typing import Optional, Sequence
4
4
  from maleo_foundation.enums import BaseEnums
5
5
  from maleo_foundation.models.transfers.general.token import MaleoFoundationTokenGeneralTransfers
6
- from maleo_foundation.types import BaseTypes
7
6
 
8
7
  class Token(BaseModel):
9
8
  type: BaseEnums.TokenType = Field(..., description="Token's type")
@@ -46,8 +45,7 @@ class User(BaseUser):
46
45
  return self._email
47
46
 
48
47
  class Authentication(BaseModel):
49
- credentials: Credentials = Field(..., description="Credentials's information")
50
- user: User = Field(..., description="User's information")
48
+ model_config = ConfigDict(arbitrary_types_allowed=True)
51
49
 
52
- class Config:
53
- arbitrary_types_allowed=True
50
+ credentials: Credentials = Field(..., description="Credentials's information")
51
+ user: User = Field(..., description="User's information")
@@ -0,0 +1,8 @@
1
+ from __future__ import annotations
2
+ from pydantic import BaseModel, ConfigDict, Field
3
+ from redis.asyncio.client import Redis
4
+
5
+ class CacheManagers(BaseModel):
6
+ model_config = ConfigDict(arbitrary_types_allowed=True)
7
+
8
+ redis:Redis = Field(..., description="Redis client")
@@ -1,6 +1,6 @@
1
1
  import httpx
2
2
  from contextlib import asynccontextmanager
3
- from pydantic import BaseModel, Field
3
+ from pydantic import BaseModel, ConfigDict, Field
4
4
  from typing import AsyncGenerator, Generator
5
5
  from maleo_foundation.types import BaseTypes
6
6
  from maleo_foundation.utils.logging import ClientLogger, SimpleConfig
@@ -51,10 +51,9 @@ class ClientHTTPControllerManager:
51
51
  await self._client.aclose()
52
52
 
53
53
  class ClientControllerManagers(BaseModel):
54
- http:ClientHTTPControllerManager = Field(..., description="HTTP Client Controller")
54
+ model_config = ConfigDict(arbitrary_types_allowed=True)
55
55
 
56
- class Config:
57
- arbitrary_types_allowed=True
56
+ http:ClientHTTPControllerManager = Field(..., description="HTTP Client Controller")
58
57
 
59
58
  class ClientHTTPController:
60
59
  def __init__(self, manager:ClientHTTPControllerManager):
@@ -65,15 +64,13 @@ class ClientHTTPController:
65
64
  return self._manager
66
65
 
67
66
  class ClientServiceControllers(BaseModel):
68
- http:ClientHTTPController = Field(..., description="HTTP Client Controller")
67
+ model_config = ConfigDict(arbitrary_types_allowed=True)
69
68
 
70
- class Config:
71
- arbitrary_types_allowed=True
69
+ http:ClientHTTPController = Field(..., description="HTTP Client Controller")
72
70
 
73
71
  class ClientControllers(BaseModel):
72
+ model_config = ConfigDict(arbitrary_types_allowed=True)
74
73
  #* Reuse this class while also adding all controllers of the client
75
- class Config:
76
- arbitrary_types_allowed=True
77
74
 
78
75
  class ClientService:
79
76
  def __init__(self, logger:ClientLogger):
@@ -88,9 +85,8 @@ class ClientService:
88
85
  return self._logger
89
86
 
90
87
  class ClientServices(BaseModel):
88
+ model_config = ConfigDict(arbitrary_types_allowed=True)
91
89
  #* Reuse this class while also adding all the services of the client
92
- class Config:
93
- arbitrary_types_allowed=True
94
90
 
95
91
  class ClientManager:
96
92
  def __init__(
@@ -1,4 +1,4 @@
1
- from pydantic import Field
1
+ from pydantic import ConfigDict, Field
2
2
  from maleo_foundation.managers.client.base import (
3
3
  ClientManager,
4
4
  ClientHTTPControllerManager,
@@ -25,10 +25,9 @@ class MaleoClientHTTPController(ClientHTTPController):
25
25
  return self._service_manager
26
26
 
27
27
  class MaleoClientServiceControllers(ClientServiceControllers):
28
- http:MaleoClientHTTPController = Field(..., description="Maleo's HTTP Client Controller")
28
+ model_config = ConfigDict(arbitrary_types_allowed=True)
29
29
 
30
- class Config:
31
- arbitrary_types_allowed=True
30
+ http:MaleoClientHTTPController = Field(..., description="Maleo's HTTP Client Controller")
32
31
 
33
32
  class MaleoClientService(ClientService):
34
33
  def __init__(
@@ -1,4 +1,4 @@
1
- from pydantic import BaseModel, Field
1
+ from pydantic import BaseModel, ConfigDict, Field
2
2
  from maleo_foundation.utils.logging import MiddlewareLogger, ServiceLogger
3
3
  from .cache import CacheConfigurations
4
4
  from .client import ClientConfigurations
@@ -11,35 +11,31 @@ from .middleware import (
11
11
  from .service import ServiceConfigurations
12
12
 
13
13
  class RuntimeConfigurations(BaseModel):
14
+ model_config = ConfigDict(arbitrary_types_allowed=True)
15
+
14
16
  service: ServiceConfigurations = Field(..., description="Service's configurations")
15
17
  middleware: MiddlewareRuntimeConfigurations = Field(..., description="Middleware's runtime configurations")
16
18
  database: DatabaseConfigurations = Field(..., description="Database's configurations")
17
19
 
18
- class Config:
19
- arbitrary_types_allowed=True
20
-
21
20
  class StaticConfigurations(BaseModel):
21
+ model_config = ConfigDict(arbitrary_types_allowed=True)
22
+
22
23
  middleware: MiddlewareStaticConfigurations = Field(..., description="Middleware's static configurations")
23
24
  client: ClientConfigurations = Field(..., description="Client's configurations")
24
25
 
25
- class Config:
26
- arbitrary_types_allowed=True
27
-
28
26
  class Configurations(BaseModel):
27
+ model_config = ConfigDict(arbitrary_types_allowed=True)
28
+
29
29
  service: ServiceConfigurations = Field(..., description="Service's configurations")
30
30
  middleware: MiddlewareConfigurations = Field(..., description="Middleware's configurations")
31
31
  cache: CacheConfigurations = Field(..., description="Cache's configurations")
32
32
  database: DatabaseConfigurations = Field(..., description="Database's configurations")
33
33
  client: ClientConfigurations = Field(..., description="Client's configurations")
34
34
 
35
- class Config:
36
- arbitrary_types_allowed=True
37
-
38
35
  class Loggers(BaseModel):
36
+ model_config = ConfigDict(arbitrary_types_allowed=True)
37
+
39
38
  application: ServiceLogger = Field(..., description="Application logger")
40
39
  repository: ServiceLogger = Field(..., description="Repository logger")
41
40
  database: ServiceLogger = Field(..., description="Database logger")
42
- middleware: MiddlewareLogger = Field(..., description="Middleware logger")
43
-
44
- class Config:
45
- arbitrary_types_allowed=True
41
+ middleware: MiddlewareLogger = Field(..., description="Middleware logger")
@@ -1,8 +1,7 @@
1
- from pydantic import BaseModel, Field
1
+ from pydantic import BaseModel, ConfigDict, Field
2
2
  from .maleo import MaleoClientsConfigurations
3
3
 
4
4
  class ClientConfigurations(BaseModel):
5
- maleo: MaleoClientsConfigurations = Field(..., description="Maleo client's configurations")
5
+ model_config = ConfigDict(arbitrary_types_allowed=True)
6
6
 
7
- class Config:
8
- arbitrary_types_allowed=True
7
+ maleo: MaleoClientsConfigurations = Field(..., description="Maleo client's configurations")
@@ -1,4 +1,4 @@
1
- from pydantic import BaseModel, Field
1
+ from pydantic import BaseModel, ConfigDict, Field
2
2
 
3
3
  class MaleoClientConfigurations(BaseModel):
4
4
  key: str = Field(..., description="Client's key")
@@ -6,6 +6,8 @@ class MaleoClientConfigurations(BaseModel):
6
6
  url: str = Field(..., description="Client's URL")
7
7
 
8
8
  class MaleoClientsConfigurations(BaseModel):
9
+ model_config = ConfigDict(arbitrary_types_allowed=True)
10
+
9
11
  telemetry: MaleoClientConfigurations = Field(..., description="MaleoTelemetry client's configuration")
10
12
  metadata: MaleoClientConfigurations = Field(..., description="MaleoMetadata client's configuration")
11
13
  identity: MaleoClientConfigurations = Field(..., description="MaleoIdentity client's configuration")
@@ -17,7 +19,4 @@ class MaleoClientsConfigurations(BaseModel):
17
19
  scribe: MaleoClientConfigurations = Field(..., description="MaleoScribe client's configuration")
18
20
  cds: MaleoClientConfigurations = Field(..., description="MaleoCDS client's configuration")
19
21
  imaging: MaleoClientConfigurations = Field(..., description="MaleoImaging client's configuration")
20
- mcu: MaleoClientConfigurations = Field(..., description="MaleoMCU client's configuration")
21
-
22
- class Config:
23
- arbitrary_types_allowed=True
22
+ mcu: MaleoClientConfigurations = Field(..., description="MaleoMCU client's configuration")
@@ -1,6 +1,5 @@
1
- from pydantic import BaseModel, Field
1
+ from pydantic import BaseModel, ConfigDict, Field
2
2
  from typing import List
3
- from maleo_foundation.utils.logging import MiddlewareLogger
4
3
 
5
4
  _ALLOW_METHODS: List[str] = [
6
5
  "GET",
@@ -36,12 +35,11 @@ class CORSMiddlewareConfigurations(BaseModel):
36
35
  expose_headers: List[str] = Field(_EXPOSE_HEADERS, description="Exposed headers")
37
36
 
38
37
  class MiddlewareStaticConfigurations(BaseModel):
38
+ model_config = ConfigDict(arbitrary_types_allowed=True)
39
+
39
40
  general: GeneralMiddlewareConfigurations = Field(..., description="Middleware's general configurations")
40
41
  cors: CORSMiddlewareConfigurations = Field(..., description="CORS middleware's configurations")
41
42
 
42
- class Config:
43
- arbitrary_types_allowed=True
44
-
45
43
  class BaseMiddlewareConfigurations(BaseModel):
46
44
  limit: int = Field(10, description="Request limit (per 'window' seconds)")
47
45
  window: int = Field(1, description="Request limit window (seconds)")
@@ -49,10 +47,9 @@ class BaseMiddlewareConfigurations(BaseModel):
49
47
  ip_timeout: int = Field(300, description="Idle IP's timeout (seconds)")
50
48
 
51
49
  class MiddlewareRuntimeConfigurations(BaseModel):
52
- base: BaseMiddlewareConfigurations = Field(..., description="Base middleware's configurations")
50
+ model_config = ConfigDict(arbitrary_types_allowed=True)
53
51
 
54
- class Config:
55
- arbitrary_types_allowed=True
52
+ base: BaseMiddlewareConfigurations = Field(..., description="Base middleware's configurations")
56
53
 
57
54
  class MiddlewareConfigurations(BaseModel):
58
55
  general: GeneralMiddlewareConfigurations = Field(..., description="Middleware's general configurations")
@@ -1,10 +1,12 @@
1
1
  from __future__ import annotations
2
2
  from datetime import datetime, timezone
3
- from pydantic import BaseModel, Field
3
+ from pydantic import BaseModel, ConfigDict, Field
4
4
  from uuid import UUID
5
5
  from maleo_foundation.types import BaseTypes
6
6
 
7
7
  class RequestContext(BaseModel):
8
+ model_config = ConfigDict(arbitrary_types_allowed=True)
9
+
8
10
  request_id: UUID = Field(..., description="Unique identifier for tracing the request")
9
11
  requested_at: datetime = Field(datetime.now(tz=timezone.utc), description="Request timestamp")
10
12
  method: str = Field(..., description="Request's method")
@@ -21,7 +23,4 @@ class RequestContext(BaseModel):
21
23
  origin: BaseTypes.OptionalString = Field(None, description="Origin of the request")
22
24
  host: BaseTypes.OptionalString = Field(None, description="Host header from request")
23
25
  forwarded_proto: BaseTypes.OptionalString = Field(None, description="Forwarded protocol (http/https)")
24
- language: BaseTypes.OptionalString = Field(None, description="Accepted languages from client")
25
-
26
- class Config:
27
- arbitrary_types_allowed = True
26
+ language: BaseTypes.OptionalString = Field(None, description="Accepted languages from client")
@@ -1,17 +1,16 @@
1
1
  from __future__ import annotations
2
2
  from httpx import Response
3
- from pydantic import BaseModel, Field, model_validator
3
+ from pydantic import BaseModel, ConfigDict, Field, model_validator
4
4
  from typing import Any
5
5
 
6
6
  class BaseClientHTTPControllerResults(BaseModel):
7
+ model_config = ConfigDict(arbitrary_types_allowed=True)
8
+
7
9
  response: Response = Field(..., description="Client's HTTP Controller response")
8
10
  status_code: int = Field(..., description="Client's HTTP Controller response status code")
9
11
  content: Any = Field(..., description="Client's HTTP Controller response content")
10
12
  success: bool = Field(..., description="Client's HTTP Controller success status")
11
13
 
12
- class Config:
13
- arbitrary_types_allowed=True
14
-
15
14
  @model_validator(mode="before")
16
15
  @classmethod
17
16
  def process_response(cls, values:dict) -> dict:
@@ -1,19 +1,18 @@
1
1
  from __future__ import annotations
2
2
  from fastapi import status, Response
3
3
  from typing import Any
4
- from pydantic import BaseModel, Field, model_validator
4
+ from pydantic import BaseModel, ConfigDict, Field, model_validator
5
5
  from maleo_foundation.enums import BaseEnums
6
6
 
7
7
  class BaseServiceRESTControllerResults(BaseModel):
8
+ model_config = ConfigDict(arbitrary_types_allowed=True)
9
+
8
10
  success:bool = Field(..., description="REST Controller's success status")
9
11
  response_type:BaseEnums.RESTControllerResponseType = Field(BaseEnums.RESTControllerResponseType.JSON, description="REST Controller's response class")
10
12
  content:Any = Field(..., description="REST Controller's response content")
11
13
  status_code:int = Field(status.HTTP_200_OK, description="REST Controller's response status code")
12
14
  response:Response = Field(Response(), description="REST Controller's Response")
13
15
 
14
- class Config:
15
- arbitrary_types_allowed=True
16
-
17
16
  @model_validator(mode="after")
18
17
  def process_response(self):
19
18
  """Dynamically creates a response based on response_type."""
@@ -5,7 +5,7 @@ from google.cloud.logging import Client
5
5
  from google.cloud.logging.handlers import CloudLoggingHandler
6
6
  from google.oauth2.service_account import Credentials
7
7
  from pathlib import Path
8
- from pydantic import BaseModel, Field
8
+ from pydantic import BaseModel, ConfigDict, Field
9
9
  from typing import Optional, Union
10
10
  from maleo_foundation.enums import BaseEnums
11
11
  from maleo_foundation.types import BaseTypes
@@ -41,13 +41,12 @@ class GoogleCloudLogging:
41
41
  return CloudLoggingHandler(client=self._client, name=name)
42
42
 
43
43
  class SimpleConfig(BaseModel):
44
+ model_config = ConfigDict(arbitrary_types_allowed=True)
45
+
44
46
  dir: str = Field(..., description="Log's directory")
45
47
  level: BaseEnums.LoggerLevel = Field(BaseEnums.LoggerLevel.INFO, description="Log's level")
46
48
  google_cloud_logging: Optional[GoogleCloudLogging] = Field(default_factory=GoogleCloudLogging, description="Google cloud logging")
47
49
 
48
- class Config:
49
- arbitrary_types_allowed=True
50
-
51
50
  class BaseLogger(logging.Logger):
52
51
  def __init__(
53
52
  self,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.3.15
3
+ Version: 0.3.17
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "maleo_foundation"
7
- version = "0.3.15"
7
+ version = "0.3.17"
8
8
  description = "Foundation package for Maleo"
9
9
  authors = [
10
10
  { name = "Agra Bima Yuda", email = "agra@nexmedis.com" }
@@ -1,9 +0,0 @@
1
- from __future__ import annotations
2
- from pydantic import BaseModel, Field
3
- from redis.asyncio.client import Redis
4
-
5
- class CacheManagers(BaseModel):
6
- redis:Redis = Field(..., description="Redis client")
7
-
8
- class Config:
9
- arbitrary_types_allowed=True