fix(kms): accept application/x-amz-json-1.0 requests (#8658)

* fix(kms): accept application/x-amz-json-1.0 requests
* test(kms): declare JsonPath explicitly instead of var
* test(kms): reuse awsAction with an explicit content type
This commit is contained in:
Fernando Farias authored and GitHub committed 2026-11-17 00:23:48 -04:00
1 parent 8d9ab570cd
commit 81f484fc18
4 files changed
+114 -3

No files matched your search

@@ -12,6 +12,7 @@ import io.floci.aws.services.dynamodb.DynamoDbJsonHandler;
import io.floci.aws.services.dynamodb.DynamoDbRequestShapes;
import io.floci.aws.services.dynamodb.DynamoDbResponses;
import io.floci.aws.services.dynamodb.DynamoDbStreamsJsonHandler;
import io.floci.aws.services.kms.KmsJsonHandler;
import io.floci.aws.services.marketplace.MarketplaceJsonHandler;
import io.floci.aws.services.networkfirewall.NetworkFirewallJsonHandler;
import io.floci.aws.services.paymentcryptography.PaymentCryptographyJsonHandler;
@@ -68,6 +69,7 @@ public class AwsJsonController {
private final VerifiedPermissionsJsonHandler verifiedPermissionsJsonHandler;
private final BcmPricingCalculatorJsonHandler bcmPricingCalculatorJsonHandler;
private final TimestreamInfluxDbJsonHandler timestreamInfluxDbJsonHandler;
private final KmsJsonHandler kmsJsonHandler;
@Inject
public AwsJsonController(ObjectMapper objectMapper, ResolvedServiceCatalog catalog,
@@ -84,7 +86,8 @@ public class AwsJsonController {
MarketplaceJsonHandler marketplaceJsonHandler,
VerifiedPermissionsJsonHandler verifiedPermissionsJsonHandler,
BcmPricingCalculatorJsonHandler bcmPricingCalculatorJsonHandler,
TimestreamInfluxDbJsonHandler timestreamInfluxDbJsonHandler) {
TimestreamInfluxDbJsonHandler timestreamInfluxDbJsonHandler,
KmsJsonHandler kmsJsonHandler) {
this.objectMapper = objectMapper;
this.strictBodyReader = objectMapper.reader().with(DeserializationFeature.FAIL_ON_TRAILING_TOKENS);
this.catalog = catalog;
@@ -103,6 +106,7 @@ public class AwsJsonController {
this.verifiedPermissionsJsonHandler = verifiedPermissionsJsonHandler;
this.bcmPricingCalculatorJsonHandler = bcmPricingCalculatorJsonHandler;
this.timestreamInfluxDbJsonHandler = timestreamInfluxDbJsonHandler;
this.kmsJsonHandler = kmsJsonHandler;
}
/**
@@ -199,6 +203,7 @@ public class AwsJsonController {
case "verifiedpermissions" -> verifiedPermissionsJsonHandler.handle(action, request, region);
case "bcm-pricing-calculator" -> bcmPricingCalculatorJsonHandler.handle(action, request, region);
case "timestream-influxdb" -> timestreamInfluxDbJsonHandler.handle(action, request, region);
case "kms" -> kmsJsonHandler.handle(action, request, region);
default -> null;
};
// catalog.matchTarget is protocol-agnostic: a JSON 1.1 target