Implements requirements on reserved topics (starts with $). Implements the matching rules and avoid to proceed with processing on client's publishes on those topics.
What does this PR do?
Updates the mathcing algorithm inside CTrie to negatively match topic names in the reserved form (start with $) against wildcards position as first token of a topic filter.
Refactored the tests to reuse integration fixture also outside the MQTT5 test suite, because this change regards all protocols starting from MQTT3.1.1.
Why is it important/What is the impact to the user?
Avoid the clients to use improperly reserved topics to exchange payloads. In particular avoid wildcard matching to listen inadvertently and receive unexpected topics, the clients has to explicitly subscribe to the reserved topics.
Checklist
[x] My code follows the style guidelines of this project
[x] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] I have made corresponding change to the default configuration files (and/or docker env variables)
[x] I have added tests that prove my fix is effective or that my feature works
[x] I have updated the Changelog if it's a feature or a fix that has to be reported
Release notes
Implements requirements on reserved topics (starts with $). Implements the matching rules and avoid to proceed with processing on client's publishes on those topics.
What does this PR do?
Updates the mathcing algorithm inside
CTrie
to negatively match topic names in the reserved form (start with$
) against wildcards position as first token of a topic filter. Refactored the tests to reuse integration fixture also outside the MQTT5 test suite, because this change regards all protocols starting from MQTT3.1.1.Why is it important/What is the impact to the user?
Avoid the clients to use improperly reserved topics to exchange payloads. In particular avoid wildcard matching to listen inadvertently and receive unexpected topics, the clients has to explicitly subscribe to the reserved topics.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files (and/or docker env variables)Author's Checklist
How to test this PR locally
Related issues
Use cases