Skip to content

chore(iam): regenerate the request resources table for OAM's link and sink types - #9108

Merged
pgermosen merged 1 commit into
mainfrom
chore/iam-request-resources-oam-drift
Nov 20, 2026
Merged

pgermosen merged 1 commit into
mainfrom
chore/iam-request-resources-oam-drift

Conversation

@pgermosen

Copy link
Copy Markdown
Member

Summary

The Service Reference now lists both the Link and the Sink resource types for CloudWatch Observability Access Manager's CreateLink and UpdateLink, so make iam-request-resources-verify fails on every change that touches iam-request-resources.json ("AWS gives oam:CreateLink the resource types ['Link', 'Sink'], not ['Sink']", and the same for UpdateLink, which had ['Link']).

  • Regenerated, nothing else. make iam-request-resources-sync, with no change to the generator, brings the two types in, read by the existing rules.
    • CreateLink is checked on the sink its SinkIdentifier names, 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 allows CreateLink, since the Service Reference now lists the link for it.
    • UpdateLink's Identifier is read as a link or a sink by its ARN. It holds a link's, so UpdateLink is checked on the same link as before.
  • What else AWS changed. The same run brings in Textract's blueprint, job and project resource types, with their ARN formats and aws:ResourceTag/ keys, for TagResource, UntagResource and ListTagsForResource. Floci serves none of Textract's tag actions.
  • Tests. RequestResourcesTest expects the link CreateLink makes beside the sink, and the REST route enforcement test's CreateLink case 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's SinkIdentifier is 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-verify and 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

  • Bug fix (fix:)
  • New feature (feat:)
  • Breaking change (feat!: or fix!:)
  • Docs / chore

AWS Compatibility

The Service Authorization Reference for CloudWatch Observability Access Manager now lists the Link and Sink resource types for both CreateLink and UpdateLink, and the one for Amazon Textract lists blueprint, job and project for its tag actions; the table follows it, as iam-request-resources-verify checks.

Checklist

  • ./mvnw test passes 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)
  • New or updated integration test added
  • Commit messages follow Conventional Commits
  • I have no more than 2 open, non-draft pull requests and no more than 4 open pull requests in total (drafts included) in this repository (maintainers and dependency bots are exempt).

… 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.
@pgermosen pgermosen added chore iam AWS Identity and Access Management (IAM) oam Amazon CloudWatch Observability Access Manager (OAM) labels Nov 20, 2026
@qodo-code-review

qodo-code-review Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

Regenerate IAM resource rules for OAM links and sinks

🐞 Bug fix ⚙️ Configuration changes 🧪 Tests 🕐 20-40 Minutes

Grey Divider

AI Description

• Regenerate IAM rules to check OAM CreateLink against both the sink and the new link.
• Incorporate AWS’s updated Textract resource types for tag actions.
• Adjust resource-reader and route-enforcement tests for the regenerated rules.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The changed resource model is consumed by the OAM CreateLink authorization path and affects the single end-to-end outcome of creating a link to a sink.
  • The Sink and newly created Link are authorization resources within the same OAM link-management integration, not independent capabilities or scopes.
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before: CreateLink was modeled from the supplied sink resource.
  • After: the declarative resource entry also represents the link made by the operation.
  • New correctness condition: the resource set must include exactly the resources whose IAM permissions AWS requires for this request, including the created Link without turning unrelated OAM operations into additional resources.
  • The runtime parsing, ARN rendering and authorization machinery are unchanged; this is a direct metadata rule rather than a new algorithm, concurrency protocol or state transition.
Potential damage 🟡 Medium 🩹 Temporary loss

  • A false-positive resource requirement can make CreateLink return an IAM denial for users whose policy grants the sink but not the newly created Link ARN.
  • Recovery is available by adding the required Link grant or reverting the resource-model entry.
  • No persistent link state is created before authorization succeeds; the OAM implementation performs authorization before duplicate checking and link persistence.
  • Recoverable by policy correction or code/configuration rollback.
  • Reverting the model does not repair any persistent state because the hypothesized fault occurs before link creation; any already-created links remain unaffected.
Assessed commit 0d570a3
Diagram

graph TD
  A["CreateLink request"] --> B["Resource table"] --> C["Request reader"] --> D["Sink ARN"] --> F["IAM check"]
  C --> E["New link ARN"] --> F
Loading
High-Level Assessment

Regenerating the existing table is the appropriate approach: the generator already represents the AWS resource-type changes, and the reader needs no service-specific logic. Hand-editing OAM rules would leave generated data out of sync.

Files changed (4) +40 / -19

Tests (3) +33 / -12
RequestResourceMembersTest.javaUse a matching ARN type in table-wide member tests +19/-5

Use a matching ARN type in table-wide member tests

• Selects an ARN type that also fills a related resource when testing a member with multiple possible types. This keeps the generated resource expectations valid for CreateLink’s SinkIdentifier.

src/test/java/io/floci/aws/core/common/RequestResourceMembersTest.java

RequestResourcesTest.javaExpect the caller’s new link among CreateLink resources +8/-5

Expect the caller’s new link among CreateLink resources

• Updates cross-account sink assertions to include the caller-account link wildcard, while retaining checks for how the sink is resolved.

src/test/java/io/floci/aws/core/common/RequestResourcesTest.java

IamRestRouteEnforcementIntegrationTest.javaRequire link and sink grants for CreateLink +6/-2

Require link and sink grants for CreateLink

• Verifies that granting the sink alone is insufficient and that granting both the sink and caller-account link permits CreateLink. Existing refusal cases continue to distinguish the peer sink from a similarly named caller-owned sink.

src/test/java/io/floci/aws/services/iam/IamRestRouteEnforcementIntegrationTest.java

Other (1) +7 / -7
iam-request-resources.jsonRefresh OAM and Textract IAM resource metadata +7/-7

Refresh OAM and Textract IAM resource metadata

• CreateLink now includes the new link alongside its sink, while UpdateLink recognizes both listed resource types. The regeneration also adds Textract blueprint, job, and project ARN formats and tag metadata for its tag actions.

src/main/resources/aws/iam-request-resources.json

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@utafrali utafrali left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pgermosen
pgermosen merged commit 751f840 into main Nov 20, 2026
29 of 30 checks passed
@pgermosen
pgermosen deleted the chore/iam-request-resources-oam-drift branch November 20, 2026 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore iam AWS Identity and Access Management (IAM) oam Amazon CloudWatch Observability Access Manager (OAM)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants