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

ldap_log should be string not boolean to support network/network_unsafe options #960

Open
ArcticSnowman opened this issue Nov 7, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@ArcticSnowman
Copy link

Currently the rabbitmq::ldap_log only accepts true or false. According to https://www.rabbitmq.com/ldap.html it should also accept network and network_unsafe

This can be achieved by changing the type from boolean to string

@wyardley wyardley added the enhancement New feature or request label Nov 7, 2023
@wyardley
Copy link
Contributor

wyardley commented Nov 7, 2023

I think normally it would be somewhat of an anti-pattern to have something that's an optional boolean, and having it a string (with true / false as possible options) would be breaking at best, and kind of wacky UI at worst.

Probably the best bet would be something like
Variant[Enum['network', 'network_unsafe', 'true', 'false'], Boolean], but might be good to get some other opinions from Voxpupuli collaborators (maybe on IRC) to confirm that this is a good way to go.

Are you willing / able to make a PR (including some updates / additions to tests) to handle this?

If this feature was added later, it might also be necessary to gate it depending on RMQ version, though I'm not strongly opinionated about this.

@smortex
Copy link
Member

smortex commented Nov 8, 2023

Boolean are tricky because undef and false both evaluate to false, so we must be sure to output a value when the setting is set to false.

Changing the accepted value from Boolean to String is a backwards-incompatible change, maybe we can accept a Boolean as before, optionally emitting a deprecation warning if a Boolean is passed, so that we can remove it later. I am not a user of this module, IMHO the most important is to have some consistency at the module level: if it use Boolean in other places, it make sense to accept a Boolean value. If it is an exception, it make sense to deprecate this usage.

@wyardley
Copy link
Contributor

wyardley commented Nov 8, 2023

@smortex: thanks for weighing in

Changing the accepted value from Boolean to String is a backwards-incompatible change, maybe we can accept a Boolean as before, optionally emitting a deprecation warning if a Boolean is passed

From an interface standpoint, I agree it's not ideal having both bools and strings work, though it's the best chance at avoiding breaking changes here, and having the strings "true" / "false" be the only way to set true / false doesn't seem ideal anyway.

That said, I don't think there's any worry about undef if we used the variant above, since undef still wouldn't be allowed, and we are not evaluating ldap_log as a boolean directly anywhere I can see -- just using it in a template, where I think we're already ending up with the string "true" or "false" in the config file anyway, if I'm reading

{log, <%= @ldap_log %>}
correctly.

If we were to add an if statement around ldap_log somewhere in that template in the future (doesn't look like there's one now), agree that could cause some unpredictable results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants