mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 22:11:36 -05:00
hectorvent asked on #5240 whether the account-property constraint messages should carry the "1 validation error detected: " prefix that #5239's two recorded messages have, noting there is no recording for PutAccountProperties itself. There is evidence, just not on that operation. Across the AWS-validated snapshots for IAM, CloudWatch and SNS, every recorded constraint message opens with the count: six of six. The prefix is the envelope the front end puts on a validation report, not a property of the member being validated, and SNS settles the part the question turned on, because two of its recordings are map members and both carry it: 1 validation error detected: Value null at 'attributes' failed to satisfy constraint: Member must not be null 1 validation error detected: Value null at 'messageAttributes.attr1.member.dataType' failed to satisfy constraint: Member must not be null The first of those is this change's absent-map case almost verbatim, down to "Value null at '<map>'". Looking for that turned up something wider than the question. IamQueryHandler's requireParam, which every required member in the service is read through, emitted its message without the prefix, while StsQueryHandler's validateRequired in the same package and TagDispatcher in core.common both already carry it on the identical sentence. IAM was the outlier, so one line fixes all 28 call sites. The five messages here are the four on the account-properties path and that one. Each was probed by reverting it on its own, and each fails only the tests that cover it. Three more constraint reports were still opening without the count, so the title did not hold when it was written: the ListPolicies scope enum, the GenerateServiceLastAccessedDetails granularity enum, and optionalInt. No test pinned any of their text, which is how they survived a change that touched every other one. A fourth, the CredentialAgeDays range check, survived a sweep for that phrase because its message builds "failed to " and "satisfy constraint" as separate literals, so the phrase never appears contiguously in the source. The sweep now joins adjacent literals before matching, which finds that one and no others. optionalInt is reachable only through CredentialAgeDays on CreateServiceSpecificCredential, so its case sits beside the test that already exercises that path and asserted only the error code. Two things deliberately left as they are. No snapshot in any service records a map *key* constraint, so the "Map keys must satisfy constraint: [...]" tail is a reasonable shape rather than an attested one, and the same goes for how a string-valued map spells its value path. The prefix is the attested part and the only part this changes. Not touched either: CloudWatch's recorded enum message names both the offending value and the permitted set, where IAM's omits both. That they differ is the point, and it is why #5239 changed only IAM's rendering. Refs #5240