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 ability to set a password hash for a user. Undef = !. #18

Merged
merged 2 commits into from Sep 15, 2015

Conversation

johnzimm
Copy link

I had a use case where I needed to set a password hash for some accounts.

@westbywest
Copy link

I'm curious about the reason for assuming a locked password ('!') for users who have no $password parameter defined. Why not just let the $password be some value or default undef? Locked passwords could still be achieved by passing '!' as the $password value.

@johnzimm
Copy link
Author

That would probably be a better approach. I will update the branch with that modification.

The idea was that if we were managing the account we would want to make sure it either had a known password (or be locked); but not be in a state where we didn't know if it actually had a password set or not. The preference in our scenario would be to encourage the use of ssh keys.

I'll update so that locking the password is optional as you suggested this afternoon.

@westbywest
Copy link

I actually was about to make a PR of my own that incorporates the changes discussed in this thread:
westbywest@63f7d43

Besides the ability to specify a password hash (or leave it undef), I'm also needing the ability to provide relationship metaparameters, i.e. unless, before, require.

@johnzimm
Copy link
Author

I fixed a validation problem with "!" that was pointed out; used single quotes instead.

I also added a second commit that changes the behavior of assuming an undefined password will disable password login with '!' in place of the hash. It now just leaves the password alone if $password is undef.

Please let me know if you'd prefer these to be squashed to 1 commit.

@westbywest
Copy link

I withdraw any previous requests made in this thread. Had to switch to another module.

groups => $groups,
home => $_home,
managehome => true,
membership => $groups_membership,
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you can just add password => $password here and don't do the if $password != undef ... else ... end block

Copy link
Author

Choose a reason for hiding this comment

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

I guess that does make sense to remove now. Doing that now.

…revious behaviour was to assume disabling password login with '!'.
@mcanevet
Copy link
Contributor

LGTM

mcanevet added a commit that referenced this pull request Sep 15, 2015
Add ability to set a password hash for a user. Undef = !.
@mcanevet mcanevet merged commit 3b3c6d5 into camptocamp:master Sep 15, 2015
@johnzimm johnzimm deleted the mods branch September 15, 2015 19:23
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.

None yet

3 participants