spakky-fastapi 0.15.0__py3-none-any.whl → 0.16.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.
@@ -32,7 +32,7 @@ IAuthenticatedFunction: TypeAlias = (
32
32
 
33
33
 
34
34
  @dataclass
35
- class JWTAuth(FunctionAnnotation):
35
+ class Auth(FunctionAnnotation):
36
36
  token_url: InitVar[str]
37
37
  authenticator: OAuth2PasswordBearer = field(init=False)
38
38
  token_keywords: list[str] = field(init=False, default_factory=list)
@@ -52,7 +52,7 @@ class JWTAuth(FunctionAnnotation):
52
52
 
53
53
  @Order(1)
54
54
  @Aspect()
55
- class JWTAuthAdvisor(IAdvisor):
55
+ class AuthenticationAdvisor(IAdvisor):
56
56
  __logger: Logger
57
57
  __key: Key
58
58
 
@@ -61,9 +61,9 @@ class JWTAuthAdvisor(IAdvisor):
61
61
  self.__logger = logger
62
62
  self.__key = key
63
63
 
64
- @Around(lambda x: JWTAuth.contains(x) and not iscoroutinefunction(x))
64
+ @Around(lambda x: Auth.contains(x) and not iscoroutinefunction(x))
65
65
  def around(self, joinpoint: Func, *args: Any, **kwargs: Any) -> Any:
66
- annotation: JWTAuth = JWTAuth.single(joinpoint)
66
+ annotation: Auth = Auth.single(joinpoint)
67
67
  for keyword in annotation.token_keywords:
68
68
  token: str = kwargs[keyword]
69
69
  try:
@@ -81,7 +81,7 @@ class JWTAuthAdvisor(IAdvisor):
81
81
 
82
82
  @Order(1)
83
83
  @AsyncAspect()
84
- class AsyncJWTAuthAdvisor(IAsyncAdvisor):
84
+ class AsyncAuthenticationAdvisor(IAsyncAdvisor):
85
85
  __logger: Logger
86
86
  __key: Key
87
87
 
@@ -90,9 +90,9 @@ class AsyncJWTAuthAdvisor(IAsyncAdvisor):
90
90
  self.__logger = logger
91
91
  self.__key = key
92
92
 
93
- @Around(lambda x: JWTAuth.contains(x) and iscoroutinefunction(x))
93
+ @Around(lambda x: Auth.contains(x) and iscoroutinefunction(x))
94
94
  async def around_async(self, joinpoint: AsyncFunc, *args: Any, **kwargs: Any) -> Any:
95
- annotation: JWTAuth = JWTAuth.single(joinpoint)
95
+ annotation: Auth = Auth.single(joinpoint)
96
96
  for keyword in annotation.token_keywords:
97
97
  token: str = kwargs[keyword]
98
98
  try:
@@ -1,10 +1,13 @@
1
1
  from spakky.application.interfaces.pluggable import IPluggable
2
2
  from spakky.application.interfaces.registry import IRegistry
3
3
 
4
- from spakky_fastapi.aspects.jwt_auth import AsyncJWTAuthAdvisor, JWTAuthAdvisor
4
+ from spakky_fastapi.extensions.auth import (
5
+ AsyncAuthenticationAdvisor,
6
+ AuthenticationAdvisor,
7
+ )
5
8
 
6
9
 
7
10
  class JWTAuthPlugin(IPluggable):
8
11
  def register(self, registry: IRegistry) -> None:
9
- registry.register_bean(JWTAuthAdvisor)
10
- registry.register_bean(AsyncJWTAuthAdvisor)
12
+ registry.register_bean(AuthenticationAdvisor)
13
+ registry.register_bean(AsyncAuthenticationAdvisor)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spakky-fastapi
3
- Version: 0.15.0
3
+ Version: 0.16.0
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
@@ -1,16 +1,16 @@
1
1
  spakky_fastapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- spakky_fastapi/aspects/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- spakky_fastapi/aspects/jwt_auth.py,sha256=1OSpCQDWiBzseH5IPfgutjQCNKabnNFMCRNQRBoENE8,4007
4
2
  spakky_fastapi/error.py,sha256=SWyNZk1kxbTCiy-tLxB8saLpX5rBxwvy7q7JRCtNQV0,1124
3
+ spakky_fastapi/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ spakky_fastapi/extensions/auth.py,sha256=-loxztkj4ZgX-ybPTCCzaiI83UodgAoV7umVI8f6MYs,4000
5
5
  spakky_fastapi/middlewares/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  spakky_fastapi/middlewares/error_handling.py,sha256=SeqEZeGYdRvQTAcbVlcP6bGHXGi5RL9S6ZnsG6PDgTE,1712
7
7
  spakky_fastapi/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  spakky_fastapi/plugins/fast_api.py,sha256=lSXABplfyl3jASaT3NV4Z1hC-EtHqilXqyN98Y756v4,652
9
- spakky_fastapi/plugins/jwt_auth.py,sha256=UN05gI9cYHrQERIYYigLqsFMxOdgvceusg6AZO1KN_Y,392
9
+ spakky_fastapi/plugins/jwt_auth.py,sha256=eeiFo6xVjue2a8TwP73q2OmenrHXkSRoh6qfsxVeSIw,432
10
10
  spakky_fastapi/post_processor.py,sha256=gTUubo-vOy_uB6rytT8vuNuRgQV2fOdsDqPx93cf8oI,2983
11
11
  spakky_fastapi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  spakky_fastapi/stereotypes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  spakky_fastapi/stereotypes/api_controller.py,sha256=NM0gyTQfuHnENtvyfm5T9Y427gQdxdUcVYDzAXryF2M,19320
14
- spakky_fastapi-0.15.0.dist-info/METADATA,sha256=gwHfQKtmaRpSs5TtS5B0CE6fdMTIVVCDLCwAjDgoubU,1706
15
- spakky_fastapi-0.15.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
16
- spakky_fastapi-0.15.0.dist-info/RECORD,,
14
+ spakky_fastapi-0.16.0.dist-info/METADATA,sha256=k_S804v2rPG81BGMz-P8uDMPSmSmx01haTDI7krY1q4,1706
15
+ spakky_fastapi-0.16.0.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
16
+ spakky_fastapi-0.16.0.dist-info/RECORD,,
File without changes