Commit Graph
2 Commits
Author SHA1 Message Date
soreavis 9b451ccc82 fix(iot): match topic rules outside the default region (#2169)
* fix(iot): match topic rules outside the default region

Topic rules are stored per region — topicRuleKey(region, ruleName) — but
handlePublish looked them up with a hardcoded config.defaultRegion(). A
rule created in any other region was stored, gettable and listable yet
never evaluated: republish/SQS/SNS/Kinesis/DynamoDB/Lambda actions were
silently dropped while Publish still returned 200.

IotDataController.publish now resolves the region from the request's
SigV4 credential, as the shadow endpoints in that controller already do,
and threads it through IotService.publish into handlePublish. A publish
that carries no region — MQTT, or an unsigned data-plane request —
evaluates every region's rules, mirroring the fallback
ApiGatewayService.resolveRestApiRegion applies to unsigned REST API
invocations.

executeTopicRule derives the rule's own region from its ARN and targets
the action sinks with it instead of the default region, so a rule created
in eu-west-1 delivers to eu-west-1 resources.

Closes #2065

* fix(iot): treat a non-SigV4 publish header as an unresolved region

IotDataController.publish skipped region resolution only for a missing
or blank Authorization header. Any other non-SigV4 value — a bearer JWT,
say — fell through to resolveRegionFromAuth, whose miss path returns the
configured default region. So a publish carrying such a header evaluated
only the default region's rules, while one carrying no header at all
evaluated every region's: the same absence of region information, two
different outcomes.

RegionResolver.resolveRegionFromAuthOrNull returns the credential's
region, or null when there is nothing to parse, and publish threads
that through — so every publish that names no region is treated the
same way.
2026-08-07 17:33:01 -05:00
nblomquistandnathan 326b495496 feat(iot) Feature/issue 1038 iot core (#1359)
* feat: add IoT endpoint and thing registry

* feat: add IoT thing tagging

* feat: add IoT certificates and shadows

* feat: add IoT MQTT broker

* feat: upgrade IoT MQTT broker to Moquette 0.18

* feat: restore IoT reserved MQTT topics

* feat: add IoT topic rules engine

* feat: improve IoT thing registry compatibility

* feat: complete IoT MVP 1 compatibility

* feat: complete IoT MVP 2 compatibility

* feat: finish IoT MVP 2 coverage

* fix: disable IoT MQTT broker persistence

* fix(docker): include vendored Maven artifacts in source builds

* fix(iot): stabilize MQTT integration test sockets

* fix(iot): verify MQTT test connections

* fix(iot): use Paho for MQTT integration tests

* fix(iot): use Vert.x MQTT broker

---------

Co-authored-by: nathan <nathan@debian-dev-small.localdomain>
2026-06-25 22:58:44 -05:00