fastapi-mongo-base 0.9.5__tar.gz → 0.9.7__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_mongo_base-0.9.5/src/fastapi_mongo_base.egg-info → fastapi_mongo_base-0.9.7}/PKG-INFO +1 -1
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/pyproject.toml +1 -1
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/core/app_factory.py +17 -14
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/core/middlewares.py +3 -5
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7/src/fastapi_mongo_base.egg-info}/PKG-INFO +1 -1
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/LICENSE.txt +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/README.md +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/setup.cfg +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/__init__.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/cached.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/core/__init__.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/core/config.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/core/db.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/core/enums.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/core/exceptions.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/handlers.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/models.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/routes.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/schemas.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/tasks.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/utils/__init__.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/utils/aionetwork.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/utils/basic.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/utils/bsontools.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/utils/imagetools.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/utils/texttools.py +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base.egg-info/SOURCES.txt +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base.egg-info/dependency_links.txt +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base.egg-info/requires.txt +0 -0
- {fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base.egg-info/top_level.txt +0 -0
{fastapi_mongo_base-0.9.5/src/fastapi_mongo_base.egg-info → fastapi_mongo_base-0.9.7}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: fastapi-mongo-base
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.7
|
|
4
4
|
Summary: A simple boilerplate application, including models and schemas and abstract router, for FastAPI with MongoDB
|
|
5
5
|
Author-email: Mahdi Kiani <mahdikiany@gmail.com>
|
|
6
6
|
Maintainer-email: Mahdi Kiani <mahdikiany@gmail.com>
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "fastapi-mongo-base"
|
|
7
|
-
version = "0.9.
|
|
7
|
+
version = "0.9.7"
|
|
8
8
|
description = "A simple boilerplate application, including models and schemas and abstract router, for FastAPI with MongoDB"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.9"
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/core/app_factory.py
RENAMED
|
@@ -15,6 +15,19 @@ except ImportError:
|
|
|
15
15
|
from .config import Settings
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
async def health(request: fastapi.Request):
|
|
19
|
+
return {
|
|
20
|
+
"status": "up",
|
|
21
|
+
"host": request.url.hostname,
|
|
22
|
+
# "project_name": settings.project_name,
|
|
23
|
+
# "host2": request.base_url.hostname,
|
|
24
|
+
# "original_host":request.headers.get("x-original-host", "!not found!"),
|
|
25
|
+
# "forwarded_host": request.headers.get("X-Forwarded-Host", "forwarded_host"),
|
|
26
|
+
# "forwarded_proto": request.headers.get("X-Forwarded-Proto", "forwarded_proto"),
|
|
27
|
+
# "forwarded_for": request.headers.get("X-Forwarded-For", "forwarded_for"),
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
18
31
|
@asynccontextmanager
|
|
19
32
|
async def lifespan(app: fastapi.FastAPI, worker=None, init_functions=[], settings: Settings = None): # type: ignore
|
|
20
33
|
"""Initialize application services."""
|
|
@@ -116,6 +129,7 @@ def create_app(
|
|
|
116
129
|
original_host_middleware: bool = False,
|
|
117
130
|
request_log_middleware: bool = False,
|
|
118
131
|
log_route: bool = False,
|
|
132
|
+
health_route: bool = True,
|
|
119
133
|
**kwargs,
|
|
120
134
|
) -> fastapi.FastAPI:
|
|
121
135
|
settings.config_logger()
|
|
@@ -160,26 +174,15 @@ def create_app(
|
|
|
160
174
|
**kwargs,
|
|
161
175
|
)
|
|
162
176
|
|
|
163
|
-
async def health(request: fastapi.Request):
|
|
164
|
-
return {
|
|
165
|
-
"status": "up",
|
|
166
|
-
"host": request.url.hostname,
|
|
167
|
-
"project_name": settings.project_name,
|
|
168
|
-
# "host2": request.base_url.hostname,
|
|
169
|
-
# "original_host":request.headers.get("x-original-host", "!not found!"),
|
|
170
|
-
# "forwarded_host": request.headers.get("X-Forwarded-Host", "forwarded_host"),
|
|
171
|
-
# "forwarded_proto": request.headers.get("X-Forwarded-Proto", "forwarded_proto"),
|
|
172
|
-
# "forwarded_for": request.headers.get("X-Forwarded-For", "forwarded_for"),
|
|
173
|
-
}
|
|
174
|
-
|
|
175
177
|
async def logs():
|
|
176
178
|
with open(settings.get_log_config()["info_log_path"], "rb") as f:
|
|
177
179
|
last_100_lines = deque(f, maxlen=100)
|
|
178
180
|
|
|
179
181
|
return [line.decode("utf-8") for line in last_100_lines]
|
|
180
182
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
+
if health_route:
|
|
184
|
+
app.get(f"{base_path}/health")(health)
|
|
185
|
+
if log_route:
|
|
183
186
|
app.get(f"{base_path}/logs", include_in_schema=False)(logs)
|
|
184
187
|
|
|
185
188
|
if serve_coverage:
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/core/middlewares.py
RENAMED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import fastapi
|
|
2
|
-
from fastapi.responses import PlainTextResponse
|
|
3
|
-
from starlette.middleware.base import BaseHTTPMiddleware
|
|
4
|
-
|
|
5
1
|
import logging
|
|
6
2
|
|
|
3
|
+
import fastapi
|
|
7
4
|
from fastapi import Request
|
|
5
|
+
from fastapi.responses import PlainTextResponse
|
|
8
6
|
from starlette.middleware.base import BaseHTTPMiddleware
|
|
9
7
|
|
|
10
8
|
|
|
@@ -27,7 +25,7 @@ class RequestLoggingMiddleware(BaseHTTPMiddleware):
|
|
|
27
25
|
|
|
28
26
|
|
|
29
27
|
class DynamicCORSMiddleware(BaseHTTPMiddleware):
|
|
30
|
-
|
|
28
|
+
|
|
31
29
|
async def get_allowed_origins(self, origin, **kwargs):
|
|
32
30
|
from ufaas_fastapi_business.models import Business
|
|
33
31
|
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7/src/fastapi_mongo_base.egg-info}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: fastapi-mongo-base
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.7
|
|
4
4
|
Summary: A simple boilerplate application, including models and schemas and abstract router, for FastAPI with MongoDB
|
|
5
5
|
Author-email: Mahdi Kiani <mahdikiany@gmail.com>
|
|
6
6
|
Maintainer-email: Mahdi Kiani <mahdikiany@gmail.com>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/core/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/core/exceptions.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/utils/__init__.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/utils/aionetwork.py
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/utils/bsontools.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/utils/imagetools.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base/utils/texttools.py
RENAMED
|
File without changes
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base.egg-info/requires.txt
RENAMED
|
File without changes
|
{fastapi_mongo_base-0.9.5 → fastapi_mongo_base-0.9.7}/src/fastapi_mongo_base.egg-info/top_level.txt
RENAMED
|
File without changes
|