Skip to content

Refactor/setup middlewares aggregator - #157

Merged
NdondaDaniel2020 merged 3 commits into
mainfrom
refactor/setup-middlewares-aggregator
Aug 30, 2026
Merged

NdondaDaniel2020 merged 3 commits into
mainfrom
refactor/setup-middlewares-aggregator

Conversation

@NdondaDaniel2020

Copy link
Copy Markdown
Owner

📌 Contexto & Motivação

Refatora a inicialização de middlewares no app/main.py, encapsulando o registro de todos os componentes de segurança, CORS, logs e métricas em uma única função agregadora setup_middlewares(app).


🛠️ Alterações

  • Centralização de Middlewares: Criada a função setup_middlewares em app/core/web/middleware.py, garantindo a ordem canônica e segura de execução dos middlewares ASGI/HTTP.
  • Limpeza do app/main.py: Reduz a complexidade da fábrica create_app(), tornando a inicialização mais limpa e declarativa.

🧪 Validação

uv run pytest tests/test_cors.py tests/test_correlation_id.py tests/test_metrics_middleware.py tests/test_health.py tests/test_error_handlers.py
uv run ruff check

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
auth Ready Ready Preview Aug 30, 2026 12:41am

@NdondaDaniel2020 NdondaDaniel2020 self-assigned this Aug 30, 2026
@NdondaDaniel2020
NdondaDaniel2020 merged commit 17b0a03 into main Aug 30, 2026
9 checks passed
@NdondaDaniel2020
NdondaDaniel2020 deleted the refactor/setup-middlewares-aggregator branch August 30, 2026 02:36

This branch was successfully deployed

1 active deployment
Preview — be99e30d Deployed Aug 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant