mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
* test(iot): cover custom authorizer invocation and enforcement against AWS * feat(iot): enforce custom authorizer decisions on MQTT connections Serve TestInvokeAuthorizer and invoke an authorizer's function on an MQTT CONNECT that names it, on the plaintext listener and the /mqtt WebSocket bridge. The event, the request and answer checks, signed-token verification and the refusal per MQTT version follow what was measured against AWS IoT Core. The bridge hands the upgrade's headers, query and server name to the broker keyed by its connection's local address. Closes #4823 * fix(iot): evaluate WebSocket custom authorizer policies against the client's address * docs(iot): note that a non-UTF-8 MQTT password reaches the authorizer altered * test(iot): cover custom authorizer CONNECTs on the plain MQTT listener * fix(iot): refuse TestInvokeAuthorizer tokens and signatures outside their length bounds * fix(iot): refuse authorizer JSON with trailing content TestInvokeAuthorizer, CreateAuthorizer and UpdateAuthorizer bodies, a custom authorizer's answer and each policy document it returns are now read with FAIL_ON_TRAILING_TOKENS, as the shared JSON controllers do, so a valid prefix followed by junk is refused instead of half-read. * fix(iot): keep address literals out of the WebSocket server name Over WSS without SNI the bridge fell back to the Host header unfiltered, so a client dialing an IP got that IP as tls.serverName in the authorizer event and as iot:DomainName in policy evaluation. Apply the same address literal filter SNI already uses. Also name the context validation ceiling in TestInvokeAuthorizer's ponytail note.