feat: marca Uriel Jareth Consulting, API segura para agentes, aprobacion humana y webhooks HMAC
This commit is contained in:
@@ -11,7 +11,7 @@ from app.models.export_ import (
|
||||
PlanBucefaloResponse,
|
||||
)
|
||||
from app.models.common import ErrorResponse
|
||||
from app.auth import require_auth
|
||||
from app.auth import require_scope
|
||||
from app.services.calculators import (
|
||||
calcular_financiamiento,
|
||||
FINANCIAMIENTO_PLANES,
|
||||
@@ -28,7 +28,7 @@ class PlanResponse(FinanciamientoResponse):
|
||||
|
||||
|
||||
@router.get("/planes", response_model=list[PlanResponse])
|
||||
async def get_planes(_auth: dict = Depends(require_auth)):
|
||||
async def get_planes(_auth: dict = Depends(require_scope("catalogo:leer"))):
|
||||
return [
|
||||
PlanResponse(
|
||||
meses=p["meses"],
|
||||
@@ -47,7 +47,7 @@ async def get_planes(_auth: dict = Depends(require_auth)):
|
||||
)
|
||||
async def calcular(
|
||||
body: FinanciamientoRequest,
|
||||
_auth: dict = Depends(require_auth),
|
||||
_auth: dict = Depends(require_scope("catalogo:leer")),
|
||||
):
|
||||
plan = next((p for p in FINANCIAMIENTO_PLANES if p["meses"] == body.meses), None)
|
||||
if not plan:
|
||||
@@ -77,7 +77,7 @@ async def calcular(
|
||||
)
|
||||
async def simulacion(
|
||||
cotizacion_id: str,
|
||||
_auth: dict = Depends(require_auth),
|
||||
_auth: dict = Depends(require_scope("catalogo:leer")),
|
||||
db: Connection = Depends(get_db),
|
||||
):
|
||||
cot = await db.fetchrow(
|
||||
|
||||
Reference in New Issue
Block a user