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

Implements reserved topic matching prescriptions #793

Merged
merged 6 commits into from
Nov 11, 2023

Conversation

andsel
Copy link
Collaborator

@andsel andsel commented Nov 11, 2023

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

  • My code follows the style guidelines of this project
  • 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)
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the Changelog if it's a feature or a fix that has to be reported

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

@andsel andsel self-assigned this Nov 11, 2023
@andsel andsel changed the title Feature/avoid reserved topic matching Implements reserved topic matching prescriptions Nov 11, 2023
@andsel andsel marked this pull request as ready for review November 11, 2023 16:54
@andsel andsel added the v0.18.0 label Nov 11, 2023
@andsel andsel merged commit 6a7bc49 into moquette-io:main Nov 11, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support topic that starts with $ character
1 participant