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.
Files changed (19) hide show
  1. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/PKG-INFO +2 -2
  2. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_ext_pkg.egg-info/PKG-INFO +2 -2
  3. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/security/auth.py +9 -2
  4. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/pyproject.toml +1 -1
  5. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/README.md +0 -0
  6. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_ext_pkg.egg-info/SOURCES.txt +0 -0
  7. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_ext_pkg.egg-info/dependency_links.txt +0 -0
  8. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_ext_pkg.egg-info/requires.txt +0 -0
  9. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_ext_pkg.egg-info/top_level.txt +0 -0
  10. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/__init__.py +0 -0
  11. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/databases/__init__.py +0 -0
  12. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/databases/redis.py +0 -0
  13. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/middlewares/__init__.py +0 -0
  14. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/middlewares/remove_cloud_trace_headers.py +0 -0
  15. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/middlewares/remove_path.py +0 -0
  16. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/orm/__init__.py +0 -0
  17. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/orm/sqlalchemy.py +0 -0
  18. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/fastapi_extras/security/__init__.py +0 -0
  19. {fastapi_ext_pkg-0.4.2 → fastapi_ext_pkg-0.4.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: fastapi-ext-pkg
3
- Version: 0.4.2
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.2
1
+ Metadata-Version: 2.4
2
2
  Name: fastapi-ext-pkg
3
- Version: 0.4.2
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
- cached = await cache.get(key) if cache else None
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
- if cache:
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "fastapi-ext-pkg"
7
- version = "0.4.2"
7
+ version = "0.4.4"
8
8
  description = "A well-tailored utility set for FastAPI."
9
9
  readme = {file = "README.md", content-type = "text/markdown"}
10
10
  authors = [