Repository navigation
chore(iam): regenerate the request resources table for OAM's link and sink types - #9108
Conversation
… sink types The Service Reference now lists both the Link and the Sink resource types for OAM's CreateLink and UpdateLink, so iam-request-resources-verify fails on every change touching the table. make iam-request-resources-sync, with no change to the generator, brings them in: CreateLink is checked on the sink it names and now on the link it makes too, link/* in the caller's account and Region, and UpdateLink, whose Identifier holds a link's ARN, on the same link as before. The same run brings in Textract's blueprint, job and project types for its tag actions, which Floci does not serve. RequestResourcesTest expects the made link, the REST route enforcement test grants it with the sink and refuses a grant on the sink alone, and the table-wide member test gives an ARN member that also fills a resource of one of its types an ARN of that type.
PR Summary by QodoRegenerate IAM resource rules for OAM links and sinks
AI Description
Merge Risk
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history |
utafrali
left a comment
There was a problem hiding this comment.
Clean regeneration of the IAM request resources table to match AWS's updated Service Reference for OAM and Textract. The JSON changes are machine-generated and internally consistent, the test updates correctly cover the new Link resource on CreateLink (including a negative test showing sink-only grants are now refused), and the new exampleType helper in the member test is a sound fix for the type-selection logic.
| */ | ||
| private static String exampleType(Resource resource, List<Resource> resources) { | ||
| return resource.arn() == null ? resource.types().getFirst() : resources.stream() | ||
| .filter(other -> other.arn() == null && other.fill().containsValue(resource.arn()) |
There was a problem hiding this comment.
Nit: the method comment is accurate but dense. Consider adding a brief inline example like // e.g. CreateLink's SinkIdentifier is read as Link or Sink, and fills the Sink, so the test gives it a Sink ARN to make it easier to follow on a quick read.
Summary
The Service Reference now lists both the
Linkand theSinkresource types for CloudWatch Observability Access Manager'sCreateLinkandUpdateLink, somake iam-request-resources-verifyfails on every change that touchesiam-request-resources.json("AWS gives oam:CreateLink the resource types ['Link', 'Sink'], not ['Sink']", and the same forUpdateLink, which had['Link']).make iam-request-resources-sync, with no change to the generator, brings the two types in, read by the existing rules.CreateLinkis checked on the sink itsSinkIdentifiernames, as before, and now on the link it makes too,link/*in the caller's account and Region, as for the other creates whose new resource the Service Reference lists. A policy on*passes as before; one naming only the sink no longer allowsCreateLink, since the Service Reference now lists the link for it.UpdateLink'sIdentifieris read as a link or a sink by its ARN. It holds a link's, soUpdateLinkis checked on the same link as before.blueprint,jobandprojectresource types, with their ARN formats andaws:ResourceTag/keys, forTagResource,UntagResourceandListTagsForResource. Floci serves none of Textract's tag actions.RequestResourcesTestexpects the linkCreateLinkmakes beside the sink, and the REST route enforcement test'sCreateLinkcase grants the link with the sink, and shows a grant on the sink alone refused. The table-wide member test gave each ARN member an ARN of its first listed type;CreateLink'sSinkIdentifieris now read as a link or a sink and fills the sink, so the test gives a member that also fills a resource of one of its types an ARN of that type.make iam-request-resources-check,make iam-request-resources-verifyand the generator's tests pass on the result, as do the request resource reader and member tests, the OAM and Textract tests, the namespace and route coverage tests, and the request resource, REST route and tag-on-create enforcement tests.Type of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
The Service Authorization Reference for CloudWatch Observability Access Manager now lists the
LinkandSinkresource types for bothCreateLinkandUpdateLink, and the one for Amazon Textract listsblueprint,jobandprojectfor its tag actions; the table follows it, asiam-request-resources-verifychecks.Checklist
./mvnw testpasses locally (ran the request resource reader and member, OAM, Textract, namespace and route coverage, partition inventory and request resource, REST route and tag-on-create enforcement test classes, not the whole suite)