coderfastapi 5.5.0__tar.gz → 5.6.0__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.5.0 → coderfastapi-5.6.0}/PKG-INFO +1 -1
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/decorators/pagination.py +2 -0
- coderfastapi-5.6.0/coderfastapi/lib/decorators/util.py +19 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/router.py +7 -17
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi.egg-info/PKG-INFO +1 -1
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi.egg-info/SOURCES.txt +1 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/pyproject.toml +2 -2
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/README.md +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/handlers/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/handlers/version.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/decorators/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/acl.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/policies/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/policies/authentication/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/policies/authentication/jwt/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/policies/authentication/jwt/providers/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/policies/authentication/jwt/providers/expiration.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/policies/authentication/jwt/providers/recovery.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/policies/authentication/jwt/providers/user.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/policies/authentication/session.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/policies/authorization/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/policies/authorization/user.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/session/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/session/base.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/security/session/user.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/signature.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/validation/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/validation/schemas/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/validation/schemas/aggregation.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/validation/schemas/pagination.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/validation/schemas/query.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/validation/schemas/request.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/validation/schemas/version.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/logging/__init__.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/logging/context.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/logging/filter.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/logging/middleware.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi/test.py +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi.egg-info/dependency_links.txt +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi.egg-info/requires.txt +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/coderfastapi.egg-info/top_level.txt +0 -0
- {coderfastapi-5.5.0 → coderfastapi-5.6.0}/setup.cfg +0 -0
|
@@ -7,6 +7,7 @@ from codercore.types import SequentialCollection
|
|
|
7
7
|
from fastapi import Request, Response
|
|
8
8
|
from fastapi.params import Depends
|
|
9
9
|
|
|
10
|
+
from coderfastapi.lib.decorators.util import propagate_params
|
|
10
11
|
from coderfastapi.lib.signature import copy_parameters
|
|
11
12
|
from coderfastapi.lib.validation.schemas.pagination import DeserializableCursor
|
|
12
13
|
from coderfastapi.lib.validation.schemas.query import QueryParameters
|
|
@@ -39,6 +40,7 @@ def paginate(
|
|
|
39
40
|
else:
|
|
40
41
|
query_schema = kwargs[schema_name]
|
|
41
42
|
|
|
43
|
+
kwargs = propagate_params(func, kwargs, request=request, response=response)
|
|
42
44
|
result = await func(*args, **kwargs)
|
|
43
45
|
links = _build_links(id_attr, query_schema, request, result)
|
|
44
46
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import copy
|
|
2
|
+
import inspect
|
|
3
|
+
from typing import Any, Awaitable, Callable, ParamSpec, TypeVar
|
|
4
|
+
|
|
5
|
+
T = TypeVar("T")
|
|
6
|
+
P = ParamSpec("P")
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def propagate_params(
|
|
10
|
+
func: Callable[P, Awaitable[T] | T],
|
|
11
|
+
kwargs: [str, Any],
|
|
12
|
+
**to_propagate,
|
|
13
|
+
) -> dict[str, Any]:
|
|
14
|
+
new_kwargs = copy.copy(kwargs)
|
|
15
|
+
func_signature = inspect.signature(func)
|
|
16
|
+
for key, value in to_propagate.items():
|
|
17
|
+
if func_signature.parameters.get(key):
|
|
18
|
+
new_kwargs[key] = value
|
|
19
|
+
return new_kwargs
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import copy
|
|
2
1
|
import inspect
|
|
3
2
|
from typing import Any, Awaitable, Callable, ParamSpec, TypeVar
|
|
4
3
|
|
|
5
4
|
from fastapi import APIRouter, Request
|
|
6
5
|
|
|
6
|
+
from coderfastapi.lib.decorators.util import propagate_params
|
|
7
7
|
from coderfastapi.lib.security.acl import ACLProvider
|
|
8
8
|
from coderfastapi.lib.security.policies.authentication import AuthenticationPolicy
|
|
9
9
|
from coderfastapi.lib.security.policies.authorization import AuthorizationPolicy
|
|
@@ -48,7 +48,12 @@ class SecureRouter(APIRouter):
|
|
|
48
48
|
context_acl_provider,
|
|
49
49
|
)
|
|
50
50
|
|
|
51
|
-
kwargs =
|
|
51
|
+
kwargs = propagate_params(
|
|
52
|
+
handler,
|
|
53
|
+
kwargs,
|
|
54
|
+
request=authenticated_request,
|
|
55
|
+
context=context,
|
|
56
|
+
)
|
|
52
57
|
output = handler(*args, **kwargs)
|
|
53
58
|
if inspect.iscoroutine(output):
|
|
54
59
|
output = await output
|
|
@@ -70,21 +75,6 @@ class SecureRouter(APIRouter):
|
|
|
70
75
|
context_acl_provider,
|
|
71
76
|
)
|
|
72
77
|
|
|
73
|
-
@staticmethod
|
|
74
|
-
def _propagate_params(
|
|
75
|
-
func: Callable[P, Awaitable[T] | T],
|
|
76
|
-
kwargs: [str, Any],
|
|
77
|
-
request: Request,
|
|
78
|
-
context: Any | None,
|
|
79
|
-
) -> dict[str, Any]:
|
|
80
|
-
new_kwargs = copy.copy(kwargs)
|
|
81
|
-
func_signature = inspect.signature(func)
|
|
82
|
-
if func_signature.parameters.get("context"):
|
|
83
|
-
new_kwargs["context"] = context
|
|
84
|
-
if func_signature.parameters.get("request"):
|
|
85
|
-
new_kwargs["request"] = request
|
|
86
|
-
return new_kwargs
|
|
87
|
-
|
|
88
78
|
def post(self, *outer_args, **outer_kwargs):
|
|
89
79
|
return lambda func: self._http_method(func, "post", *outer_args, **outer_kwargs)
|
|
90
80
|
|
|
@@ -14,6 +14,7 @@ coderfastapi/lib/router.py
|
|
|
14
14
|
coderfastapi/lib/signature.py
|
|
15
15
|
coderfastapi/lib/decorators/__init__.py
|
|
16
16
|
coderfastapi/lib/decorators/pagination.py
|
|
17
|
+
coderfastapi/lib/decorators/util.py
|
|
17
18
|
coderfastapi/lib/security/__init__.py
|
|
18
19
|
coderfastapi/lib/security/acl.py
|
|
19
20
|
coderfastapi/lib/security/policies/__init__.py
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "coderfastapi"
|
|
7
|
-
version = "5.
|
|
7
|
+
version = "5.6.0"
|
|
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.6.0"
|
|
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.5.0 → coderfastapi-5.6.0}/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.5.0 → coderfastapi-5.6.0}/coderfastapi/lib/validation/schemas/aggregation.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
|