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

API Login validation #84

Merged
merged 3 commits into from Jun 13, 2014
Merged

API Login validation #84

merged 3 commits into from Jun 13, 2014

Conversation

mjs
Copy link

@mjs mjs commented Jun 12, 2014

These change the API server so that it can be configured with an optional validator function for API logins. This will be used by machine agents to block agent logins during software upgrades while still allowing client logins (coming in a later PR).

There are 3 commits. The first is just a comment improvement, the second modifies apiserver.NewServer to take a struct instead of a long list of args and the third adds the validation support.

I'm not especially wedded to the "validator" name. Other suggestions welcome.

@waigani
Copy link
Contributor

waigani commented Jun 12, 2014

LGTM, though you'd want thumper's opinion. I like that you've split the PR into separate commits - makes each change clear. Do you amend as you go or rebase?

@mjs
Copy link
Author

mjs commented Jun 12, 2014

Just repeating here for posterity: in this case there was no rebasing, just: (make some changes, commit) x 3

c.Assert(err, gc.ErrorMatches, `unknown object type "Machiner"`)

// Since these are user login tests, the nonce is empty.
return st.Login("user-admin", "dummy-secret", "")
Copy link
Contributor

Choose a reason for hiding this comment

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

A part of me squirms here, but it isn't your fault. It is the magic of the JujuConnSuite. The hard coded "user-admin" and "dummy-secret". I'd much prefer constants, but they are used all over. So don't bother here and now.

Copy link
Author

Choose a reason for hiding this comment

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

I'll leave this for now but am making a note to revisit this later on.

@howbazaar
Copy link
Contributor

LGTM with minor tweaks if you feel the desire.

Menno Smits added 3 commits June 13, 2014 20:39
There were already too many arguments being passed to this function
and another one is about to be added.
This allows an option function to be supplied when the API server is
constructed which will decide whether a login request can proceed.

This will be used to prevent agent logins during upgrades (while still
allowing client logins).
@mjs
Copy link
Author

mjs commented Jun 13, 2014

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Jun 13, 2014

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

jujubot added a commit that referenced this pull request Jun 13, 2014
API Login validation

These change the API server so that it can be configured with an optional validator function for API logins. This will be used by machine agents to block agent logins during software upgrades while still allowing client logins (coming in a later PR).

There are 3 commits. The first is just a comment improvement, the second modifies apiserver.NewServer to take a struct instead of a long list of args and the third adds the validation support.

I'm not especially wedded to the "validator" name. Other suggestions welcome.
@jujubot jujubot merged commit e620534 into juju:master Jun 13, 2014
@mjs mjs deleted the login-validator-support branch June 13, 2014 11:02
laszlokajtar pushed a commit to laszlokajtar/juju that referenced this pull request Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants