mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
UpdateRoleDescription answered UnsupportedOperation 400, where the reference publishes it as a role operation of its own: "Use UpdateRole instead", and "modifies only the description of a role. This operation performs the same function as the Description parameter in the UpdateRole operation". So it is that path rather than a second one. updateRole now answers the role it wrote, updateRoleDescription is that call with the session duration left alone, and the roleNameType check comes along rather than being restated. The handler renders the Role the operation answers through the same roleXml fragment GetRole and CreateRole use, detailed, there being no documented exclusion to honour: the page's Response Elements section lists one Role object and says only that it "contains details about the modified role". Both members are required here, where UpdateRole's are optional, and that is the one place this does not simply delegate. Description is read off the request rather than through requireParam, which reads a blank value as an absent member: roleDescriptionType carries a maximum of 1000 and no minimum, so an empty description is a value that clears the description and only a missing one is a refusal. It is rendered the way the handler renders every other missing required member, "Value null at 'description' failed to satisfy constraint: Member must not be null". RoleName is answered for by validateRoleName, which reads a null as "Member must not be null" and a bad shape before any lookup, as the other 21 roleNameType operations have since #5391. A service-linked role takes a description edit, through either action. The user guide says so plainly, "You can edit the description of any role from the IAM console, API, or CLI", its own procedure for editing one is update-role with --description or the UpdateRoleDescription API, and it publishes a policy granting iam:UpdateRoleDescription over arn:aws:iam::*:role/aws-service-role/* for that. Both actions model UnmodifiableEntity, and a modelled error is not a list of what triggers it: the guard now stands on MaxSessionDuration, the only other member UpdateRole takes. So a description-only UpdateRole goes through where it was refused before, a request carrying both is refused whole with neither field written, and the other ten protected role actions are untouched. Authorization needed nothing. AWS gives the action the role resource type in the vendored authorization metadata, NAME_PARAMETERS already maps role to RoleName, and ResourceArnBuilder mints the ARN from the stored role, so the action is authorized against that role rather than against the wildcard. The routing table has carried the name since routing became generated from the model, so what changed there is only that it stops falling through to the unsupported-action arm. A role Description is held to the shape AWS publishes for it, and on every action that takes one rather than only the new one: at most 1000 characters of [\u0009\u000A\u000D -~¡-ÿ], which admits tab, newline and carriage return and no other control character. CreateRole, UpdateRole, UpdateRoleDescription and CreateServiceLinkedRole share one validateRoleDescription, run before the role is looked up or created, so a refused description never reaches a stored role. That is more than strictness. XmlBuilder escapes the five XML entities and passes everything else through, so a control character stored in a description would make the Role these actions and GetRole answer unparsable, which CreateRole could already produce before this. The rendering names neither the offending value nor the set, following the one IAM constraint message a recording covers, which also keeps the refused bytes out of the error body they would otherwise break. Reverting the three call sites fails the maximum, the control character and the sibling cases and nothing else. Sixteen tests. Ten over the wire in IamRoleDescriptionIntegrationTest: the description applied and answered, an empty description clearing it, the session duration and the trust policy untouched, the maximum taken and one character past it refused with the stored description intact, a control character refused while tab and newline are taken, CreateRole and UpdateRole answering the same way with nothing stored, an absent Description refused with the role left as it was, an absent RoleName, a name outside the shape refused ahead of the lookup, and an unknown role answering NoSuchEntity. Four on the service: the role that comes back, the shape across the create and update paths, the name read before the lookup, and a service-linked role taking the edit while refusing the duration. Two in IamServiceLinkedRoleIntegrationTest: that allowance over the wire, and CreateServiceLinkedRole answering ValidationError for a description outside the shape rather than its own InvalidInput. The protected-actions test pins UpdateRole on MaxSessionDuration, which is what AWS protects there. Docs carry the table row, the three ways this differs from UpdateRole, the description constraint and why it matters for the answer, the carve-out in the service-linked section, and the matrix row at 176, which check_service_matrix reads off the handler's own switch rather than taking the number on trust.