mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 22:37:55 -05:00
PutEvents was checked on `*`: the request-resources table gave it no resources, as its bus is a field of each entry, which no rule read. A policy allowing or denying events:PutEvents on one event bus therefore did not hold for publishing. Each entry's EventBusName is "the name or ARN of the event bus to receive the event", and "if you omit this, the default event bus is used". Bus policies grant events:PutEvents on `event-bus/<name>`. The EventBridge User Guide checks events:PutEvents against "the bus, once per entry in the request", and says "Publishing is authorized against the bus ARN for every entry in the request. If one entry fails an authorization condition, EventBridge denies the whole request." It says so in its section on the Custom Event Bus, which keeps the events: IAM namespace of the Classic one; nothing in the guide says otherwise for a Classic bus, whose API model lists AccessDeniedException among the error codes of an entry without saying when. The table now reads PutEvents' `Entries[].EventBusName`, a field of each of a list's structures, one resource for each entry: - The generator takes a correction filling a variable from such a field, and finds a field whose pattern takes an ARN before a name inside a list's structures, as it does a top-level member, so the field gets `arnOf` from botocore. - The loader reads `Name[].Field` in `fill`, and in `absent` and `arnOf` when it fills a variable. - The reader gives one value for each entry, the `absent` value for an entry that names no bus, gives a null or a blank, as the handler's `asText(null)` does, and none for no entries, which stay on `*`. Each value that is an ARN puts its own entry's bus in that ARN's account and Region, checked as given and as the caller's, which the handler publishes to; until now the first ARN a request gave set the account and Region of every value. The filter checks every resource, so one entry for a bus the caller may not publish to refuses the whole request, as the guide gives it. Not in this change: the events:source and events:detail-type condition keys (Floci supplies neither), EndpointId (the handler ignores it), and PutPartnerEvents, which stays on `*`. The upstream drift check on a pull request now verifies only the vendored IAM files the pull request changes, each with its generator, its tests and the modules that generator imports. It verified all six files whichever one a pull request touched, so this change, which touches only the table of the resources requests name, failed on the service namespace list, which AWS's index stopped matching when it dropped `codestar`: drift in a file the change leaves alone. The pull request's job passes the paths its merge commit changes to `make iam-data-verify CHANGED=...`, which names each check it skips; the weekly and manual runs, and a diff that cannot be read, still check every file, so the namespace list's drift is reported there.