eclipse-mosquitto / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
9.11k stars 2.4k forks source link

Expose bridge client cert CN for topic remapping(s) the same as CN of client cert is exposed in ACLs #1310

Open mirko opened 5 years ago

mirko commented 5 years ago

I'm very glad about the option 'use_identity_as_username' and happily use it within ACLs!

Now I'm in a setup where I want to bridge 2 mqtt broker. One project specific one, to which all project specific clients connect to, with a top-level one, to which all the bridges connect to.

While bridging and before passing messages through to the top-level broker, I'd also like to edit/prefix the topics and it appears reasonably doing so by prefixing them with the project name.

That project name is already encoded into the TLS certificate which is used by the bridge to connect to the top-level broker.

Is there any way to use variables - containing the CN of the bridge client cert - in topic (re)mappings, as there is a variable containing the CN of the client cert in ACLs?

ralight commented 5 years ago

If I understand, you want to do something like:

topic # out 1 <certificate cn here>

And have the <> part automatically?

mirko commented 5 years ago

If I understand, you want to do something like:

topic # out 1 <certificate cn here>

And have the <> part automatically?

Correct!