fastapi-ext-pkg 0.4.2__tar.gz → 0.4.4__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.
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/PKG-INFO +2 -2
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_ext_pkg.egg-info/PKG-INFO +2 -2
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/security/auth.py +9 -2
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/pyproject.toml +1 -1
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/README.md +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_ext_pkg.egg-info/SOURCES.txt +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_ext_pkg.egg-info/dependency_links.txt +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_ext_pkg.egg-info/requires.txt +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_ext_pkg.egg-info/top_level.txt +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/__init__.py +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/databases/__init__.py +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/databases/redis.py +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/middlewares/__init__.py +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/middlewares/remove_cloud_trace_headers.py +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/middlewares/remove_path.py +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/orm/__init__.py +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/orm/sqlalchemy.py +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/security/__init__.py +0 -0
- {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi-ext-pkg
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: A well-tailored utility set for FastAPI.
|
|
5
5
|
Author-email: Dotz Developers <devs-dotz@dotz.com>
|
|
6
6
|
Project-URL: Repository, https://github.com/DotzInc/fastapi-ext-pkg
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: fastapi-ext-pkg
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: A well-tailored utility set for FastAPI.
|
|
5
5
|
Author-email: Dotz Developers <devs-dotz@dotz.com>
|
|
6
6
|
Project-URL: Repository, https://github.com/DotzInc/fastapi-ext-pkg
|
|
@@ -55,7 +55,12 @@ def remote_authorization(
|
|
|
55
55
|
cache: Annotated[Optional[Cache], Depends(cache_gen)],
|
|
56
56
|
) -> Any:
|
|
57
57
|
key = keygen(token, prefix="authorizer:")
|
|
58
|
-
|
|
58
|
+
|
|
59
|
+
cached = None
|
|
60
|
+
try:
|
|
61
|
+
cached = await cache.get(key)
|
|
62
|
+
except Exception as cache_error:
|
|
63
|
+
logger.warning("Cache get failed, proceeding without cache: %s", cache_error)
|
|
59
64
|
|
|
60
65
|
if cached:
|
|
61
66
|
cached = json.loads(cached)
|
|
@@ -85,9 +90,11 @@ def remote_authorization(
|
|
|
85
90
|
authorized = response.status_code == status.HTTP_200_OK
|
|
86
91
|
context = response.json()
|
|
87
92
|
|
|
88
|
-
|
|
93
|
+
try:
|
|
89
94
|
value = json.dumps({"authorized": authorized, "context": context})
|
|
90
95
|
await cache.set(key, value, cache_ttl)
|
|
96
|
+
except Exception as cache_error:
|
|
97
|
+
logger.warning("Cache set failed, proceeding without cache: %s", cache_error)
|
|
91
98
|
|
|
92
99
|
if not authorized:
|
|
93
100
|
raise UNAUTHORIZED
|
|
File without changes
|
|
File without changes
|
{fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_ext_pkg.egg-info/dependency_links.txt
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
|