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

Add loopback_users parameter (adds ability to allow guest user to login remotely) #699

Merged
merged 13 commits into from
Apr 24, 2018

Conversation

jjuarez
Copy link
Contributor

@jjuarez jjuarez commented Apr 19, 2018

Pull Request (PR) description

The aim of this pull request is to give the possibility to allow remote connections with the guest user, of course this is not the default configuration, because it implies some security risks

This Pull Request (PR) fixes the following issues

Fixes #698

@wyardley
Copy link
Contributor

Just wondering, should this be allow_remote_guest_connections or similar (even though it's super long)?

@jjuarez
Copy link
Contributor Author

jjuarez commented Apr 20, 2018

I'm not sure, the semantic of the parameter is not the best definitely, because the aim of this attribute is to allow the remote connections for a group of users, but by default with this configuration:

{rabbit, [{loopback_users: []}]}

you're allowing the connection to another bind (not only the loopback interface) to the guest user, in my opinion this seems a bit extrange, and there's not so much documentation about this configuration attribute

@jjuarez
Copy link
Contributor Author

jjuarez commented Apr 23, 2018

All right them, now the new module variable is called allow_remote_guest_connection as you suggested @wyardley I think it would be more appropriate

@wyardley
Copy link
Contributor

I guess another way to do it would be to make a parameter loopback_users with the default value, and let an empty array be passed in to achieve the same result. I'm not sure which design is better.

I'm going to request feedback from @bastelfreak

@wyardley wyardley requested a review from bastelfreak April 23, 2018 20:15
Copy link
Member

@bastelfreak bastelfreak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey people,
IMO the approach from @wyardley is slightly better because it allows more flexibility.

@wyardley
Copy link
Contributor

Thanks @bastelfreak
@jjuarez - does that make sense to you? I'm really sorry I didn't think of it in that way earlier :/
Either way, thanks for submitting this and for taking the time to write tests.

@jjuarez
Copy link
Contributor Author

jjuarez commented Apr 24, 2018

Yes, of course, It make sense for me, the problem with this approach is the semantic of this configuration parameter, because I'm not sure what would be the default value for this list, I guest it could be something like that:

{loopback_users, [<<"guest">>]}

but I'm not sure and I didn't find good information about this, only a configuration example but it's enough. So let me make a try with this new approach.

Copy link
Contributor

@wyardley wyardley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor change (see notes); other than that, and fixing the rubocop failures (https://travis-ci.org/voxpupuli/puppet-rabbitmq/jobs/370510357), seems sensible and well implemented.

If you're able, can you try to squash the whole thing down to one commit in your feature branch?

@@ -278,6 +279,7 @@
Boolean $ssl_erl_dist = $rabbitmq::params::ssl_erl_dist,
Optional[String] $rabbitmqadmin_package = $rabbitmq::params::rabbitmqadmin_package,
Array $archive_options = $rabbitmq::params::archive_options,
Optional[Array] $loopback_users = $rabbitmq::params::loopback_users,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a strange quirk of how Puppet works, but a param can't be Optional if it has a default. Well, technically, it can, but it can only be overridden with undef using hiera, so it's safer to not make it optional, and pass in an empty array (many people's preferred pattern anyway) to set it to an empty list when necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, you're right, I'm working with puppet 4 and the automatic hiera bind then I forgot the "old" params pattern; I think an empty list as default value for this parameter is not the best choice to achieve the behaviour that you could expect, so I could make not optional this parameter a fix the default value to the list with the guest user, let's see

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I think the right fix is to make the parameter not optional, and if users want to allow the guest user to login remotely as well, they can pass in an empty array. You could explicitly mention that in the param docs if you want to make it more clear.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But the default value should be ['guest'] and then just Array $loopback_users. I think we're saying the same thing 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we're in the same page

@wyardley
Copy link
Contributor

ps - https://www.rabbitmq.com/configure.html#configuration-file does confirm that 'guest' is the default setting for that parameter, so I think we're good there.

@wyardley wyardley added the enhancement New feature or request label Apr 24, 2018
@wyardley wyardley changed the title Configuration to allow remote connections using the guest user (loopback_users) Add loopback_users parameter (adds ability to allow guest user to login remotely) Apr 24, 2018
@wyardley wyardley dismissed bastelfreak’s stale review April 24, 2018 19:59

Changes were made

@wyardley wyardley merged commit 0ada399 into voxpupuli:master Apr 24, 2018
@wyardley
Copy link
Contributor

@jjuarez Merged, and thanks for the contribution!

@jjuarez
Copy link
Contributor Author

jjuarez commented Apr 24, 2018

It has been a pleasure to collaborate, thanks @wyardley

@wyardley
Copy link
Contributor

@jjuarez also interesting workaround noted here: #480 (comment)

Obviously, not needed now, but might be handy if you need to tweak other config variables; I should have thought of that.

@jjuarez
Copy link
Contributor Author

jjuarez commented Apr 28, 2018

Thanks @wyardley it looks very useful to help me “temporary” with my configuration issue

openstack-gerrit pushed a commit to openstack-archive/tripleo-heat-templates that referenced this pull request Dec 11, 2019
Sorta resurrecting https://review.opendev.org/#/c/324016/ now that
voxpupuli/puppet-rabbitmq#699 merged.

This commit prevents a duplicate entry for loopback_users in the
rabbitmq.config file:

{loopback_users, [<<"guest">>]},
{loopback_users, []},

keeping only the expected empty array.

Change-Id: I0c291bf5611f02983c430179206556bae3b38736
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request Dec 11, 2019
* Update tripleo-heat-templates from branch 'master'
  - Merge "Properly set loopback_users via rabbitmq::loopback_users"
  - Properly set loopback_users via rabbitmq::loopback_users
    
    Sorta resurrecting https://review.opendev.org/#/c/324016/ now that
    voxpupuli/puppet-rabbitmq#699 merged.
    
    This commit prevents a duplicate entry for loopback_users in the
    rabbitmq.config file:
    
    {loopback_users, [<<"guest">>]},
    {loopback_users, []},
    
    keeping only the expected empty array.
    
    Change-Id: I0c291bf5611f02983c430179206556bae3b38736
openstack-gerrit pushed a commit to openstack-archive/tripleo-heat-templates that referenced this pull request Dec 17, 2019
Sorta resurrecting https://review.opendev.org/#/c/324016/ now that
voxpupuli/puppet-rabbitmq#699 merged.

This commit prevents a duplicate entry for loopback_users in the
rabbitmq.config file:

{loopback_users, [<<"guest">>]},
{loopback_users, []},

keeping only the expected empty array.

Change-Id: I0c291bf5611f02983c430179206556bae3b38736
(cherry picked from commit 04a5937)
openstack-gerrit pushed a commit to openstack-archive/tripleo-heat-templates that referenced this pull request Dec 18, 2019
Sorta resurrecting https://review.opendev.org/#/c/324016/ now that
voxpupuli/puppet-rabbitmq#699 merged.

This commit prevents a duplicate entry for loopback_users in the
rabbitmq.config file:

{loopback_users, [<<"guest">>]},
{loopback_users, []},

keeping only the expected empty array.

Change-Id: I0c291bf5611f02983c430179206556bae3b38736
(cherry picked from commit 04a5937)
openstack-gerrit pushed a commit to openstack-archive/tripleo-heat-templates that referenced this pull request Dec 18, 2019
Sorta resurrecting https://review.opendev.org/#/c/324016/ now that
voxpupuli/puppet-rabbitmq#699 merged.

This commit prevents a duplicate entry for loopback_users in the
rabbitmq.config file:

{loopback_users, [<<"guest">>]},
{loopback_users, []},

keeping only the expected empty array.

Note: not a 100% clean cherry pick due to tht path changes.

(cherry picked from commit 04a5937)

Change-Id: I0c291bf5611f02983c430179206556bae3b38736
openstack-gerrit pushed a commit to openstack-archive/tripleo-heat-templates that referenced this pull request Dec 19, 2019
Sorta resurrecting https://review.opendev.org/#/c/324016/ now that
voxpupuli/puppet-rabbitmq#699 merged.

This commit prevents a duplicate entry for loopback_users in the
rabbitmq.config file:

{loopback_users, [<<"guest">>]},
{loopback_users, []},

keeping only the expected empty array.

Note: not a 100% clean cherry pick due to tht path changes.

(cherry picked from commit 04a5937)

Change-Id: I0c291bf5611f02983c430179206556bae3b38736
cegeka-jenkins pushed a commit to cegeka/puppet-rabbitmq that referenced this pull request Mar 26, 2021
…in remotely) (voxpupuli#699)

* Adds new parameter loopback_users, defaulting to ["guest"]
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

Successfully merging this pull request may close these issues.

Allow the remote connections with the guest user
3 participants