quipus-generate 0.1.18__tar.gz → 0.1.20__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.
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/LICENSE +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/PKG-INFO +1 -1
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/README.md +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/amautta_project/git_generator.py +1 -1
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/amautta_project/microservice_generator.py +32 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/quipus_generate.egg-info/PKG-INFO +1 -1
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/setup.py +1 -1
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/amautta_project/__init__.py +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/amautta_project/cli.py +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/amautta_project/docker_modified.py +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/amautta_project/entity_generator.py +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/amautta_project/main_modified.py +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/amautta_project/migration_generator.py +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/amautta_project/proyect_generator.py +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/amautta_project/readme_modified.py +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/amautta_project/site_generator.py +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/quipus_generate.egg-info/SOURCES.txt +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/quipus_generate.egg-info/dependency_links.txt +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/quipus_generate.egg-info/entry_points.txt +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/quipus_generate.egg-info/requires.txt +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/quipus_generate.egg-info/top_level.txt +0 -0
- {quipus_generate-0.1.18 → quipus_generate-0.1.20}/setup.cfg +0 -0
File without changes
|
File without changes
|
@@ -13,16 +13,21 @@ def create(name):
|
|
13
13
|
"app/Traits",
|
14
14
|
"config",
|
15
15
|
"database",
|
16
|
+
"middleware",
|
16
17
|
"database/migrations",
|
17
18
|
]
|
18
19
|
|
19
20
|
archivos = {
|
20
21
|
'.env': (
|
22
|
+
"# Configuración de la base de datos\n"
|
21
23
|
"DB_USER=postgres\n"
|
22
24
|
"DB_PASSWORD=postgres\n"
|
23
25
|
"DB_HOST=db\n"
|
24
26
|
"DB_PORT=5432\n"
|
25
27
|
"DB_NAME=exampledb\n"
|
28
|
+
"\n"
|
29
|
+
"# Configuración de Token de validación\n"
|
30
|
+
"SECRET_TOKEN=123456789\n"
|
26
31
|
),
|
27
32
|
'alembic.ini': (
|
28
33
|
"[alembic]\n"
|
@@ -105,8 +110,14 @@ def create(name):
|
|
105
110
|
'app/main.py': (
|
106
111
|
"from fastapi import FastAPI\n"
|
107
112
|
"\n"
|
113
|
+
"# This file is part of the middleware project.\n"
|
114
|
+
"from middleware.validation import Validation as ValidationMiddleware\n"
|
115
|
+
"\n"
|
108
116
|
"run = FastAPI()\n"
|
109
117
|
"\n"
|
118
|
+
"# Middleware for token validation\n"
|
119
|
+
"run.add_middleware(ValidationMiddleware)\n"
|
120
|
+
"\n"
|
110
121
|
"@run.get(\"/\")\n"
|
111
122
|
"async def root():\n"
|
112
123
|
" return {\"message\": \"Hello World\"}\n"
|
@@ -407,6 +418,27 @@ def create(name):
|
|
407
418
|
"def downgrade() -> None:\n"
|
408
419
|
" \"\"\"Downgrade schema.\"\"\"\n"
|
409
420
|
" ${downgrades if downgrades else \"pass\"}\n"
|
421
|
+
),
|
422
|
+
"middleware/validation.py": (
|
423
|
+
"from starlette.middleware.base import BaseHTTPMiddleware\n"
|
424
|
+
"from fastapi.responses import JSONResponse\n"
|
425
|
+
"from fastapi import Request\n"
|
426
|
+
"import os\n"
|
427
|
+
"\n"
|
428
|
+
"from config.settings import Settings\n"
|
429
|
+
"\n"
|
430
|
+
"class Validation(BaseHTTPMiddleware):\n"
|
431
|
+
" async def dispatch(self, request: Request, call_next):\n"
|
432
|
+
" settings = Settings()\n"
|
433
|
+
"\n"
|
434
|
+
" token_header = request.headers.get(\"validate\")\n"
|
435
|
+
" expected_token = settings.SECRET_TOKEN\n"
|
436
|
+
"\n"
|
437
|
+
" if not token_header or token_header != expected_token:\n"
|
438
|
+
" return JSONResponse(status_code=401, content={\"message\": \"Token no válido\"})\n"
|
439
|
+
"\n"
|
440
|
+
" response = await call_next(request)\n"
|
441
|
+
" return response\n"
|
410
442
|
)
|
411
443
|
}
|
412
444
|
|
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
|
{quipus_generate-0.1.18 → quipus_generate-0.1.20}/quipus_generate.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|