fastapi-factory-utilities 0.3.6__py3-none-any.whl → 0.8.2__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.
- fastapi_factory_utilities/core/api/__init__.py +1 -1
- fastapi_factory_utilities/core/api/v1/sys/health.py +1 -1
- fastapi_factory_utilities/core/app/__init__.py +4 -4
- fastapi_factory_utilities/core/app/application.py +22 -26
- fastapi_factory_utilities/core/app/builder.py +19 -35
- fastapi_factory_utilities/core/app/config.py +2 -0
- fastapi_factory_utilities/core/app/fastapi_builder.py +3 -2
- fastapi_factory_utilities/core/exceptions.py +64 -29
- fastapi_factory_utilities/core/plugins/__init__.py +2 -31
- fastapi_factory_utilities/core/plugins/abstracts.py +40 -0
- fastapi_factory_utilities/core/plugins/aiopika/__init__.py +25 -0
- fastapi_factory_utilities/core/plugins/aiopika/abstract.py +48 -0
- fastapi_factory_utilities/core/plugins/aiopika/configs.py +85 -0
- fastapi_factory_utilities/core/plugins/aiopika/depends.py +20 -0
- fastapi_factory_utilities/core/plugins/aiopika/exceptions.py +29 -0
- fastapi_factory_utilities/core/plugins/aiopika/exchange.py +69 -0
- fastapi_factory_utilities/core/plugins/aiopika/listener/__init__.py +7 -0
- fastapi_factory_utilities/core/plugins/aiopika/listener/abstract.py +72 -0
- fastapi_factory_utilities/core/plugins/aiopika/message.py +86 -0
- fastapi_factory_utilities/core/plugins/aiopika/plugins.py +84 -0
- fastapi_factory_utilities/core/plugins/aiopika/publisher/__init__.py +7 -0
- fastapi_factory_utilities/core/plugins/aiopika/publisher/abstract.py +66 -0
- fastapi_factory_utilities/core/plugins/aiopika/queue.py +88 -0
- fastapi_factory_utilities/core/plugins/odm_plugin/__init__.py +14 -157
- fastapi_factory_utilities/core/plugins/odm_plugin/builder.py +3 -3
- fastapi_factory_utilities/core/plugins/odm_plugin/configs.py +1 -1
- fastapi_factory_utilities/core/plugins/odm_plugin/documents.py +1 -1
- fastapi_factory_utilities/core/plugins/odm_plugin/helpers.py +16 -0
- fastapi_factory_utilities/core/plugins/odm_plugin/plugins.py +155 -0
- fastapi_factory_utilities/core/plugins/odm_plugin/repositories.py +1 -0
- fastapi_factory_utilities/core/plugins/opentelemetry_plugin/__init__.py +8 -115
- fastapi_factory_utilities/core/plugins/opentelemetry_plugin/instruments/__init__.py +85 -0
- fastapi_factory_utilities/core/plugins/opentelemetry_plugin/plugins.py +137 -0
- fastapi_factory_utilities/core/plugins/taskiq_plugins/__init__.py +31 -0
- fastapi_factory_utilities/core/plugins/taskiq_plugins/configs.py +12 -0
- fastapi_factory_utilities/core/plugins/taskiq_plugins/depends.py +51 -0
- fastapi_factory_utilities/core/plugins/taskiq_plugins/exceptions.py +13 -0
- fastapi_factory_utilities/core/plugins/taskiq_plugins/plugin.py +41 -0
- fastapi_factory_utilities/core/plugins/taskiq_plugins/schedulers.py +187 -0
- fastapi_factory_utilities/core/protocols.py +1 -54
- fastapi_factory_utilities/core/security/__init__.py +5 -0
- fastapi_factory_utilities/core/security/abstracts.py +42 -0
- fastapi_factory_utilities/core/security/jwt/__init__.py +41 -0
- fastapi_factory_utilities/core/security/jwt/configs.py +32 -0
- fastapi_factory_utilities/core/security/jwt/decoders.py +130 -0
- fastapi_factory_utilities/core/security/jwt/exceptions.py +23 -0
- fastapi_factory_utilities/core/security/jwt/objects.py +107 -0
- fastapi_factory_utilities/core/security/jwt/services.py +176 -0
- fastapi_factory_utilities/core/security/jwt/stores.py +43 -0
- fastapi_factory_utilities/core/security/jwt/types.py +9 -0
- fastapi_factory_utilities/core/security/jwt/verifiers.py +46 -0
- fastapi_factory_utilities/core/security/kratos.py +43 -43
- fastapi_factory_utilities/core/services/hydra/__init__.py +20 -0
- fastapi_factory_utilities/core/services/hydra/exceptions.py +15 -0
- fastapi_factory_utilities/core/services/hydra/objects.py +26 -0
- fastapi_factory_utilities/core/services/hydra/services.py +200 -0
- fastapi_factory_utilities/core/services/status/__init__.py +2 -2
- fastapi_factory_utilities/core/services/status/exceptions.py +1 -1
- fastapi_factory_utilities/core/utils/status.py +2 -1
- fastapi_factory_utilities/core/utils/yaml_reader.py +1 -1
- fastapi_factory_utilities/example/app.py +15 -5
- fastapi_factory_utilities/example/entities/books/__init__.py +1 -1
- fastapi_factory_utilities/example/models/books/__init__.py +1 -1
- {fastapi_factory_utilities-0.3.6.dist-info → fastapi_factory_utilities-0.8.2.dist-info}/METADATA +21 -15
- fastapi_factory_utilities-0.8.2.dist-info/RECORD +111 -0
- {fastapi_factory_utilities-0.3.6.dist-info → fastapi_factory_utilities-0.8.2.dist-info}/WHEEL +1 -1
- fastapi_factory_utilities/core/app/plugin_manager/__init__.py +0 -15
- fastapi_factory_utilities/core/app/plugin_manager/exceptions.py +0 -33
- fastapi_factory_utilities/core/app/plugin_manager/plugin_manager.py +0 -190
- fastapi_factory_utilities/core/plugins/example/__init__.py +0 -31
- fastapi_factory_utilities/core/plugins/httpx_plugin/__init__.py +0 -31
- fastapi_factory_utilities/core/security/jwt.py +0 -158
- fastapi_factory_utilities-0.3.6.dist-info/RECORD +0 -78
- {fastapi_factory_utilities-0.3.6.dist-info → fastapi_factory_utilities-0.8.2.dist-info}/entry_points.txt +0 -0
- {fastapi_factory_utilities-0.3.6.dist-info → fastapi_factory_utilities-0.8.2.dist-info/licenses}/LICENSE +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""Hydra service module."""
|
|
2
|
+
|
|
3
|
+
from .exceptions import HydraOperationError, HydraTokenInvalidError
|
|
4
|
+
from .objects import HydraTokenIntrospectObject
|
|
5
|
+
from .services import (
|
|
6
|
+
HydraIntrospectService,
|
|
7
|
+
HydraOAuth2ClientCredentialsService,
|
|
8
|
+
depends_hydra_introspect_service,
|
|
9
|
+
depends_hydra_oauth2_client_credentials_service,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__: list[str] = [
|
|
13
|
+
"HydraIntrospectService",
|
|
14
|
+
"HydraOAuth2ClientCredentialsService",
|
|
15
|
+
"HydraOperationError",
|
|
16
|
+
"HydraTokenIntrospectObject",
|
|
17
|
+
"HydraTokenInvalidError",
|
|
18
|
+
"depends_hydra_introspect_service",
|
|
19
|
+
"depends_hydra_oauth2_client_credentials_service",
|
|
20
|
+
]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Python exceptions for the Hydra service."""
|
|
2
|
+
|
|
3
|
+
from fastapi_factory_utilities.core.exceptions import FastAPIFactoryUtilitiesError
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class HydraError(FastAPIFactoryUtilitiesError):
|
|
7
|
+
"""Base class for all exceptions raised by the Hydra service."""
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class HydraOperationError(HydraError):
|
|
11
|
+
"""Exception raised when a Hydra operation fails."""
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class HydraTokenInvalidError(HydraError):
|
|
15
|
+
"""Exception raised when a Hydra token is invalid."""
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Provides the objects for the Hydra service."""
|
|
2
|
+
|
|
3
|
+
from typing import ClassVar
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class HydraTokenIntrospectObject(BaseModel):
|
|
9
|
+
"""Represents the object returned by the Hydra token introspection."""
|
|
10
|
+
|
|
11
|
+
model_config: ClassVar[ConfigDict] = ConfigDict(extra="ignore")
|
|
12
|
+
|
|
13
|
+
active: bool
|
|
14
|
+
aud: list[str]
|
|
15
|
+
client_id: str
|
|
16
|
+
exp: int
|
|
17
|
+
ext: dict[str, str] | None = None
|
|
18
|
+
iat: int
|
|
19
|
+
iss: str
|
|
20
|
+
nbf: int
|
|
21
|
+
obfuscated_subject: str | None = None
|
|
22
|
+
scope: str
|
|
23
|
+
sub: str
|
|
24
|
+
token_type: str
|
|
25
|
+
token_use: str
|
|
26
|
+
username: str | None = None
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
"""Provides a service to interact with the Hydra service."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
from base64 import b64encode
|
|
5
|
+
from http import HTTPStatus
|
|
6
|
+
from typing import Annotated, Any, Generic, TypeVar, get_args
|
|
7
|
+
|
|
8
|
+
import aiohttp
|
|
9
|
+
import jwt
|
|
10
|
+
from fastapi import Depends
|
|
11
|
+
from pydantic import ValidationError
|
|
12
|
+
|
|
13
|
+
from fastapi_factory_utilities.core.app import (
|
|
14
|
+
DependencyConfig,
|
|
15
|
+
HttpServiceDependencyConfig,
|
|
16
|
+
depends_dependency_config,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
from .exceptions import HydraOperationError
|
|
20
|
+
from .objects import HydraTokenIntrospectObject
|
|
21
|
+
|
|
22
|
+
HydraIntrospectObjectGeneric = TypeVar("HydraIntrospectObjectGeneric", bound=HydraTokenIntrospectObject)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class HydraIntrospectGenericService(Generic[HydraIntrospectObjectGeneric]):
|
|
26
|
+
"""Service to interact with the Hydra introspect service with a generic introspect object."""
|
|
27
|
+
|
|
28
|
+
INTROSPECT_ENDPOINT: str = "/admin/oauth2/introspect"
|
|
29
|
+
WELLKNOWN_JWKS_ENDPOINT: str = "/.well-known/jwks.json"
|
|
30
|
+
|
|
31
|
+
def __init__(
|
|
32
|
+
self,
|
|
33
|
+
hydra_admin_http_config: HttpServiceDependencyConfig,
|
|
34
|
+
hydra_public_http_config: HttpServiceDependencyConfig,
|
|
35
|
+
) -> None:
|
|
36
|
+
"""Instanciate the Hydra introspect service.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
hydra_admin_http_config (HttpServiceDependencyConfig): The Hydra admin HTTP configuration.
|
|
40
|
+
hydra_public_http_config (HttpServiceDependencyConfig): The Hydra public HTTP configuration.
|
|
41
|
+
"""
|
|
42
|
+
self._hydra_admin_http_config: HttpServiceDependencyConfig = hydra_admin_http_config
|
|
43
|
+
self._hydra_public_http_config: HttpServiceDependencyConfig = hydra_public_http_config
|
|
44
|
+
# Retrieve the concrete introspect object class
|
|
45
|
+
generic_args: tuple[Any, ...] = get_args(self.__orig_bases__[0]) # type: ignore
|
|
46
|
+
self._concreate_introspect_object_class: type[HydraIntrospectObjectGeneric] = generic_args[0]
|
|
47
|
+
|
|
48
|
+
async def introspect(self, token: str) -> HydraIntrospectObjectGeneric:
|
|
49
|
+
"""Introspects a token using the Hydra introspect service.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
token (str): The token to introspect.
|
|
53
|
+
"""
|
|
54
|
+
try:
|
|
55
|
+
async with aiohttp.ClientSession(
|
|
56
|
+
base_url=str(self._hydra_admin_http_config.url),
|
|
57
|
+
) as session:
|
|
58
|
+
async with session.post(
|
|
59
|
+
url=self.INTROSPECT_ENDPOINT,
|
|
60
|
+
data={"token": token},
|
|
61
|
+
) as response:
|
|
62
|
+
response.raise_for_status()
|
|
63
|
+
instrospect: HydraIntrospectObjectGeneric = self._concreate_introspect_object_class.model_validate(
|
|
64
|
+
await response.json()
|
|
65
|
+
)
|
|
66
|
+
except aiohttp.ClientResponseError as error:
|
|
67
|
+
raise HydraOperationError("Failed to introspect the token", status_code=error.status) from error
|
|
68
|
+
except json.JSONDecodeError as error:
|
|
69
|
+
raise HydraOperationError("Failed to decode the introspect response") from error
|
|
70
|
+
except ValidationError as error:
|
|
71
|
+
raise HydraOperationError("Failed to validate the introspect response") from error
|
|
72
|
+
|
|
73
|
+
return instrospect
|
|
74
|
+
|
|
75
|
+
async def get_wellknown_jwks(self) -> jwt.PyJWKSet:
|
|
76
|
+
"""Get the JWKS from the Hydra service."""
|
|
77
|
+
try:
|
|
78
|
+
async with aiohttp.ClientSession(
|
|
79
|
+
base_url=str(self._hydra_public_http_config.url),
|
|
80
|
+
) as session:
|
|
81
|
+
async with session.get(
|
|
82
|
+
url=self.WELLKNOWN_JWKS_ENDPOINT,
|
|
83
|
+
) as response:
|
|
84
|
+
response.raise_for_status()
|
|
85
|
+
jwks_data: dict[str, Any] = await response.json()
|
|
86
|
+
jwks: jwt.PyJWKSet = jwt.PyJWKSet.from_dict(jwks_data)
|
|
87
|
+
return jwks
|
|
88
|
+
except aiohttp.ClientResponseError as error:
|
|
89
|
+
raise HydraOperationError(
|
|
90
|
+
"Failed to get the JWKS from the Hydra service", status_code=error.status
|
|
91
|
+
) from error
|
|
92
|
+
except json.JSONDecodeError as error:
|
|
93
|
+
raise HydraOperationError("Failed to decode the JWKS from the Hydra service") from error
|
|
94
|
+
except ValidationError as error:
|
|
95
|
+
raise HydraOperationError("Failed to validate the JWKS from the Hydra service") from error
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
class HydraIntrospectService(HydraIntrospectGenericService[HydraTokenIntrospectObject]):
|
|
99
|
+
"""Service to interact with the Hydra introspect service with the default HydraTokenIntrospectObject."""
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class HydraOAuth2ClientCredentialsService:
|
|
103
|
+
"""Service to interact with the Hydra service."""
|
|
104
|
+
|
|
105
|
+
INTROSPECT_ENDPOINT: str = "/admin/oauth2/introspect"
|
|
106
|
+
CLIENT_CREDENTIALS_ENDPOINT: str = "/oauth2/token"
|
|
107
|
+
|
|
108
|
+
def __init__(
|
|
109
|
+
self,
|
|
110
|
+
hydra_public_http_config: HttpServiceDependencyConfig,
|
|
111
|
+
) -> None:
|
|
112
|
+
"""Instanciate the Hydra service.
|
|
113
|
+
|
|
114
|
+
Args:
|
|
115
|
+
hydra_admin_http_config (HttpServiceDependencyConfig): The Hydra admin HTTP configuration.
|
|
116
|
+
hydra_public_http_config (HttpServiceDependencyConfig): The Hydra public HTTP configuration.
|
|
117
|
+
"""
|
|
118
|
+
self._hydra_public_http_config: HttpServiceDependencyConfig = hydra_public_http_config
|
|
119
|
+
|
|
120
|
+
async def oauth2_client_credentials(self, client_id: str, client_secret: str, scope: str) -> str:
|
|
121
|
+
"""Get the OAuth2 client credentials.
|
|
122
|
+
|
|
123
|
+
Args:
|
|
124
|
+
client_id (str): The client ID.
|
|
125
|
+
client_secret (str): The client secret.
|
|
126
|
+
scope (str): The scope.
|
|
127
|
+
|
|
128
|
+
Returns:
|
|
129
|
+
str: The access token.
|
|
130
|
+
|
|
131
|
+
Raises:
|
|
132
|
+
HydraOperationError: If the client credentials request fails.
|
|
133
|
+
"""
|
|
134
|
+
# Create base64 encoded Basic Auth header
|
|
135
|
+
auth_string = f"{client_id}:{client_secret}"
|
|
136
|
+
auth_bytes = auth_string.encode("utf-8")
|
|
137
|
+
auth_b64 = b64encode(auth_bytes).decode("utf-8")
|
|
138
|
+
|
|
139
|
+
async with aiohttp.ClientSession(
|
|
140
|
+
base_url=str(self._hydra_public_http_config.url),
|
|
141
|
+
) as session:
|
|
142
|
+
async with session.post(
|
|
143
|
+
url=self.CLIENT_CREDENTIALS_ENDPOINT,
|
|
144
|
+
headers={"Authorization": f"Basic {auth_b64}"},
|
|
145
|
+
data={"grant_type": "client_credentials", "scope": scope},
|
|
146
|
+
) as response:
|
|
147
|
+
response_data = await response.json()
|
|
148
|
+
if response.status != HTTPStatus.OK:
|
|
149
|
+
raise HydraOperationError(f"Failed to get client credentials: {response_data}")
|
|
150
|
+
|
|
151
|
+
return response_data["access_token"]
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
def depends_hydra_oauth2_client_credentials_service(
|
|
155
|
+
dependency_config: Annotated[DependencyConfig, Depends(depends_dependency_config)],
|
|
156
|
+
) -> HydraOAuth2ClientCredentialsService:
|
|
157
|
+
"""Dependency injection for the Hydra OAuth2 client credentials service.
|
|
158
|
+
|
|
159
|
+
Args:
|
|
160
|
+
dependency_config (DependencyConfig): The dependency configuration.
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
HydraOAuth2ClientCredentialsService: The Hydra OAuth2 client credentials service instance.
|
|
164
|
+
|
|
165
|
+
Raises:
|
|
166
|
+
HydraOperationError: If the Hydra public dependency is not configured.
|
|
167
|
+
"""
|
|
168
|
+
if dependency_config.hydra_public is None:
|
|
169
|
+
raise HydraOperationError(message="Hydra public dependency not configured")
|
|
170
|
+
|
|
171
|
+
return HydraOAuth2ClientCredentialsService(
|
|
172
|
+
hydra_public_http_config=dependency_config.hydra_public,
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def depends_hydra_introspect_service(
|
|
177
|
+
dependency_config: Annotated[DependencyConfig, Depends(depends_dependency_config)],
|
|
178
|
+
) -> HydraIntrospectService:
|
|
179
|
+
"""Dependency injection for the Hydra introspect service.
|
|
180
|
+
|
|
181
|
+
Args:
|
|
182
|
+
dependency_config (DependencyConfig): The dependency configuration.
|
|
183
|
+
|
|
184
|
+
Returns:
|
|
185
|
+
HydraIntrospectService: The Hydra introspect service instance.
|
|
186
|
+
|
|
187
|
+
Raises:
|
|
188
|
+
HydraOperationError: If the Hydra admin dependency is not configured.
|
|
189
|
+
"""
|
|
190
|
+
if getattr(dependency_config, "hydra_admin", None) is None:
|
|
191
|
+
raise HydraOperationError(message="Hydra admin dependency not configured")
|
|
192
|
+
assert dependency_config.hydra_admin is not None
|
|
193
|
+
if getattr(dependency_config, "hydra_public", None) is None:
|
|
194
|
+
raise HydraOperationError(message="Hydra public dependency not configured")
|
|
195
|
+
assert dependency_config.hydra_public is not None
|
|
196
|
+
|
|
197
|
+
return HydraIntrospectService(
|
|
198
|
+
hydra_admin_http_config=dependency_config.hydra_admin,
|
|
199
|
+
hydra_public_http_config=dependency_config.hydra_public,
|
|
200
|
+
)
|
|
@@ -5,10 +5,10 @@ from .services import StatusService
|
|
|
5
5
|
from .types import ComponentInstanceType, Status
|
|
6
6
|
|
|
7
7
|
__all__: list[str] = [
|
|
8
|
-
"ComponentTypeEnum",
|
|
9
8
|
"ComponentInstanceType",
|
|
9
|
+
"ComponentTypeEnum",
|
|
10
10
|
"HealthStatusEnum",
|
|
11
11
|
"ReadinessStatusEnum",
|
|
12
|
-
"StatusService",
|
|
13
12
|
"Status",
|
|
13
|
+
"StatusService",
|
|
14
14
|
]
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
```python
|
|
4
4
|
# Example of using the MonitoredAbstract
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
class MyMonitored(MonitoredAbstract):
|
|
7
8
|
def __init__(self, status_service: StatusService) -> None:
|
|
8
9
|
super().__init__(
|
|
@@ -63,9 +64,9 @@ class MonitoredAbstract(ABC):
|
|
|
63
64
|
|
|
64
65
|
|
|
65
66
|
__all__: list[str] = [
|
|
66
|
-
"MonitoredAbstract",
|
|
67
67
|
"ComponentInstanceType",
|
|
68
68
|
"ComponentTypeEnum",
|
|
69
|
+
"MonitoredAbstract",
|
|
69
70
|
"Status",
|
|
70
71
|
"StatusService",
|
|
71
72
|
]
|
|
@@ -72,7 +72,7 @@ class YamlFileReader:
|
|
|
72
72
|
try:
|
|
73
73
|
yaml_data = yaml_data[key]
|
|
74
74
|
except KeyError:
|
|
75
|
-
logger.warning(f"Base key {key}
|
|
75
|
+
logger.warning(f"Base key {key} not found in YAML file" + " from {self._yaml_base_key}")
|
|
76
76
|
return dict()
|
|
77
77
|
return yaml_data
|
|
78
78
|
|
|
@@ -7,7 +7,9 @@ from beanie import Document
|
|
|
7
7
|
from fastapi_factory_utilities.core.app.application import ApplicationAbstract
|
|
8
8
|
from fastapi_factory_utilities.core.app.builder import ApplicationGenericBuilder
|
|
9
9
|
from fastapi_factory_utilities.core.app.config import RootConfig
|
|
10
|
-
from fastapi_factory_utilities.core.plugins import
|
|
10
|
+
from fastapi_factory_utilities.core.plugins.abstracts import PluginAbstract
|
|
11
|
+
from fastapi_factory_utilities.core.plugins.odm_plugin import ODMPlugin
|
|
12
|
+
from fastapi_factory_utilities.core.plugins.opentelemetry_plugin import OpenTelemetryPlugin
|
|
11
13
|
from fastapi_factory_utilities.example.models.books.document import BookDocument
|
|
12
14
|
|
|
13
15
|
|
|
@@ -26,12 +28,11 @@ class App(ApplicationAbstract):
|
|
|
26
28
|
|
|
27
29
|
ODM_DOCUMENT_MODELS: ClassVar[list[type[Document]]] = [BookDocument]
|
|
28
30
|
|
|
29
|
-
DEFAULT_PLUGINS_ACTIVATED: ClassVar[list[PluginsEnum]] = [PluginsEnum.OPENTELEMETRY_PLUGIN, PluginsEnum.ODM_PLUGIN]
|
|
30
|
-
|
|
31
31
|
def configure(self) -> None:
|
|
32
32
|
"""Configure the application."""
|
|
33
33
|
# Prevent circular import
|
|
34
|
-
|
|
34
|
+
# pylint: disable=import-outside-toplevel
|
|
35
|
+
from .api import api_router # noqa: PLC0415
|
|
35
36
|
|
|
36
37
|
self.get_asgi_app().include_router(router=api_router)
|
|
37
38
|
|
|
@@ -47,4 +48,13 @@ class App(ApplicationAbstract):
|
|
|
47
48
|
class AppBuilder(ApplicationGenericBuilder[App]):
|
|
48
49
|
"""Application builder for the App application."""
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
def get_default_plugins(self) -> list[PluginAbstract]:
|
|
52
|
+
"""Get the default plugins."""
|
|
53
|
+
return [ODMPlugin(), OpenTelemetryPlugin()]
|
|
54
|
+
|
|
55
|
+
def __init__(self, plugins: list[PluginAbstract] | None = None) -> None:
|
|
56
|
+
"""Initialize the AppBuilder."""
|
|
57
|
+
# If no plugins are provided, use the default plugins
|
|
58
|
+
if plugins is None:
|
|
59
|
+
plugins = self.get_default_plugins()
|
|
60
|
+
super().__init__(plugins=plugins)
|
{fastapi_factory_utilities-0.3.6.dist-info → fastapi_factory_utilities-0.8.2.dist-info}/METADATA
RENAMED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi_factory_utilities
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: Consolidate libraries and utilities to create microservices in Python with FastAPI, Beanie,
|
|
3
|
+
Version: 0.8.2
|
|
4
|
+
Summary: Consolidate libraries and utilities to create microservices in Python with FastAPI, Beanie, Taskiq, AioPika and OpenTelemetry.
|
|
5
5
|
License: MIT
|
|
6
|
-
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Keywords: python,fastapi,beanie,taskiq,opentelemetry,microservices
|
|
7
8
|
Author: miragecentury
|
|
8
9
|
Author-email: victorien.vanroye@gmail.com
|
|
9
10
|
Maintainer: miragecentury
|
|
@@ -18,26 +19,31 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
18
19
|
Classifier: Topic :: Software Development :: Libraries
|
|
19
20
|
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
20
21
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
Requires-Dist:
|
|
23
|
-
Requires-Dist:
|
|
24
|
-
Requires-Dist:
|
|
22
|
+
Requires-Dist: aio-pika (>=9.5.7,<10.0.0)
|
|
23
|
+
Requires-Dist: aiohttp[speedups] (>=3.12.13,<4.0.0)
|
|
24
|
+
Requires-Dist: beanie (>=1.30.0,<2.0.0)
|
|
25
|
+
Requires-Dist: fastapi (>=0.115.13,<1)
|
|
25
26
|
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc (>=1.26.0,<2.0.0)
|
|
26
27
|
Requires-Dist: opentelemetry-exporter-otlp-proto-http (>=1.26.0,<2.0.0)
|
|
27
|
-
Requires-Dist: opentelemetry-instrumentation-
|
|
28
|
-
Requires-Dist: opentelemetry-instrumentation-
|
|
28
|
+
Requires-Dist: opentelemetry-instrumentation-aio-pika (>=0.59b0,<0.60)
|
|
29
|
+
Requires-Dist: opentelemetry-instrumentation-aiohttp-client (>=0,<1)
|
|
30
|
+
Requires-Dist: opentelemetry-instrumentation-fastapi (>=0,<1)
|
|
31
|
+
Requires-Dist: opentelemetry-instrumentation-pymongo (>=0,<1)
|
|
29
32
|
Requires-Dist: opentelemetry-propagator-b3 (>=1.26.0,<2.0.0)
|
|
30
33
|
Requires-Dist: opentelemetry-sdk (>=1.26.0,<2.0.0)
|
|
31
34
|
Requires-Dist: pyaml (>=25.1.0,<26.0.0)
|
|
32
35
|
Requires-Dist: pydantic (>=2.8.2,<3.0.0)
|
|
33
36
|
Requires-Dist: pyjwt (>=2.10.1,<3.0.0)
|
|
34
|
-
Requires-Dist: pymongo (>=4.9.2,<4.
|
|
37
|
+
Requires-Dist: pymongo (>=4.9.2,<4.16.0)
|
|
35
38
|
Requires-Dist: reactivex (>=4.0.4,<5.0.0)
|
|
36
39
|
Requires-Dist: structlog (>=24.1,<26.0)
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
Requires-Dist:
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
Requires-Dist: taskiq-dependencies (>=1.5.8,<2.0.0)
|
|
41
|
+
Requires-Dist: taskiq-fastapi (>=0.3.5,<0.4.0)
|
|
42
|
+
Requires-Dist: taskiq-redis (>=1.0.9,<2.0.0)
|
|
43
|
+
Requires-Dist: typer (>=0,<1)
|
|
44
|
+
Requires-Dist: uvicorn (>=0.34.3,<1)
|
|
45
|
+
Project-URL: Homepage, https://github.com/DeerHide/fastapi_factory_utilities
|
|
46
|
+
Project-URL: Repository, https://github.com/DeerHide/fastapi_factory_utilities
|
|
41
47
|
Description-Content-Type: text/markdown
|
|
42
48
|
|
|
43
49
|
# fastapi_factory_utilities
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
fastapi_factory_utilities/__main__.py,sha256=w8o9KpyHcxGyLHmTK8ixbIqJIsB3NbIGuAMY7OfnxrA,147
|
|
2
|
+
fastapi_factory_utilities/core/__init__.py,sha256=tt5a-MgeFt_oACkc9K5xl2rynIbca9DGqsKBDEqGzto,34
|
|
3
|
+
fastapi_factory_utilities/core/api/__init__.py,sha256=fAwgRcRry1nIyAL7CsCbpwR87n5tWnBWKEPH6QZCpp8,542
|
|
4
|
+
fastapi_factory_utilities/core/api/tags.py,sha256=3hQcTeW0FS78sPTJ2PB44dMDTSkoW-xKj7rrfKX2Lk0,154
|
|
5
|
+
fastapi_factory_utilities/core/api/v1/sys/__init__.py,sha256=mTXhpn3_KgQ1snt0-0PFmGvFr4n5srQRRADEdRSGFJM,345
|
|
6
|
+
fastapi_factory_utilities/core/api/v1/sys/health.py,sha256=LILUwfyqeBDlf4GSpkU_3bxMjZPCLanOBkMGDKtQufY,2867
|
|
7
|
+
fastapi_factory_utilities/core/api/v1/sys/readiness.py,sha256=xIY8pQLShU7KWRtlOUK5gTDyZ8aB1KBvLczC6boT-tg,1711
|
|
8
|
+
fastapi_factory_utilities/core/app/__init__.py,sha256=6Ee_zK-KzJWoOElsAnGdBz8giRJlhAPMaEzs0I3gvrA,596
|
|
9
|
+
fastapi_factory_utilities/core/app/application.py,sha256=fJTKgfqBWD1xzE7Y9ToZEBDrd1PxHtnZ7SHLmkS1S1M,4737
|
|
10
|
+
fastapi_factory_utilities/core/app/builder.py,sha256=gkmhGVYFu2zbW5sxWyh6Pn5ysdCIvn1_WqNJMKls54s,3820
|
|
11
|
+
fastapi_factory_utilities/core/app/config.py,sha256=MuV4G_M4QgZWYHoulusJLv_m4Qr2php-Cg9Jum4qkNA,7303
|
|
12
|
+
fastapi_factory_utilities/core/app/enums.py,sha256=X1upnaehYU0eHExXTde5xsH-pI9q7HZDNsOEF5PApdg,226
|
|
13
|
+
fastapi_factory_utilities/core/app/exceptions.py,sha256=tQDf0_4j5xgCbku7TL7JaZGs3_bjsWG2YLBCydQJpPw,664
|
|
14
|
+
fastapi_factory_utilities/core/app/fastapi_builder.py,sha256=7egWkS98nTiVBe2Bw5dQzDBryQCkz4w7gnY9HA24NFg,2855
|
|
15
|
+
fastapi_factory_utilities/core/exceptions.py,sha256=JeGUBiEC0dsS1uObP5SuJgUu_aCF5lCDdEFTL0Eq4W4,3221
|
|
16
|
+
fastapi_factory_utilities/core/plugins/__init__.py,sha256=7ctIv2Jx2uOUpgm8ITFRuZxHi6OXvlVS0VcbszVzvis,114
|
|
17
|
+
fastapi_factory_utilities/core/plugins/abstracts.py,sha256=p5iXmeOVD737G73I2keKV0Y-jLGQf2vYbTSR1LgrA14,1165
|
|
18
|
+
fastapi_factory_utilities/core/plugins/aiopika/__init__.py,sha256=flXanbhbjFaOsgx7jZvtW0bVLT_NXHypIPFO1tIHoCM,705
|
|
19
|
+
fastapi_factory_utilities/core/plugins/aiopika/abstract.py,sha256=TcvDwdaLV0UqFHQy6Sn3Y5Fp-1463dhL7VNB9LTKL5I,1682
|
|
20
|
+
fastapi_factory_utilities/core/plugins/aiopika/configs.py,sha256=BEPE8Ss7q_yCyuii4nywmIgh67iNLdhKxUm8tC0PdCY,3706
|
|
21
|
+
fastapi_factory_utilities/core/plugins/aiopika/depends.py,sha256=5xna571hCIdqzbo0t1CW-yzmJMSpEw_KUeJh5nBXjwQ,761
|
|
22
|
+
fastapi_factory_utilities/core/plugins/aiopika/exceptions.py,sha256=AkBKT8HVPpJDAntLNlOLp6lpQpKI-k8gxNzU24FsOF0,985
|
|
23
|
+
fastapi_factory_utilities/core/plugins/aiopika/exchange.py,sha256=MxASHfkIwFPAvIoRhGAXkzfsOPBAm5JfLkivcQtLvds,2501
|
|
24
|
+
fastapi_factory_utilities/core/plugins/aiopika/listener/__init__.py,sha256=LsTyu6kGoUm7c5OvSQTDJL7d8CG9TeARBHHVe_HGsHY,148
|
|
25
|
+
fastapi_factory_utilities/core/plugins/aiopika/listener/abstract.py,sha256=XGYfm3bZSJHG1B97tS9GqK3V9gZ3EpTEVcHyF0L9Xtc,2618
|
|
26
|
+
fastapi_factory_utilities/core/plugins/aiopika/message.py,sha256=y1tEhJWOXg1R7y7iA6F1VSZccsRPBB01IMYuU9BfikA,2885
|
|
27
|
+
fastapi_factory_utilities/core/plugins/aiopika/plugins.py,sha256=0lLYt-ZG3g3m8wi1tCCPEhTUBqaXuEJOwHEcrvP7FYc,3284
|
|
28
|
+
fastapi_factory_utilities/core/plugins/aiopika/publisher/__init__.py,sha256=MGGdygH72xHZ4QAwvbUZKQt-_mPzLmMxHyAACSNnZ_c,151
|
|
29
|
+
fastapi_factory_utilities/core/plugins/aiopika/publisher/abstract.py,sha256=PmIG5zlx-tFUAneHtbknR0Ik5flz8pMTzxcreY2hZ7s,2494
|
|
30
|
+
fastapi_factory_utilities/core/plugins/aiopika/queue.py,sha256=VivCbsIgqM36P_7VTZdOZ9kGop2m0kPCvDVQ1nEJCTo,2874
|
|
31
|
+
fastapi_factory_utilities/core/plugins/odm_plugin/__init__.py,sha256=JsVz4GBiZRmm4qpUD1-Wsg2tRXTn-VO5fU-W1whZo4E,683
|
|
32
|
+
fastapi_factory_utilities/core/plugins/odm_plugin/builder.py,sha256=MdO1D0C9LQpoqtNFqgPwSYedLzXR6PArhkoJw6wzykg,8761
|
|
33
|
+
fastapi_factory_utilities/core/plugins/odm_plugin/configs.py,sha256=5bVbtsLwJhuIvt8FCzOvk002G8qFmZumWkN75bPKatc,331
|
|
34
|
+
fastapi_factory_utilities/core/plugins/odm_plugin/depends.py,sha256=OcLsfTLzMBk_xFV6qsMy_-qFkiphEbbEuaHUooagxg8,730
|
|
35
|
+
fastapi_factory_utilities/core/plugins/odm_plugin/documents.py,sha256=4aQNrD26d0S542_LYmxxm07Q8SWzbGe3PCpho6iWY5Q,1102
|
|
36
|
+
fastapi_factory_utilities/core/plugins/odm_plugin/exceptions.py,sha256=acnKJB0lGAzDs-7-LjBap8shjP3iV1a7dw7ouPVF27o,551
|
|
37
|
+
fastapi_factory_utilities/core/plugins/odm_plugin/helpers.py,sha256=s9iEujDZbTmTb9FByJAVUzLkjQpsciQT9dytkeosKuE,463
|
|
38
|
+
fastapi_factory_utilities/core/plugins/odm_plugin/plugins.py,sha256=0jsLtw4NxZB6bDcBLBvWHqB-RELoewsSXTJdAOGunSY,6443
|
|
39
|
+
fastapi_factory_utilities/core/plugins/odm_plugin/repositories.py,sha256=GJ3ovlxzTpiJ2_XlgARtwn6j0SbQxxAray_r8QWvGok,11313
|
|
40
|
+
fastapi_factory_utilities/core/plugins/opentelemetry_plugin/__init__.py,sha256=xXHn5dUxhgdDDQMpTHf3voolzS0E3zE2RFbtFHJzb38,641
|
|
41
|
+
fastapi_factory_utilities/core/plugins/opentelemetry_plugin/builder.py,sha256=9npQImifYAbEg0lFG7KwZ8V78SNrPoaINgd8vKitdMw,12509
|
|
42
|
+
fastapi_factory_utilities/core/plugins/opentelemetry_plugin/configs.py,sha256=pMG9leMB7rtdkdGFLIxXflV7bf9epGrrYPt2N97KZcM,3750
|
|
43
|
+
fastapi_factory_utilities/core/plugins/opentelemetry_plugin/exceptions.py,sha256=CpsHayfQpP0zghN8y5PP6TBy-cXhHoNxBR--I86gAdE,327
|
|
44
|
+
fastapi_factory_utilities/core/plugins/opentelemetry_plugin/helpers.py,sha256=qpTIzX67orJz7vy6SBIwRs24omMBoToJkhpurZRjPuk,1533
|
|
45
|
+
fastapi_factory_utilities/core/plugins/opentelemetry_plugin/instruments/__init__.py,sha256=lMtdd1DSDrFcXggf0qMpB1RJC7aBqWMpOBXxC8-bqPY,3307
|
|
46
|
+
fastapi_factory_utilities/core/plugins/opentelemetry_plugin/plugins.py,sha256=v9W4bqEljcRgeSL8pf-4yZ7SGXOFmxVoljthvcLdy6Q,5356
|
|
47
|
+
fastapi_factory_utilities/core/plugins/taskiq_plugins/__init__.py,sha256=zLZh8HU-oY1FL977yXt51AV95p8WCBJY2cleVUU7w6M,850
|
|
48
|
+
fastapi_factory_utilities/core/plugins/taskiq_plugins/configs.py,sha256=O2rgFFWJNBUZ7ozfhM0Lj5Te-58qBNrQtw_N0mosAu4,304
|
|
49
|
+
fastapi_factory_utilities/core/plugins/taskiq_plugins/depends.py,sha256=XBxC1uUdMhYtqZDqmUEKI80y5L7mDoXXjN8dZjEvVAo,1602
|
|
50
|
+
fastapi_factory_utilities/core/plugins/taskiq_plugins/exceptions.py,sha256=1Xq_DqDFiQm2YU-2pGxziy-EeMhHiUsUwV0XdY_rQls,456
|
|
51
|
+
fastapi_factory_utilities/core/plugins/taskiq_plugins/plugin.py,sha256=gUlU2s7aLB2lkAAPdLqVc-BY16PessSYTGMGgNcKCSA,1602
|
|
52
|
+
fastapi_factory_utilities/core/plugins/taskiq_plugins/schedulers.py,sha256=82Yh7Y_MUxiWjrHPnsW_Ax-CWREAT6eC_bVl-HW5a3E,7208
|
|
53
|
+
fastapi_factory_utilities/core/protocols.py,sha256=w5FQqMAZ_OulG5hQWkoOapNSnxsjBPq4EjvWNXXdI_c,859
|
|
54
|
+
fastapi_factory_utilities/core/security/__init__.py,sha256=C_EnEZLMrhmAktNmSD80-0eqhs38AFnTmp-3UC7L0cg,119
|
|
55
|
+
fastapi_factory_utilities/core/security/abstracts.py,sha256=xas-gFTqWzxWMZNZx4qdtAzYW_XA8vH2N1wlBx0CuN8,1247
|
|
56
|
+
fastapi_factory_utilities/core/security/jwt/__init__.py,sha256=yj8OHMAxQyY_vv0CZtSQlBUSchGHomHif2qWPNnv21k,1107
|
|
57
|
+
fastapi_factory_utilities/core/security/jwt/configs.py,sha256=FaqBXdH3W1e95DrFl1QMqF6Teyp5ZvGq42EC8GCwGNM,1367
|
|
58
|
+
fastapi_factory_utilities/core/security/jwt/decoders.py,sha256=byj--PbnVbBHrZm6lWE2SH3XX37zPuWdujcLgogdB1U,4935
|
|
59
|
+
fastapi_factory_utilities/core/security/jwt/exceptions.py,sha256=9kxA4JLq9tfBfnwf-Wadpy9RiU8IjcijifqUS8KFhz0,642
|
|
60
|
+
fastapi_factory_utilities/core/security/jwt/objects.py,sha256=z4geVMnrZVPV0aaf-p0NIY4WHXhQox2UiKyHTHH5DOc,3986
|
|
61
|
+
fastapi_factory_utilities/core/security/jwt/services.py,sha256=8NAXI8RniXZAzNJzg8I9nisu5ch8fP83c9Tm-vdM4p8,7240
|
|
62
|
+
fastapi_factory_utilities/core/security/jwt/stores.py,sha256=LhAAputlPFBZyVMhm5blHKX6eKYo_GxrULANgYBWKio,1193
|
|
63
|
+
fastapi_factory_utilities/core/security/jwt/types.py,sha256=FO9fIDh67pK0iVzQGeH_M9AWRqCQQS2S7GqkHkZBQBo,288
|
|
64
|
+
fastapi_factory_utilities/core/security/jwt/verifiers.py,sha256=bf6nlm3dCk4Ej1ncB-gfIRRXc5I5np9IzAo1vDhwo1c,1292
|
|
65
|
+
fastapi_factory_utilities/core/security/kratos.py,sha256=Nfol2sIHlRSw5JdzzFsa89_C15lrLLQMeUd55QAGZDc,3193
|
|
66
|
+
fastapi_factory_utilities/core/services/hydra/__init__.py,sha256=b6q22Qiapcg4xzoWNI5_qyT5wwcRJ7hiK1ItGmspgW8,616
|
|
67
|
+
fastapi_factory_utilities/core/services/hydra/exceptions.py,sha256=ePMrfZturU2IVcxOebR0CbVKKqprce_fK-4UXbPPgNI,450
|
|
68
|
+
fastapi_factory_utilities/core/services/hydra/objects.py,sha256=2CeV_4zmwwpfbXQ0TM9B_UnNkZuIRXweFP_VALBo57c,601
|
|
69
|
+
fastapi_factory_utilities/core/services/hydra/services.py,sha256=JvRyAW7J5zG-r4hE6Y0VzeQZuOcwfjU4eGgo6k_bqJg,8235
|
|
70
|
+
fastapi_factory_utilities/core/services/kratos/__init__.py,sha256=DaC29-Ol0WR5vX56IHLGDXP9UrhISq0Juhg_sJTasw4,368
|
|
71
|
+
fastapi_factory_utilities/core/services/kratos/enums.py,sha256=ULJppowlZbOjdnUIXQyI4_nHmHZoNnv7-M1CYQBYXFY,220
|
|
72
|
+
fastapi_factory_utilities/core/services/kratos/exceptions.py,sha256=xAX01-lQvPpADgcwhB5YWSy1UqAxG38s2rlU9AJBJd8,472
|
|
73
|
+
fastapi_factory_utilities/core/services/kratos/objects.py,sha256=a0npt4Q6d9UbF0w3e6EvyKLwMWO2l639_dFjruA8_2c,980
|
|
74
|
+
fastapi_factory_utilities/core/services/kratos/services.py,sha256=RFKrME6M6omWiHORMBCSyvIG0BsimQaCfnmtsOdFfsg,3158
|
|
75
|
+
fastapi_factory_utilities/core/services/status/__init__.py,sha256=kkR2Xx-kbHb_QXkkBSUNIK5y_eNM4YCElFftBAooIY0,370
|
|
76
|
+
fastapi_factory_utilities/core/services/status/enums.py,sha256=IUxWAd0Ecknri4BqzaqoDRRhT_8LdcgtQcNqgNVDXGE,599
|
|
77
|
+
fastapi_factory_utilities/core/services/status/exceptions.py,sha256=nA22c9djJMTRh_uN2WD0iKs-wRLZ09hhdPEx3slt1Bw,840
|
|
78
|
+
fastapi_factory_utilities/core/services/status/health_calculator_strategies.py,sha256=p2KKJo-dq1j9iWHT0mvlBKtldH9m8l31aytLkUsb9nQ,1634
|
|
79
|
+
fastapi_factory_utilities/core/services/status/readiness_calculator_strategies.py,sha256=hA1LX2pSxva-7bVaQ0dw8NpTbl1ZWDtXd9xzqQUGUsI,1354
|
|
80
|
+
fastapi_factory_utilities/core/services/status/services.py,sha256=qtgYdnxNQMbb6q6G9uGasRO3lZcpiWNmw1padPkh6jA,8490
|
|
81
|
+
fastapi_factory_utilities/core/services/status/types.py,sha256=GJOGRra6NtpUS4q1cr4cdWR0BbIUtEwP7vQX-sXX5jQ,3297
|
|
82
|
+
fastapi_factory_utilities/core/utils/configs.py,sha256=qM0pCrsK8ZyfCoyova_VrhR4eUX3LSPCbWunGMWcSVg,2581
|
|
83
|
+
fastapi_factory_utilities/core/utils/importlib.py,sha256=DYcPo7K0s95WV5xxtucpufWsTj8Pxv25sWunDmmNUYI,797
|
|
84
|
+
fastapi_factory_utilities/core/utils/log.py,sha256=6V9CL3bQio4e47YxcSXM2JQRGhVxuBfmcEbcF4RtCfQ,6393
|
|
85
|
+
fastapi_factory_utilities/core/utils/status.py,sha256=ADdi4NzkJy0qNVC86tKV09wdpuPhuCKSrvYn9tzNVn8,1934
|
|
86
|
+
fastapi_factory_utilities/core/utils/uvicorn.py,sha256=XThylG-nOPVL00w6MIWGODnweoM7VxmpSFcyoPcmqns,2609
|
|
87
|
+
fastapi_factory_utilities/core/utils/yaml_reader.py,sha256=2XenSHqymZsgff70upPZtyx0-BsiUdTENKmrxaOBLeE,6100
|
|
88
|
+
fastapi_factory_utilities/example/__init__.py,sha256=LEKnPTBcgDyfHeOjlVxjK5lFdFqS-7-mHDuVuM2Jh_Y,206
|
|
89
|
+
fastapi_factory_utilities/example/__main__.py,sha256=Iwp_6rK7Lcv2F-XAKn6xjxQHOWjx2OjgwKAr91tfUfk,135
|
|
90
|
+
fastapi_factory_utilities/example/api/__init__.py,sha256=qI82eeSwVjR6jSkX1pxm8ALv9WPQ_iHurFY4G2K7VzE,554
|
|
91
|
+
fastapi_factory_utilities/example/api/books/__init__.py,sha256=zXARBnjywJwg1XsLbcixYWcHH4uC9mF-kbbX4P8cVgA,160
|
|
92
|
+
fastapi_factory_utilities/example/api/books/responses.py,sha256=21WeD6bdg0MCD_0vRHwmsL4W79iDcG9NnDLemXysc84,540
|
|
93
|
+
fastapi_factory_utilities/example/api/books/routes.py,sha256=bwg8Bhvoj9vx2SdwunzFS-Z3cHECtjl_yGdo8MfiGEM,1529
|
|
94
|
+
fastapi_factory_utilities/example/app.py,sha256=MInt71wnDEC9yqVJeT3hChj7DRmg7sI3Ta0KkfubdyU,2076
|
|
95
|
+
fastapi_factory_utilities/example/application.yaml,sha256=5xRyFSuMxmgZ5Mikai94UqKYJ7PxJp8omlXobTjv14M,485
|
|
96
|
+
fastapi_factory_utilities/example/entities/books/__init__.py,sha256=cpTMhLpenb359lOT9HHUv6DzKX8fKl4WCzcsB3ddk6Q,185
|
|
97
|
+
fastapi_factory_utilities/example/entities/books/entities.py,sha256=rLE01lE7U6WizrD5ZHMRwkynd8_dWF6DltBFH61f-Do,405
|
|
98
|
+
fastapi_factory_utilities/example/entities/books/enums.py,sha256=lXYUvhIkT1pi0teflMpnqeafeiBZMokyWxoFLgzV6a8,330
|
|
99
|
+
fastapi_factory_utilities/example/entities/books/types.py,sha256=7LYGPu-CcI3noIORJyIZlVF-CBugWPXEqgDzWrO3XmQ,1558
|
|
100
|
+
fastapi_factory_utilities/example/models/__init__.py,sha256=RJmp3R9bhbQv7n0WOlsHP65LqbEs_DjF9hzYKwYTRGo,22
|
|
101
|
+
fastapi_factory_utilities/example/models/books/__init__.py,sha256=IPS3rLLnZncV-VAxgsipxUD7l4r04ewo_Hx2Naj2lT0,181
|
|
102
|
+
fastapi_factory_utilities/example/models/books/document.py,sha256=lYJfMGr5GqEEsn7L--PFs75hC2q-jQx77wl7EhTrp5U,568
|
|
103
|
+
fastapi_factory_utilities/example/models/books/repository.py,sha256=7K63uAsSEGZ2EXqufU4Tc8KpymgXK8JX8WjAE2Sw8ok,387
|
|
104
|
+
fastapi_factory_utilities/example/services/books/__init__.py,sha256=Z06yNRoA7Zg3TGN-Q9rrvJg6Bbx-qJw661MVwukV6vQ,148
|
|
105
|
+
fastapi_factory_utilities/example/services/books/services.py,sha256=-x7d4hotUWLzWo5uImMjFmtNcSTHwWv2bfttIbYYKbA,5380
|
|
106
|
+
fastapi_factory_utilities/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
107
|
+
fastapi_factory_utilities-0.8.2.dist-info/METADATA,sha256=9Di7jC-8E-jnDnihtQw271-alJQBgyCo4VRO4BiHRbc,3741
|
|
108
|
+
fastapi_factory_utilities-0.8.2.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
109
|
+
fastapi_factory_utilities-0.8.2.dist-info/entry_points.txt,sha256=IK0VcBexXo4uXQmTrbfhhnnfq4GmXPRn0GBB8hzlsq4,101
|
|
110
|
+
fastapi_factory_utilities-0.8.2.dist-info/licenses/LICENSE,sha256=iO1nLzMMst6vEiqgSUrfrbetM7b0bvdzXhbed5tqG8o,1074
|
|
111
|
+
fastapi_factory_utilities-0.8.2.dist-info/RECORD,,
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"""Provide PluginManager."""
|
|
2
|
-
|
|
3
|
-
from .exceptions import (
|
|
4
|
-
InvalidPluginError,
|
|
5
|
-
PluginManagerError,
|
|
6
|
-
PluginPreConditionNotMetError,
|
|
7
|
-
)
|
|
8
|
-
from .plugin_manager import PluginManager
|
|
9
|
-
|
|
10
|
-
__all__: list[str] = [
|
|
11
|
-
"PluginManager",
|
|
12
|
-
"PluginManagerError",
|
|
13
|
-
"InvalidPluginError",
|
|
14
|
-
"PluginPreConditionNotMetError",
|
|
15
|
-
]
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"""Provide the exceptions for the plugin manager."""
|
|
2
|
-
|
|
3
|
-
from fastapi_factory_utilities.core.exceptions import FastAPIFactoryUtilitiesError
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class PluginManagerError(FastAPIFactoryUtilitiesError):
|
|
7
|
-
"""Generic plugin manager error."""
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class InvalidPluginError(PluginManagerError):
|
|
11
|
-
"""The plugin is invalid."""
|
|
12
|
-
|
|
13
|
-
def __init__(self, plugin_name: str, message: str) -> None:
|
|
14
|
-
"""Instantiate the exception.
|
|
15
|
-
|
|
16
|
-
Args:
|
|
17
|
-
plugin_name (str): The plugin name.
|
|
18
|
-
message (str): The message
|
|
19
|
-
"""
|
|
20
|
-
super().__init__(message=f"Invalid plugin: {plugin_name}, {message}")
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class PluginPreConditionNotMetError(PluginManagerError):
|
|
24
|
-
"""The plugin pre-condition is not met."""
|
|
25
|
-
|
|
26
|
-
def __init__(self, plugin_name: str, message: str) -> None:
|
|
27
|
-
"""Instantiate the exception.
|
|
28
|
-
|
|
29
|
-
Args:
|
|
30
|
-
plugin_name (str): The plugin name.
|
|
31
|
-
message (str): The message
|
|
32
|
-
"""
|
|
33
|
-
super().__init__(message=f"Plugin pre-condition not met: {plugin_name}, {message}")
|