zilla icon indicating copy to clipboard operation
zilla copied to clipboard

Support `mqtt` topics scoped by trusted identity

Open jfallows opened this issue 1 year ago • 0 comments

Introduce with clause to mqtt routing supporting reference to ${guarded['...'].identity} to implicitly scope topic and reply topic names as needed.

mqtt_server0:
  type: mqtt
  kind: server
  routes:
    - when:
        - publish:
          - topic: event
      exit: mqtt_kafka_proxy0
      with:
        topic: event/${guarded['jwt'].identity}
    - when:
        - publish:
          - topic: command
            reply-to: reply
      exit: mqtt_kafka_proxy0
      with:
        topic: command/${guarded['jwt'].identity}
        reply-to: reply/${guarded['jwt'].identity}
    - when:
        - subscribe:
          - topic: reply
      exit: mqtt_kafka_proxy0
      with:
        topic: reply/${guarded['jwt'].identity}
    - when:
        - session:
          - client-id: *
      exit: mqtt_kafka_proxy0

Note: depends on #420

jfallows avatar Sep 16 '23 01:09 jfallows