fastapi-ext-pkg 0.4.0__tar.gz → 0.4.2__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.0 → fastapi_ext_pkg-0.4.2}/PKG-INFO +2 -2
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_ext_pkg.egg-info/PKG-INFO +2 -2
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_ext_pkg.egg-info/SOURCES.txt +1 -0
- fastapi_ext_pkg-0.4.2/fastapi_extras/middlewares/remove_cloud_trace_headers.py +16 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_extras/security/auth.py +2 -1
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/pyproject.toml +1 -1
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/README.md +0 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_ext_pkg.egg-info/dependency_links.txt +0 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_ext_pkg.egg-info/requires.txt +0 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_ext_pkg.egg-info/top_level.txt +0 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_extras/__init__.py +0 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_extras/databases/__init__.py +0 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_extras/databases/redis.py +0 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_extras/middlewares/__init__.py +0 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_extras/middlewares/remove_path.py +0 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_extras/orm/__init__.py +0 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_extras/orm/sqlalchemy.py +0 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/fastapi_extras/security/__init__.py +0 -0
- {fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: fastapi-ext-pkg
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
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.2
|
|
2
2
|
Name: fastapi-ext-pkg
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
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
|
|
@@ -9,6 +9,7 @@ fastapi_extras/__init__.py
|
|
|
9
9
|
fastapi_extras/databases/__init__.py
|
|
10
10
|
fastapi_extras/databases/redis.py
|
|
11
11
|
fastapi_extras/middlewares/__init__.py
|
|
12
|
+
fastapi_extras/middlewares/remove_cloud_trace_headers.py
|
|
12
13
|
fastapi_extras/middlewares/remove_path.py
|
|
13
14
|
fastapi_extras/orm/__init__.py
|
|
14
15
|
fastapi_extras/orm/sqlalchemy.py
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from fastapi import Request
|
|
2
|
+
from starlette.middleware.base import BaseHTTPMiddleware
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class RemoveCloudTraceHeadersMiddleware(BaseHTTPMiddleware):
|
|
6
|
+
async def dispatch(self, request: Request, call_next):
|
|
7
|
+
headers = dict(request.headers)
|
|
8
|
+
headers.pop("x-cloud-trace-context", None)
|
|
9
|
+
headers.pop("traceparent", None)
|
|
10
|
+
|
|
11
|
+
request.scope["headers"] = [
|
|
12
|
+
(key.encode(), value.encode()) for key, value in headers.items()
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
response = await call_next(request)
|
|
16
|
+
return response
|
|
@@ -11,6 +11,7 @@ from pydantic import AnyHttpUrl
|
|
|
11
11
|
from typing_extensions import Annotated
|
|
12
12
|
|
|
13
13
|
logger = logging.getLogger(__name__)
|
|
14
|
+
ssl_context = httpx.create_ssl_context()
|
|
14
15
|
|
|
15
16
|
UNAUTHORIZED = HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid credentials")
|
|
16
17
|
DEFAULT_SCHEME = APIKeyHeader(name="Authorization")
|
|
@@ -74,7 +75,7 @@ def remote_authorization(
|
|
|
74
75
|
"cookies": request.cookies,
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
async with httpx.AsyncClient() as client:
|
|
78
|
+
async with httpx.AsyncClient(verify=ssl_context) as client:
|
|
78
79
|
try:
|
|
79
80
|
response = await client.post(str(url), json=info, **kwargs)
|
|
80
81
|
except httpx.HTTPError as http_error:
|
|
File without changes
|
{fastapi_ext_pkg-0.4.0 → fastapi_ext_pkg-0.4.2}/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
|