coderfastapi 5.9.0__tar.gz → 5.10.1__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.
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/PKG-INFO +2 -2
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/decorators/__init__.py +12 -8
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/decorators/pagination.py +1 -1
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/policies/authentication/jwt/__init__.py +1 -1
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi.egg-info/PKG-INFO +2 -2
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/pyproject.toml +2 -2
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/README.md +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/__init__.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/handlers/__init__.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/handlers/version.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/__init__.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/decorators/util.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/router.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/__init__.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/acl.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/policies/__init__.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/policies/authentication/__init__.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/policies/authentication/jwt/providers/__init__.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/policies/authentication/jwt/providers/expiration.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/policies/authentication/jwt/providers/recovery.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/policies/authentication/jwt/providers/user.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/policies/authentication/session.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/policies/authorization/__init__.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/policies/authorization/user.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/session/__init__.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/session/base.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/session/user.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/signature.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/validation/__init__.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/validation/schemas/__init__.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/validation/schemas/aggregation.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/validation/schemas/pagination.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/validation/schemas/query.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/validation/schemas/request.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/validation/schemas/version.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/logging/__init__.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/logging/context.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/logging/filter.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/logging/middleware.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/test.py +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi.egg-info/SOURCES.txt +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi.egg-info/dependency_links.txt +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi.egg-info/requires.txt +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi.egg-info/top_level.txt +0 -0
- {coderfastapi-5.9.0 → coderfastapi-5.10.1}/setup.cfg +0 -0
|
@@ -10,20 +10,24 @@ T = TypeVar("T")
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def http_require(
|
|
13
|
-
entity_name: str,
|
|
13
|
+
entity_name: str, boolean: bool = False
|
|
14
14
|
) -> Callable[[Callable[..., Awaitable[Optional[T]]]], Callable[..., Awaitable[T]]]:
|
|
15
15
|
def decorate(
|
|
16
|
-
func: Callable[..., Awaitable[Optional[T]]]
|
|
16
|
+
func: Callable[..., Awaitable[Optional[T]]],
|
|
17
17
|
) -> Callable[..., Awaitable[T]]:
|
|
18
18
|
@wraps(func)
|
|
19
19
|
async def wrapper(*args, **kwargs) -> T:
|
|
20
20
|
entity = await func(*args, **kwargs)
|
|
21
|
-
if
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
if boolean:
|
|
22
|
+
if entity is True:
|
|
23
|
+
return entity
|
|
24
|
+
else:
|
|
25
|
+
if entity is not None:
|
|
26
|
+
return entity
|
|
27
|
+
raise HTTPException(
|
|
28
|
+
status_code=HTTPStatus.NOT_FOUND,
|
|
29
|
+
detail=f"The {entity_name} is not found.",
|
|
30
|
+
)
|
|
27
31
|
|
|
28
32
|
return wrapper
|
|
29
33
|
|
|
@@ -24,7 +24,7 @@ def paginate(
|
|
|
24
24
|
Callable[[Request, Response, ...], Awaitable[Entities]],
|
|
25
25
|
]:
|
|
26
26
|
def decorate(
|
|
27
|
-
func: Callable[..., Awaitable[Entities]]
|
|
27
|
+
func: Callable[..., Awaitable[Entities]],
|
|
28
28
|
) -> Callable[[Request, Response, ...], Awaitable[Entities]]:
|
|
29
29
|
func_signature = signature(func)
|
|
30
30
|
|
|
@@ -54,7 +54,7 @@ class JWTAuthenticationPolicy(AuthenticationPolicy):
|
|
|
54
54
|
|
|
55
55
|
@staticmethod
|
|
56
56
|
def _get_auth_method_and_token(
|
|
57
|
-
headers: dict[str, Any]
|
|
57
|
+
headers: dict[str, Any],
|
|
58
58
|
) -> tuple[str, str] | tuple[None, None]:
|
|
59
59
|
try:
|
|
60
60
|
return get_auth_method_and_token(headers["authorization"])
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "coderfastapi"
|
|
7
|
-
version = "5.
|
|
7
|
+
version = "5.10.1"
|
|
8
8
|
description = "coderfastapi"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Code R", email = "hello@coderstudio.dev" }]
|
|
@@ -33,7 +33,7 @@ dev = [
|
|
|
33
33
|
]
|
|
34
34
|
|
|
35
35
|
[tool.bumpver]
|
|
36
|
-
current_version = "5.
|
|
36
|
+
current_version = "5.10.1"
|
|
37
37
|
version_pattern = "MAJOR.MINOR.PATCH"
|
|
38
38
|
commit_message = "bump version {old_version} -> {new_version}"
|
|
39
39
|
commit = true
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/security/policies/authorization/user.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/validation/schemas/aggregation.py
RENAMED
|
File without changes
|
{coderfastapi-5.9.0 → coderfastapi-5.10.1}/coderfastapi/lib/validation/schemas/pagination.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|