Skip to content

#15192 by @lukebakken with a CI fix (backport #15193)#15194

Merged
michaelklishin merged 3 commits intov4.2.xfrom
mergify/bp/v4.2.x/pr-15193
Dec 31, 2025
Merged

#15192 by @lukebakken with a CI fix (backport #15193)#15194
michaelklishin merged 3 commits intov4.2.xfrom
mergify/bp/v4.2.x/pr-15193

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify bot commented Dec 31, 2025

This is #15192 by @lukebakken with a CI-related test suite change from me.


This is an automatic backport of pull request #15193 done by Mergify.

lukebakken and others added 3 commits December 31, 2025 07:09
The etcd peer discovery plugin crashes during startup when username and
password authentication is configured. The crash occurs with a
`function_clause` error in `rabbit_data_coercion:to_list/1` when it
receives a double-wrapped encrypted password structure like `{encrypted,
{plaintext, Binary}}`.

This change adds authentication to the etcd test suite to reproduce the
bug. The test suite now starts etcd with authentication enabled, creates
a `rabbitmq` user with password `s3kR37`, and passes these credentials
to the etcd client. The test also ensures the `credentials_obfuscation`
application starts before the etcd client to properly encrypt passwords.

The bug occurs in `deobfuscate/1` which wraps an already-encrypted
password with another `{encrypted, ...}` tuple, creating the
double-wrapped structure that causes `to_list/1` to fail.

Fixes #15191

(cherry picked from commit 604a7c1)
The `deobfuscate/1` function wraps an already-encrypted password with
another `{encrypted, ...}` tuple, creating a double-wrapped structure
like `{encrypted, {encrypted, Binary}}`. This causes
`rabbit_data_coercion:to_list/1` to fail with a `function_clause` error
because it has no clause matching the double-wrapped structure.

This change removes the extra wrapping in `deobfuscate/1`. The password
parameter is already in the correct format `{encrypted, Binary}` or
`{plaintext, Binary}` from the `obfuscate/1` call, so it passes directly
to `credentials_obfuscation:decrypt/1` without modification.

This matches the pattern used in other modules like
`rabbit_federation_util` and `amqp_direct_connection` which call
`credentials_obfuscation:decrypt/1` directly on encrypted values.

Fixes #15191

(cherry picked from commit b27de42)
@michaelklishin michaelklishin added this to the 4.2.3 milestone Dec 31, 2025
@michaelklishin michaelklishin merged commit 0a1ba67 into v4.2.x Dec 31, 2025
289 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v4.2.x/pr-15193 branch December 31, 2025 07:38
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