From 1bcd7620bb6d837aa68f999f0f457cc235dfc337 Mon Sep 17 00:00:00 2001 From: Priamo Germosen <6233424+pgermosen@users.noreply.github.com> Date: Sat, 21 Nov 2026 18:11:03 -0400 Subject: [PATCH] fix(sts): answer a disabled federation feature with AWS's sentence (#9158) GetWebIdentityToken answered the error shape's own @documentation prose, which the model carries to describe the error rather than to be sent as one: the model states this refusal's code and status and not its message, so documentation was what the wording fell back to. AWS answers 'OutboundWebIdentityFederation is disabled.', wholly fixed text. --- docs/services/iam.md | 10 ++++++++++ .../io/floci/aws/services/iam/StsQueryHandler.java | 8 +++++--- .../services/iam/WebIdentityTokenIntegrationTest.java | 3 +-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docs/services/iam.md b/docs/services/iam.md index 0799bd22ad..7ce63054ea 100644 --- a/docs/services/iam.md +++ b/docs/services/iam.md @@ -1627,6 +1627,16 @@ task"); the wording for the report-expired case is Floci's own, since AWS does n ### Account Properties and Outbound Federation +**What a disabled feature answers.** `GetWebIdentityToken` on an account with outbound web identity +federation switched off is `OutboundWebIdentityFederationDisabledException` 403 with +`OutboundWebIdentityFederation is disabled.`, recorded 2026-11-14 and wholly fixed text. This +package answered the error shape's own `@documentation` prose instead, which the model carries to +describe the error rather than to be sent as one: the model states the code and the status for this +refusal and not the message, and documentation was what the wording fell back to when STS-1 was +built in #6517. Worth knowing as a class of defect rather than a one-off, since any refusal whose +message the model leaves unstated can be worded the same way by mistake. + + | Action | Description | |--------|-------------| | GetAccountProperties | Returns the account's properties as a `Namespace/PropertyName` to value map. | diff --git a/src/main/java/io/floci/aws/services/iam/StsQueryHandler.java b/src/main/java/io/floci/aws/services/iam/StsQueryHandler.java index 56c692fbba..8face83352 100644 --- a/src/main/java/io/floci/aws/services/iam/StsQueryHandler.java +++ b/src/main/java/io/floci/aws/services/iam/StsQueryHandler.java @@ -1216,10 +1216,12 @@ public class StsQueryHandler { Optional federation = iamService.findEnabledOutboundWebIdentityFederation(); if (federation.isEmpty()) { + // AWS's own fixed text for this refusal, which the model cannot supply: it states + // this error's code and its status and not its message, so a wording taken from the + // shape describes the error instead of answering with it. The IAM page carries the + // recording this sentence comes from. return AwsQueryResponse.error("OutboundWebIdentityFederationDisabledException", - "The outbound web identity federation feature is not enabled for this account." - + " To use this feature, you must first enable it through the AWS" - + " Management Console or API.", AwsNamespaces.STS, 403); + "OutboundWebIdentityFederation is disabled.", AwsNamespaces.STS, 403); } Instant issuedAt = clock.instant(); Instant expiration = issuedAt.plusSeconds( diff --git a/src/test/java/io/floci/aws/services/iam/WebIdentityTokenIntegrationTest.java b/src/test/java/io/floci/aws/services/iam/WebIdentityTokenIntegrationTest.java index 28ea864415..ab1d3587d2 100644 --- a/src/test/java/io/floci/aws/services/iam/WebIdentityTokenIntegrationTest.java +++ b/src/test/java/io/floci/aws/services/iam/WebIdentityTokenIntegrationTest.java @@ -210,8 +210,7 @@ class WebIdentityTokenIntegrationTest { token("RS256").when().post("/").then().statusCode(403) .body(CODE, equalTo("OutboundWebIdentityFederationDisabledException")) - .body(MESSAGE, containsString("The outbound web identity federation feature is not" - + " enabled for this account.")) + .body(MESSAGE, equalTo("OutboundWebIdentityFederation is disabled.")) .body(not(containsString("FeatureDisabled"))); enabledIssuer();