mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 14:30:28 -05:00
The seven operations that still answered an absent member from a check of their own are read against the vendored shapes now, which leaves every STS operation that models a member reading its constraints from the model: `AssumeRole`, `AssumeRoleWithSAML`, `AssumeRoleWithWebIdentity`, `AssumeRoot`, `DecodeAuthorizationMessage`, `GetDelegatedAccessToken` and `GetFederationToken`. `GetCallerIdentity` carries no member, so there is nothing to read for it. Two answers move, both onto the form the model and the rest of this package give. A member the request leaves out is named as a constraint message spells it, `roleSessionName` rather than `RoleSessionName`, and every absent member is reported together in the order the model lists them, where the check it replaces answered the first it found. A member sent empty is a value the request carries, so it breaks its own minimum length rather than reading as absent. That is the reading #6811 settled for the two services and what `validateRequired` was the last of in this handler. What the seven gain is every bound beside the required members, none of which was read at all: `RoleArn` at 20 to 2048 characters, `RoleSessionName` at 2 to 64, `ExternalId`, `SourceIdentity`, `SerialNumber`, `TokenCode`, `Policy`, `PolicyArns`, `Tags`, `TransitiveTagKeys` and `ProvidedContexts` on `AssumeRole`, `SAMLAssertion` at 4 to 100000, `WebIdentityToken` at 4 to 20000, `ProviderId` at 4 to 2048, `Name` at 2 to 32, `EncodedMessage` at 1 to 10240, and the `DurationSeconds` and `MinimumSessionTokenSize` ranges each operation declares. `AssumeRoot`'s own length check on `TargetPrincipal` said what the model says, so it comes off with the rest. One reading is this emulator's own, and `docs/services/sts.md` says so. `TradeInToken` is required and declares no length, so a request sending it empty carries a value: it reaches the lookup and is answered `ExpiredTradeInTokenException`, the refusal any token that cannot be redeemed gets, where the check it replaces called it absent. Nothing published says what AWS answers an empty trade-in token. Each operation keeps the refusals it answers ahead of the constraints: `GetFederationToken` and `GetSessionToken` turn away session credentials first, and `AssumeRoot` refuses the global endpoint first. Three test fixtures carried values AWS refuses and now carry values it takes. A `RoleSessionName` of `s` is one character where the model declares two, and a `WebIdentityToken` of `jwt` three where it declares four, so the fixtures that sent them are a character longer, as are the two assertions that read a session name back out of an assumed-role ARN and a condition key. The name the shared role-session fixture opens under has one writer now, `EnforcementFixtures.SESSION_NAME`, read by every test asserting on that session rather than spelled again in each: an `aws:userid` condition, a `PrincipalArn` condition, two authorization-denial messages and the ARN two trust-policy cases read back. Each of those carried the one-character name, which is a 403 where the case wants a 200, or a prefix match that no longer pins the whole ARN.