Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display MQTT 5 CONNECT User Property in Management UI #8681

Merged
merged 1 commit into from
Jun 26, 2023

Conversation

ansd
Copy link
Member

@ansd ansd commented Jun 26, 2023

Display MQTT 5 CONNECT User Property in Management UI and CLI as requested in #2554 (comment)

[v5 3.1.2.11.8]

User Properties on the CONNECT packet can be used to send connection related properties from the Client to the Server. The meaning of these properties is not defined by this specification.

It makes sense to display the User Property of the CONNECT packet in the Management UI in the connection's Client Properties.

Example:

mqttx conn --client-id client-1 --user-properties "name 1: value 1" --user-properties "name 2: value 2"
mqttx conn --client-id client-2

CLI output:

rabbitmqctl list_mqtt_connections client_id conn_name user_property --formatter=json | jq .
[
  {
    "client_id": "client-2",
    "conn_name": "127.0.0.1:21898 -> 127.0.0.1:1883",
    "user_property": []
  },
  {
    "client_id": "client-1",
    "conn_name": "127.0.0.1:21826 -> 127.0.0.1:1883",
    "user_property": [
      [
        "name 1",
        "value 1"
      ],
      [
        "name 2",
        "value 2"
      ]
    ]
  }
]

Management UI:
Screenshot 2023-06-26 at 12 15 48

and CLI as requested in
#2554 (comment)

"User Properties on the CONNECT packet can be used to send connection related properties from the Client to the Server.
The meaning of these properties is not defined by this specification."
[v5 3.1.2.11.8]

It makes sense to display the User Property of the CONNECT packet in the
Management UI in the connection's Client Properties.
@michaelklishin michaelklishin added this to the 3.13.0 milestone Jun 26, 2023
@ansd ansd mentioned this pull request Jun 26, 2023
@michaelklishin
Copy link
Member

@ansd since they are user-provided, we must ensure that they are properly HTML-escaped. Otherwise it would be a great XSS exploit vector.

@ansd
Copy link
Member Author

ansd commented Jun 26, 2023

@michaelklishin they are HTML-escaped.

@ansd ansd merged commit c7e4984 into main Jun 26, 2023
15 checks passed
@ansd ansd deleted the connect-user-property branch June 26, 2023 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants