* fix(cloudwatch): decompress gzip JSON PutMetricData bodies
The AWS CLI and the SDKs that speak JSON 1.0 to CloudWatch gzip a
PutMetricData body of 10 KiB or more and send Content-Encoding: gzip.
AwsJsonController binds the body as a String, so Floci read the
compressed bytes as text and every such request failed with HTTP 400
SerializationException. The metrics were never stored.
Add a reader interceptor that decompresses that one operation's body
when the controller reads it. It runs after every request filter, so
the signature is still verified over the compressed bytes the client
signed, and IAM still decides the request from X-Amz-Target first,
which is sound because nothing in that decision comes from the body.
The decompressed body is bounded by the decoder the CBOR protocol
already uses: past 10 MiB it returns HTTP 413 PayloadTooLargeException,
and a body that cannot be decompressed returns HTTP 400
InvalidRequestException, both in the controller's JSON error format.
A name binding keeps the interceptor on AwsJsonController alone, so
every other resource reads its body as before. In the native image a
global reader interceptor breaks the tag endpoints that resources
inherit from AbstractTagsController, because Quarkus REST then looks
their methods up reflectively.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(cloudwatch): publish a compressed metric batch through boto3
botocore gzips a PutMetricData body of 10 KiB or more, and with the
pinned boto3 it calls CloudWatch over JSON 1.0. The Python
compatibility suite only ever sent a handful of datums, so it never
sent a compressed request.
Send a 100-datum batch, check that botocore sent it as JSON 1.0 with
Content-Encoding: gzip, and check that all 100 metrics are listed
afterwards. Checking the content type keeps the test from passing
through the CBOR path, which already decompressed gzip, should a later
botocore prefer CBOR.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* chore(cloudwatch): reuse signed IAM test users
---------
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudwatch): return empty CompositeAlarms and LogAlarms from DescribeAlarms
AWS sends every alarm collection even when it is empty. Floci only sent
MetricAlarms, so the AWS CLI's text output printed a leading None line
for each missing paginator result key.
Closes#6362
* test(cloudwatch): check empty alarm collections in sdk-test-python instead of bats
Drop the new AWS CLI bats file and assert the empty CompositeAlarms and
LogAlarms lists in the existing describe_alarms test, as boto3 leaves an
absent list out of the response.
* test: move compatibility tests into this repo
* fix: add StatisticValues parsing to CloudWatchMetricsJsonHandler
* fix: add missing required abstract methods to EmulatorConfig in EventBridgeSchedulerIntegrationTest
* test: add sdk tests for multipart S3 copy coverage
* fix: cover and fix smithy cbor and multipart s3 copy regressions
* test: migrate more test coverage to new folder
* test: add missing ec2 expectation in healthcheck test
* docs: update READMEs in `./compatibility-tests`