mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
`Api` does not currently model `corsConfiguration`, so neither `ApiGatewayV2Service.createApi` / `updateApi` accept the field from the inbound request nor do the two response builders (`ApiGatewayController.toV2ApiNode` and `ApiGatewayV2JsonHandler.toApiNode`) emit it. Terraform's `aws_apigatewayv2_api.cors_configuration` is therefore always perceived as drift on every plan against a correctly-configured emulator. Introduces a nested `Api.Cors` record mirroring the `Authorizer.JwtConfiguration` pattern (six AWS-documented sub-fields: allowOrigins, allowMethods, allowHeaders, exposeHeaders, maxAge, allowCredentials). Adds request extraction via a shared `toCors(Map)` helper (boolean uses the same defensive `Boolean.parseBoolean(String.valueOf(...))` style as `Stage.autoDeploy`) and emits the value from both REST and JSON 1.1 response paths. Covered by a focused regression test (`ApiCorsConfigurationResponseTest`) exercising create/get/list, PATCH update, omitted-when-null, the containsKey-guard against future regression on PATCH-other-field, and a JSON 1.1 round-trip via `X-Amz-Target` dispatch. Same Terraform-drift class as #887 (`Route.authorizerId`) and #931 (`Integration.connectionType`, `Authorizer.enableSimpleResponses`).