spakky-fastapi 0.7.8__py3-none-any.whl → 0.7.10__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.
@@ -8,6 +8,7 @@ from fastapi.security import OAuth2PasswordBearer
8
8
  from spakky.aop.advice import Around
9
9
  from spakky.aop.advisor import IAsyncAdvisor
10
10
  from spakky.aop.aspect import AsyncAspect
11
+ from spakky.aop.order import Order
11
12
  from spakky.bean.autowired import autowired
12
13
  from spakky.core.annotation import FunctionAnnotation
13
14
  from spakky.core.types import AsyncFunc, P
@@ -49,11 +50,12 @@ class JWTAuth(FunctionAnnotation):
49
50
  if obj.__defaults__ is not None:
50
51
  extra = obj.__defaults__
51
52
  else:
52
- extra = tuple(Body() for x in parameters[1:] if x.name != "token")
53
+ extra = tuple([Body() for x in parameters[1:] if x.name != "token"])
53
54
  obj.__defaults__ = (Depends(self.authenticator),) + extra
54
55
  return super().__call__(obj)
55
56
 
56
57
 
58
+ @Order(1)
57
59
  @AsyncAspect()
58
60
  class AsyncJWTAuthAdvisor(IAsyncAdvisor):
59
61
  __logger: Logger
@@ -25,7 +25,7 @@ class FastAPIBeanPostProcessor(IBeanPostProcessor):
25
25
  if not Controller.contains(bean):
26
26
  return bean
27
27
  controller = Controller.single(bean)
28
- router: APIRouter = APIRouter(prefix=controller.prefix)
28
+ router: APIRouter = APIRouter(prefix=controller.prefix, tags=[controller.prefix])
29
29
  for name, method in getmembers(bean):
30
30
  route: Route | None = Route.single_or_none(method)
31
31
  websocket_route: WebSocketRoute | None = WebSocketRoute.single_or_none(method)
@@ -33,7 +33,7 @@ class FastAPIBeanPostProcessor(IBeanPostProcessor):
33
33
  continue
34
34
  if route is not None:
35
35
  self.__logger.info(
36
- f"[{type(self).__name__}] {route.methods} {controller.prefix}{route.path} -> {method.__qualname__}"
36
+ f"[{type(self).__name__}] {route.methods!r} {controller.prefix}{route.path} -> {method.__qualname__}"
37
37
  )
38
38
  if route.name is None:
39
39
  route.name = " ".join([x.capitalize() for x in name.split("_")])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spakky-fastapi
3
- Version: 0.7.8
3
+ Version: 0.7.10
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
@@ -10,7 +10,7 @@ Classifier: Programming Language :: Python :: 3.10
10
10
  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
- Requires-Dist: spakky-core (>=0.7.8)
13
+ Requires-Dist: spakky-core (>=0.7.10)
14
14
  Requires-Dist: websockets (>=12.0,<13.0)
15
15
  Description-Content-Type: text/markdown
16
16
 
@@ -0,0 +1,9 @@
1
+ spakky_fastapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ spakky_fastapi/error.py,sha256=fAJuCZPxARY0SBhG9b-xsa2nvfXD7P49jZG1BzhRs3I,99
3
+ spakky_fastapi/jwt_auth.py,sha256=5yN1O2whWnJiXDOLbtH8JCrb90zftYBRSMdR5v18LQ0,2927
4
+ spakky_fastapi/post_processor.py,sha256=Vog0vGuSbYlcOuLbiYcooh5izIoNPLolbOkwilCUp9g,2861
5
+ spakky_fastapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ spakky_fastapi/routing.py,sha256=3OhnnDIzaDeNhuIMWpPG17--98ti6LsgdfENsWr332g,19181
7
+ spakky_fastapi-0.7.10.dist-info/METADATA,sha256=w3uUItLQaClQ-c8Y_qGtlsP8FajftIiRqiCHlLzDA-o,1662
8
+ spakky_fastapi-0.7.10.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
9
+ spakky_fastapi-0.7.10.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- spakky_fastapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- spakky_fastapi/error.py,sha256=fAJuCZPxARY0SBhG9b-xsa2nvfXD7P49jZG1BzhRs3I,99
3
- spakky_fastapi/jwt_auth.py,sha256=9P_qG6yoCVQb3xYHxtY9Wdh77faJSSjUoJ6P-K5j0A0,2880
4
- spakky_fastapi/post_processor.py,sha256=xTKJgsX4pEMDFZRl_uVac7HTYrc2q2ylXDM3iQYVRtA,2833
5
- spakky_fastapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- spakky_fastapi/routing.py,sha256=3OhnnDIzaDeNhuIMWpPG17--98ti6LsgdfENsWr332g,19181
7
- spakky_fastapi-0.7.8.dist-info/METADATA,sha256=8KMtvMN_-R8zsW7iH1pcr1JGk0tc91owStPdsHpOFeM,1660
8
- spakky_fastapi-0.7.8.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
9
- spakky_fastapi-0.7.8.dist-info/RECORD,,