spakky-fastapi 0.7.15__tar.gz → 0.7.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.
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/PKG-INFO +2 -2
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/pyproject.toml +2 -2
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/spakky_fastapi/jwt_auth.py +6 -22
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/spakky_fastapi/post_processor.py +1 -1
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/README.md +0 -0
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/spakky_fastapi/__init__.py +0 -0
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/spakky_fastapi/error.py +0 -0
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/spakky_fastapi/middlewares/__init__.py +0 -0
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/spakky_fastapi/middlewares/error_handling.py +0 -0
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/spakky_fastapi/py.typed +0 -0
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/spakky_fastapi/routing.py +0 -0
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/spakky_fastapi/stereotypes/__init__.py +0 -0
- {spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/spakky_fastapi/stereotypes/api_controller.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: spakky-fastapi
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.17
|
4
4
|
Summary: Highly abstracted Framework core to use DDD & DI/IoC & AOP & Etc...
|
5
5
|
Author: Spakky
|
6
6
|
Author-email: sejong418@icloud.com
|
@@ -11,7 +11,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.12
|
12
12
|
Requires-Dist: fastapi (>=0.109.2,<0.110.0)
|
13
13
|
Requires-Dist: orjson (>=3.9.15,<4.0.0)
|
14
|
-
Requires-Dist: spakky-core (>=0.7.
|
14
|
+
Requires-Dist: spakky-core (>=0.7.13)
|
15
15
|
Requires-Dist: websockets (>=12.0,<13.0)
|
16
16
|
Description-Content-Type: text/markdown
|
17
17
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "spakky-fastapi"
|
3
|
-
version = "0.7.
|
3
|
+
version = "0.7.17"
|
4
4
|
description = "Highly abstracted Framework core to use DDD & DI/IoC & AOP & Etc..."
|
5
5
|
authors = ["Spakky <sejong418@icloud.com>"]
|
6
6
|
readme = "README.md"
|
@@ -12,7 +12,7 @@ build-backend = "poetry.core.masonry.api"
|
|
12
12
|
[tool.poetry.dependencies]
|
13
13
|
python = ">=3.10"
|
14
14
|
fastapi = "^0.109.2"
|
15
|
-
spakky-core = ">=0.7.
|
15
|
+
spakky-core = ">=0.7.13"
|
16
16
|
websockets = "^12.0"
|
17
17
|
orjson = "^3.9.15"
|
18
18
|
|
@@ -1,5 +1,4 @@
|
|
1
|
-
from typing import Any, TypeVar,
|
2
|
-
from inspect import signature
|
1
|
+
from typing import Any, TypeVar, Callable, Annotated, Awaitable, TypeAlias, Concatenate
|
3
2
|
from logging import Logger
|
4
3
|
from dataclasses import InitVar, field, dataclass
|
5
4
|
|
@@ -25,20 +24,7 @@ class AuthenticationFailedError(SpakkyAOPError):
|
|
25
24
|
message = "사용자 인증에 실패했습니다."
|
26
25
|
|
27
26
|
|
28
|
-
|
29
|
-
class IAuthenticatedFunction(Protocol[P, R_co]):
|
30
|
-
__defaults__: tuple[Any, ...] | None
|
31
|
-
__kwdefaults__: dict[str, Any] | None
|
32
|
-
|
33
|
-
# pylint: disable=no-self-argument
|
34
|
-
def __call__(
|
35
|
-
self_, # type: ignore
|
36
|
-
self: Any,
|
37
|
-
token: JWT,
|
38
|
-
*args: P.args,
|
39
|
-
**kwargs: P.kwargs,
|
40
|
-
) -> Awaitable[R_co]:
|
41
|
-
raise NotImplementedError
|
27
|
+
IAuthenticatedFunction: TypeAlias = Callable[Concatenate[Any, JWT, P], Awaitable[R_co]]
|
42
28
|
|
43
29
|
|
44
30
|
@dataclass
|
@@ -52,12 +38,10 @@ class JWTAuth(FunctionAnnotation):
|
|
52
38
|
def __call__(
|
53
39
|
self, obj: IAuthenticatedFunction[P, R_co]
|
54
40
|
) -> IAuthenticatedFunction[P, R_co]:
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
extra = tuple(Depends() for x in parameters[1:] if x.name != "token")
|
60
|
-
obj.__defaults__ = (Depends(self.authenticator),) + extra
|
41
|
+
obj.__annotations__ = {
|
42
|
+
k: Annotated[JWT, Depends(self.authenticator)] if v == JWT else v
|
43
|
+
for k, v in obj.__annotations__.items()
|
44
|
+
}
|
61
45
|
return super().__call__(obj)
|
62
46
|
|
63
47
|
|
@@ -26,7 +26,7 @@ class FastAPIBeanPostProcessor(IBeanPostProcessor):
|
|
26
26
|
return bean
|
27
27
|
controller = ApiController.single(bean)
|
28
28
|
router: APIRouter = APIRouter(prefix=controller.prefix, tags=controller.tags)
|
29
|
-
for name, method in getmembers(bean):
|
29
|
+
for name, method in getmembers(bean, callable):
|
30
30
|
route: Route | None = Route.single_or_none(method)
|
31
31
|
websocket_route: WebSocketRoute | None = WebSocketRoute.single_or_none(method)
|
32
32
|
if route is None and websocket_route is None:
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/spakky_fastapi/middlewares/error_handling.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{spakky_fastapi-0.7.15 → spakky_fastapi-0.7.17}/spakky_fastapi/stereotypes/api_controller.py
RENAMED
File without changes
|