proposal-system/infra
Adam Moussa 3d050bcf8e
Some checks are pending
Deploy / Deploy to AWS (push) Waiting to run
fix(lambdas): SigV4-sign internal API calls and bundle Lambda dependencies (#122)
The .NET API Lambda Function URL uses authType=AWS_IAM, but the four workload
Lambdas (suggestions, pdf-extract, pdf-generate, library-ingest) sent unsigned
requests with only X-Internal-Api-Key -> every internal call 403s. They also
used bare fromAsset() with no pip bundling -> ImportError at cold start. Both
made the SQS->Lambda->API pipeline non-functional when deployed (v1 pre-flight).

- Add _sign_request_headers (botocore SigV4Auth, service "lambda"); serialize the
  JSON body once and send via httpx content= so the signed payload hash matches
  the bytes sent; preserve X-Internal-Api-Key for the app-layer check. Sign per
  retry attempt to avoid SigV4 timestamp expiry on slow retries.
- Add CDK pip bundling (--platform manylinux2014_aarch64 --only-binary=:all:) to
  all four Lambdas so ARM64 wheels (reportlab, Pillow, pdfplumber) ship.
- Converge _retry_request across all four (fixes possibly-undefined return in
  pdf-extract/pdf-generate).
- Add SigV4 signing regression tests.

Verified: ruff clean, infra tsc clean, aarch64 wheels resolve for all four,
23 pytest pass. GPT-4.1 cross-family review: no BLOCK (FIX + NIT applied).
2026-06-12 17:13:08 -04:00
..
bin Merge main into feature/fix-phase-2, resolve infra conflicts 2026-05-20 19:09:35 -04:00
lib fix(lambdas): SigV4-sign internal API calls and bundle Lambda dependencies (#122) 2026-06-12 17:13:08 -04:00
cdk.context.json Initial scaffold: monorepo structure, CDK stacks, CI/CD, domain model 2026-05-16 18:40:46 -04:00
cdk.json Initial scaffold: monorepo structure, CDK stacks, CI/CD, domain model 2026-05-16 18:40:46 -04:00
package-lock.json fix(deps): pin aws-cdk-lib to ==2.257.0 (#90) 2026-06-05 13:20:09 -04:00
package.json build(deps-dev): bump aws-cdk from 2.1124.1 to 2.1125.0 in /infra (#71) 2026-05-30 04:33:26 +00:00
tsconfig.json Initial scaffold: monorepo structure, CDK stacks, CI/CD, domain model 2026-05-16 18:40:46 -04:00