Merge lp://staging/~gary/charms/precise/juju-gui/authtoken1 into lp://staging/~juju-gui/charms/precise/juju-gui/trunk

Proposed by Gary Poster
Status: Merged
Merged at revision: 136
Proposed branch: lp://staging/~gary/charms/precise/juju-gui/authtoken1
Merge into: lp://staging/~juju-gui/charms/precise/juju-gui/trunk
Diff against target: 349 lines (+306/-4)
2 files modified
server/guiserver/auth.py (+143/-4)
server/guiserver/tests/test_auth.py (+163/-0)
To merge this branch: bzr merge lp://staging/~gary/charms/precise/juju-gui/authtoken1
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+196347@code.staging.launchpad.net

Description of the change

Add authentication token handler class

This is the first branch in a set of what will likely be three. This one simply creates the handler that we will use. There's no QA yet.

https://codereview.appspot.com/31020043/

To post a comment you must log in.
Revision history for this message
Gary Poster (gary) wrote :

Reviewers: mp+196347_code.launchpad.net,

Message:
Please take a look.

Description:
Add authentication token handler class

This is the first branch in a set of what will likely be three. This
one simply creates the handler that we will use. There's no QA yet.

https://code.launchpad.net/~gary/charms/precise/juju-gui/authtoken1/+merge/196347

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/31020043/

Affected files (+306, -4 lines):
   A [revision details]
   M server/guiserver/auth.py
   M server/guiserver/tests/test_auth.py

Revision history for this message
Francesco Banconi (frankban) wrote :

Nice branch Gary. Tests pass and are very nice.
LGTM with only minors/optional changes.
Thank you!

https://codereview.appspot.com/31020043/diff/1/server/guiserver/auth.py
File server/guiserver/auth.py (right):

https://codereview.appspot.com/31020043/diff/1/server/guiserver/auth.py#newcode236
server/guiserver/auth.py:236: Here is an example of a token creation
response. Lifetime is in seconds.
Does "Lifetime is in seconds" still apply?

https://codereview.appspot.com/31020043/diff/1/server/guiserver/auth.py#newcode325
server/guiserver/auth.py:325: """Does data represents a token creation
request? True or False."""
Does data represent a token authentication request?

https://codereview.appspot.com/31020043/diff/1/server/guiserver/tests/test_auth.py
File server/guiserver/tests/test_auth.py (right):

https://codereview.appspot.com/31020043/diff/1/server/guiserver/tests/test_auth.py#newcode325
server/guiserver/tests/test_auth.py:325:
self.io_loop.add_timeout.call_args[0][1]()
Nice! It took me a minute before understanding you are calling the
expire_token() function. Maybe we could retrieve the function and then
call it, or just add a comment?

https://codereview.appspot.com/31020043/diff/1/server/guiserver/tests/test_auth.py#newcode362
server/guiserver/tests/test_auth.py:362:
self.io_loop.remove_timeout.assert_called_with('handle marker')
assert_called_once_with? Very cheap double check.

https://codereview.appspot.com/31020043/diff/1/server/guiserver/tests/test_auth.py#newcode389
server/guiserver/tests/test_auth.py:389: # This is a small integration
test of the two functions' interaction.
Very nice!

https://codereview.appspot.com/31020043/

139. By Gary Poster

respond to review

140. By Gary Poster

correct grammar

Revision history for this message
Gary Poster (gary) wrote :

*** Submitted:

Add authentication token handler class

This is the first branch in a set of what will likely be three. This
one simply creates the handler that we will use. There's no QA yet.

R=frankban
CC=
https://codereview.appspot.com/31020043

https://codereview.appspot.com/31020043/

Revision history for this message
Gary Poster (gary) wrote :

Thank you for the very helpful review, Francesco, and for the elegant
pre-imp ideas that guided this branch.

https://codereview.appspot.com/31020043/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: