Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(6030)

Issue 6587060: state: add SetPassword methods

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by rog
Modified:
11 years, 7 months ago
Reviewers:
mp+127530
Visibility:
Public.

Description

state: add SetPassword methods https://code.launchpad.net/~rogpeppe/juju-core/096-state-set-password/+merge/127530 (do not edit description out of merge proposal)

Patch Set 1 #

Patch Set 2 : state: add SetPassword methods #

Total comments: 3

Patch Set 3 : state: add SetPassword methods #

Patch Set 4 : state: add SetPassword methods #

Total comments: 7

Patch Set 5 : state: add SetPassword methods #

Patch Set 6 : state: add SetPassword methods #

Unified diffs Side-by-side diffs Delta from patch set Stats (+159 lines, -19 lines) Patch
A [revision details] View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M state/machine.go View 1 chunk +7 lines, -0 lines 0 comments Download
M state/machine_test.go View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download
M state/open.go View 1 2 3 4 5 chunks +36 lines, -10 lines 0 comments Download
M state/state.go View 1 2 3 4 1 chunk +10 lines, -0 lines 0 comments Download
M state/state_test.go View 1 2 3 4 1 chunk +85 lines, -9 lines 0 comments Download
M state/unit.go View 1 2 3 4 1 chunk +7 lines, -0 lines 0 comments Download
M state/unit_test.go View 1 2 3 4 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 6
rog
Please take a look.
11 years, 7 months ago (2012-10-02 16:32:23 UTC) #1
niemeyer
Looking nice. Just needs a test to ensure the bug is fixed, and a future ...
11 years, 7 months ago (2012-10-02 17:02:06 UTC) #2
rog
Please take a look.
11 years, 7 months ago (2012-10-03 17:50:43 UTC) #3
rog
https://codereview.appspot.com/6587060/diff/2001/state/open.go File state/open.go (right): https://codereview.appspot.com/6587060/diff/2001/state/open.go#newcode123 state/open.go:123: if err := db.Login(entity, password); err != nil { ...
11 years, 7 months ago (2012-10-03 17:52:49 UTC) #4
niemeyer
That's very nice. I'd just change the Info.EntityName logic so that empty means admin, otherwise ...
11 years, 7 months ago (2012-10-03 18:11:15 UTC) #5
rog
11 years, 7 months ago (2012-10-04 07:39:44 UTC) #6
*** Submitted:

state: add SetPassword methods

R=niemeyer
CC=
https://codereview.appspot.com/6587060

https://codereview.appspot.com/6587060/diff/7005/state/open.go
File state/open.go (right):

https://codereview.appspot.com/6587060/diff/7005/state/open.go#newcode30
state/open.go:30: // This may be "admin" to connect as the administrator.
On 2012/10/03 18:11:15, niemeyer wrote:
> I suggest instead:
> 
> // EntityName holds the name of the connecting entity.
> // It should be empty when connecting as an administrator.
> 
> and
> 
> // Password holds the password for the administrator or named entity.

Done.

https://codereview.appspot.com/6587060/diff/7005/state/open.go#newcode123
state/open.go:123: if err.Error() == "auth fails" {
On 2012/10/03 18:11:15, niemeyer wrote:
> Don't we have a code in those cases? Can we have a comment here saying which
> case that is? Comparing errors by string is not ideal, so we should leave some
> breadcrumbs about the case.

No code, I'm afraid. Done, I think.

https://codereview.appspot.com/6587060/diff/7005/state/state_test.go
File state/state_test.go (right):

https://codereview.appspot.com/6587060/diff/7005/state/state_test.go#newcode949
state/state_test.go:949: ent, err = getEntity(st)
On 2012/10/03 18:11:15, niemeyer wrote:
> c.Assert(err, IsNil)

Done.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b