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

Fixes #20315 - Sessions mutually exclusive with basic auth #320

Merged
merged 2 commits into from Jul 21, 2017

Conversation

tstrachota
Copy link
Member

Copy link
Member

@ares ares left a comment

Choose a reason for hiding this comment

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

one thing that I encountered during testing and seemed unexepected:

Having sessions enabled and username + password (or only username set), doing hammer auth login always uses that account from config file. I'd expect to be able to specify user for new session. Would that make sense?

Another slightly confusing thing is when I have admin/changeme set in config file and I do

hammer -u ares user list I got Invalid username or password or successful login, since it uses the password from config file. Would it be possible to ask for password if user changed?

Otherwise it fixes the problem reported in the issue as well as destroying valid sessions on wrong credentials 👍

end

def user_changed?
@user_changed
Copy link
Member

Choose a reason for hiding this comment

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

usually !!@user_changed is used to ensure the result of method with ? at the end returns boolean

@tstrachota
Copy link
Member Author

@ares the issues you're mentioning should actually be the main thing this PR is supposed to fix. I couldn't reproduce them. Can you double-check you checked out correct branch and if yes, provide your config files?

@tstrachota
Copy link
Member Author

Rebased

@ares
Copy link
Member

ares commented Jul 21, 2017

thanks for helping to debug, the bundle update helped, now it works as expected, could you just make a note in example foreman.yml that if user enables sessions, stored credentials are ignored? otherwise 👍

Copy link
Member

@ares ares left a comment

Choose a reason for hiding this comment

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

someone with deeper hammer knowledge should read the code whether it fits well, but except for the !! nit it looks good to me

@tstrachota
Copy link
Member Author

@ares I added a comment to the default config file and fixed using incorrect password when sessions are off and a different username is passed.

@ares
Copy link
Member

ares commented Jul 21, 2017

👍 works for me

@tstrachota tstrachota merged commit 0de9a76 into theforeman:master Jul 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants