Files
floci/src/test/java
Priamo Germosen 8a87e062c8 fix(core): route a shared Query action name by the Version it declares (#5549)
Without a usable credential scope, a Query request's service came from the action
name alone, first match wins. Wherever two services define the same name, the later
one was unreachable on that path: an unsigned ElastiCache CreateUser created an IAM
user, SQS AddPermission was answered by SNS, and RDS, ElastiCache and CloudWatch
ListTagsForResource all reached SNS. The parity test pinned 18 such names as claimed
by another service.

Every Query client sends its service's API version as the Version form field, and
those are distinct per service in botocore's models, so Version now chooses among the
services that serve the name, the way isElbClassicRequest already splits the two ELB
APIs. SES and Elastic Beanstalk publish the same version and share no action name, so
the action settles which one a request is for. A Version naming a service that does
not serve the name, or no Version at all, leaves the existing order to decide, so a
request that omits the field routes exactly as before.

IamEnforcementFilter resolves through the same AwsQueryServiceResolver and reads
Version from the form body the way it reads the action, first occurrence, as the
controller's getFirst does. A request is therefore authorized under the namespace of
the service that runs it, which the new enforcement tests hold in both directions.

The if-chain becomes one ordered table of services, each with the API versions its
clients declare and the names it serves, which both paths read, so the order and the
versions cannot drift apart. SQS gets a set for the first time and is tried last, so
by name alone it still takes only what nothing else defines, and its Version wins back
the two names SNS shares.

The parity test now routes each handler's actions with that service's own Version,
and states the versions itself rather than reading them back from the controller. It
also routes them without a Version, where a name two services share may go to either,
but has to reach one whose handler dispatches it. 16 of the 18 claimed entries leave
the gap file. The other 2 are SQS AddPermission and RemovePermission, which without a
Version still reach SNS, whose handler does not implement them. The file is down to
173: those 2 and 171 names missing from their own service's set.

Refs #5032
2026-10-12 22:34:49 -05:00
..