mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
* feat(apigateway): support floci:override-id for v1 and v2 API IDs were generated randomly, so endpoint URLs changed on every recreate. v1 accepted an undocumented `_custom_id_` tag and echoed it back as a normal tag; v2 had no override at all. Other services already pin IDs through the reserved `floci:override-id` tag. Both CreateRestApi and CreateApi now accept `floci:override-id`, routed through ReservedTags.getOverride so the value is validated rather than used verbatim: non-blank, no whitespace or control characters, and no `/`, `?`, `#`, since those break the endpoint URL. Override keys are consumed rather than stored, so they no longer appear in the returned tags, and supplying either key to TagResource is rejected because an ID cannot change after creation. `_custom_id_` keeps working as a deprecated fallback and is now stripped the same way; `floci:override-id` wins when both are present so callers can set both during a migration. The key stays API Gateway specific: the shared strip and reject helpers are untouched, so KMS and Cognito still treat `_custom_id_` as an ordinary tag. Error code is BadRequestException, declared by CreateRestApi, CreateApi and TagResource on both services. The shared reject helper's ValidationException is declared by neither, which is why API Gateway gets its own guard rather than reusing it. Closes #1593 Co-authored-by: Marcel Herhold <herhold.marcel@gmail.com> * fix(apigateway): reject duplicate override ids with ConflictException CreateRestApi (v1) and CreateApi (v2) now return 409 ConflictException when the resolved API id already exists in the region, instead of silently overwriting the existing API, matching how KMS and Cognito treat duplicate override ids. --------- Co-authored-by: Marcel Herhold <herhold.marcel@gmail.com>