mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(cloudformation): reject a non-numeric AuthorizerResultTtlInSeconds (#4055)
ApiGatewayV2CfnProvisioner parsed AuthorizerResultTtlInSeconds with Integer.parseInt and let a non-numeric value throw a raw NumberFormatException (carried over as-is during the monolith extraction). Guard it and throw a CloudFormation ValidationError instead, matching how LambdaCfnProvisioner handles ReservedConcurrentExecutions. Refs #4021
This commit is contained in:
1 parent
60fd65b5b6
commit
eb247a50aa
2 files changed
+21
-1
No files matched your search
+15
@@ -66,6 +66,21 @@ class ApiGatewayV2CfnProvisionerTest {
|
||||
api.getAttributes().get("ExecuteApiArn"));
|
||||
}
|
||||
|
||||
@Test
|
||||
void authorizerWithNonNumericTtlIsRejected() throws Exception {
|
||||
StackResource authorizer = provisioner.provision("MyAuth", "AWS::ApiGatewayV2::Authorizer",
|
||||
mapper.readTree("""
|
||||
{"ApiId": "api-123",
|
||||
"IdentitySource": ["$request.header.Authorization"],
|
||||
"AuthorizerResultTtlInSeconds": "not-a-number"}
|
||||
"""),
|
||||
engine(), REGION, "000000000000", "test-stack", null, Map.of());
|
||||
|
||||
assertEquals("CREATE_FAILED", authorizer.getStatus());
|
||||
assertTrue(authorizer.getStatusReason().contains("AuthorizerResultTtlInSeconds must be an integer"),
|
||||
authorizer.getStatusReason());
|
||||
}
|
||||
|
||||
@Test
|
||||
void restoresExistingRoutesAndCleansPartialReplacementWhenRouteCreationFails() throws Exception {
|
||||
Route oldRoute = route("old-route", "GET /before");
|
||||
|
||||
Reference in new issue
Block a user