Skip to content

feat(cdk): Cognito JWT authorizer + CORS lab (ADR-001 PR3) - #6

Merged
patote85 merged 2 commits into
mainfrom
feat/httpapi-cognito-jwt
Sep 20, 2026
Merged

patote85 merged 2 commits into
mainfrom
feat/httpapi-cognito-jwt

Conversation

@patote85

Copy link
Copy Markdown
Owner

Summary

ADR-001 PR3 — Cognito JWT no HttpApi + CORS de lab sem * + SECURITY.md alinhado ao CDK real.

Não mergear sem CAB. Sem deploy neste PR.

O que muda

  • Cognito User Pool + App Client (lab: email, USER_PASSWORD + USER_SRP, sem client secret)
  • HttpJwtAuthorizer nas rotas protegidas; GET /health público
  • CORS: remove *; defaults http://localhost:3000 / http://127.0.0.1:3000; override via CDK context corsOrigins
  • Outputs: UserPoolId, UserPoolClientId, JwtIssuer (+ ApiUrl existente)
  • SECURITY.md honesto: sem WAF/ACM/mTLS inventados
  • README incremental: como obter IdToken e testar com Bearer

Rotas

Rota Auth
POST /solicitar-exclusao-cliente Cognito JWT
GET /status-exclusao/{cliente_id} Cognito JWT
POST /confirmar-pagamento Cognito JWT
GET /health Público

Arquivos

  • cdk/app.py
  • SECURITY.md
  • README.md

Fora de escopo

  • Merge / deploy / apply
  • WAF, ACM, domínio custom
  • Mudanças no handler Lambda

Test plan

  • npx aws-cdk@2 synth (conta lab / CAB)
  • Após deploy (CAB): sign-up + initiate-auth → IdToken
  • GET /health sem token → 200
  • rotas protegidas sem Bearer → 401
  • rotas protegidas com IdToken → Lambda responde

…-001 PR3)

- User Pool + App Client (USER_PASSWORD/USER_SRP, lab)
- HttpJwtAuthorizer on solicitar/status/confirmar; /health public
- CORS: drop *; localhost:3000 (+ context corsOrigins)
- SECURITY.md honest (no WAF/ACM claims); README token/test section
@patote85
patote85 merged commit 7d5bfc9 into main Sep 20, 2026
1 check passed
patote85 added a commit that referenced this pull request Sep 24, 2026
patote85 added a commit that referenced this pull request Sep 24, 2026
patote85 added a commit that referenced this pull request Sep 24, 2026
* agent-friendly #6: add docs/feature-map.md

* agent-friendly #6: README link to feature-map
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