Files
floci/docs
danielxoi 5000bcd041 fix(apigateway): accept a region label before the built-in execute-api suffixes (#4705)
* fix(apigateway): accept a region label before the built-in execute-api suffixes

extractApiId accepted a region label only before localhost, the configured hostname, or an AWS DNS suffix, so <apiId>.execute-api.<region>.localhost.floci.io (the shape a client derives from a stage's invoke URL) was never claimed and fell through to S3's path routes, answering NoSuchBucket for the stage segment. Accept the built-in localhost.floci.io and localhost.localstack.cloud suffixes after a region label too, for REST and HTTP APIs alike.

Closes #4701

* fix(apigateway): accept every published region label on execute-api hosts

extractApiId validated the region label with a two-letter-geo pattern, so eusc-de-east-1 was rejected before the suffix was checked and the request fell through to S3, on every tail including amazonaws.eu. Check the label against the published region ids with AwsRegions.isRegionId, the same test RegionResolver.resolveRegionFromHost applies, so the hosts the filter claims match the regions it can resolve.

* fix(apigateway): accept execute-api region labels not yet in the partition catalog

isRegionId accepts only regions in the vendored published list, so a region launched after that data was generated was rejected on its execute-api host even though signed requests accept it. Use RegionResolver.isKnownRegion, which falls back to each partition's botocore region regex; an unrecognized label such as zz-nowhere-9 is still rejected.
2026-10-01 12:31:35 -04:00
..
2026-03-15 17:43:56 -05:00