Skip to content

fix(mqtt): handle optional CONNECT credentials - #2318

Merged
mbuckton merged 1 commit into
developmentfrom
fix/MSG-421-optional-mqtt-credentials
Oct 29, 2026
Merged

mbuckton merged 1 commit into
developmentfrom
fix/MSG-421-optional-mqtt-credentials

Conversation

@mbuckton

Copy link
Copy Markdown
Contributor

Outbound MQTT 3.1.1 connections without credentials fail while packing CONNECT, and both outbound protocol implementations dereference a missing password when a username is supplied.

This change conditionally constructs and encodes credential fields, supports username-only connections, permits password-only connections in MQTT 5, and rejects password-only MQTT 3.1.1 connections before sending. MQTT 5 encoding distinguishes omitted credentials from explicitly empty values; MQTT 3.1.1 credential lengths use the encoded username byte count. Session identities, routing and authentication policy are unchanged. Existing password trimming remains unchanged.

Validation

  • Added 30 focused credential tests; observed 20 failures before the fix and all 30 passing afterwards.
  • Ran the new tests plus keepalive, session identity and MQTT 5 CONNECT regressions: 44 tests passed using JDK 25 and JUnit against cached dependencies, compiling the four changed production classes from source.
  • git diff --check passed.
  • Maven command mvn -o -Dtest=MQTTConnectCredentialsTest test stopped before compilation because the required io.mapsmessaging:license_manager:pom:3.3.7 descriptor was unavailable locally. A full Maven build, full suite and live server interoperability remain unverified.

Refs: MSG-421
https://mapsmessaging.atlassian.net/browse/MSG-421

@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ebcef25f-8ed1-4c25-9aaf-39ca8054deac

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mbuckton
mbuckton merged commit 9dd7b65 into development Oct 29, 2026
2 checks passed
@mbuckton
mbuckton deleted the fix/MSG-421-optional-mqtt-credentials branch October 29, 2026 04:52
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.

1 participant