Files
floci/src
Allen Sanborn d4e9dcbe55 fix(cloudfront): report Logging on distribution reads (#3318)
* fix(cloudfront): report Logging on distribution reads

GetDistribution and GetDistributionConfig omitted the Logging member of
DistributionConfig. It is "Required: No" on input, but CloudFront reports it on
every response with its defaults, and callers read it unconditionally: the AWS
SDKs and the Terraform provider both expect the element to be present.

Report it with the defaults CloudFront uses, a disabled configuration with an
empty bucket and prefix, and echo an explicitly supplied one back in full. The
model already carried the field; it was simply never written to the response.

Restrictions and OriginGroups had the same gap and are already handled, so only
Logging is added here.

Reference: the DistributionConfig members and their types
https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_DistributionConfig.html

* fix(cloudfront): parse the Logging block on distribution writes

Reads report Logging, but parseDistributionConfig never read it from the
request body, so CreateDistribution and UpdateDistribution dropped an
explicit block and the caller read the disabled defaults back. That is the
drift aws_cloudfront_distribution sees on logging_config: it sends a
configuration and gets defaults.

parseLogging follows parseGeoRestriction, extracting Enabled,
IncludeCookies, Bucket and Prefix. An absent block yields an empty map,
which xmlLogging still renders as today's disabled defaults.

The existing coverage built the model in Java and inserted it through
CloudFrontService, so it passed with the parser missing. The new tests POST
and PUT a DistributionConfig body over HTTP and read it back, which is what
puts the parser under test.

* test(cloudfront): take CloudFrontService through the constructor

AGENTS.md asks for constructor injection and this test used an @Inject field.

I had argued against changing it on the grounds that a @QuarkusTest cannot take
constructor injection, since JUnit 5 needs a registered ParameterResolver and I
believed Quarkus does not supply one for CDI beans. That is wrong. A probe with a
constructor taking CloudFrontService compiles and passes, so the 0-of-736 count in
this repo reflects habit rather than a constraint.

209 CloudFront tests still pass.
2026-09-10 10:14:32 -04:00
..