fix(iam): emit State before Description in GenerateCredentialReport (#4329)

GenerateCredentialReportResponse's member order in the wire model, and the
order AWS's own documented example emits them in, is State then
Description. The handler had them reversed. Query-protocol XML parsers
match by element name, not position, so nothing was actually broken by
this; it's a fidelity fix, not a behavior fix.

Follow-up from #4298's review.
This commit is contained in:
Priamo Germosen authored and GitHub committed 2026-09-24 17:38:07 -05:00
1 parent f6f5eda0be
commit dd05c533e5
1 file changed
+3 -1
@@ -859,9 +859,11 @@ public class IamQueryHandler {
private Response handleGenerateCredentialReport(MultivaluedMap<String, String> params) {
IamService.CredentialReportGeneration generation = iamService.generateCredentialReport();
// State before Description: GenerateCredentialReportResponse's member order in the
// wire model, and the order AWS's own documented example emits them in.
String result = new XmlBuilder()
.elem("Description", generation.description())
.elem("State", generation.state())
.elem("Description", generation.description())
.build();
return Response.ok(AwsQueryResponse.envelope("GenerateCredentialReport", AwsNamespaces.IAM, result)).build();
}