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

Issue 6935068: Require login before api usage.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 4 months ago by hazmat
Modified:
11 years, 3 months ago
Reviewers:
bcsaller, teknico, benjamin.saller, mp+140268
Visibility:
Public.

Description

Require login before api usage. This update requires login before using the ws api and before the delta stream is active. https://code.launchpad.net/~hazmat/juju/rapi-login/+merge/140268 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 8

Patch Set 2 : Add a login api #

Patch Set 3 : Require login before api usage. #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -12 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M juju/errors.py View 1 1 chunk +4 lines, -0 lines 0 comments Download
M juju/rapi/context.py View 1 4 chunks +9 lines, -2 lines 2 comments Download
M juju/rapi/tests/common.py View 1 1 chunk +1 line, -0 lines 0 comments Download
M juju/rapi/tests/test_context.py View 1 2 chunks +3 lines, -1 line 0 comments Download
M juju/rapi/transport/tests/test_ws.py View 1 5 chunks +47 lines, -2 lines 0 comments Download
M juju/rapi/transport/ws.py View 1 4 chunks +20 lines, -7 lines 2 comments Download

Messages

Total messages: 8
hazmat
Please take a look.
11 years, 4 months ago (2012-12-17 18:01:31 UTC) #1
teknico
Code looks good, on the face of it (I'm not familiar with this codebase). I ...
11 years, 4 months ago (2012-12-17 18:16:45 UTC) #2
benjamin.saller
I think I'm a little shy on context here given the comments below. If the ...
11 years, 4 months ago (2012-12-17 18:36:59 UTC) #3
hazmat
replies to ben's comments. https://codereview.appspot.com/6935068/diff/1/juju/agents/api.py File juju/agents/api.py (right): https://codereview.appspot.com/6935068/diff/1/juju/agents/api.py#newcode102 juju/agents/api.py:102: break On 2012/12/17 18:36:59, benjamin.saller ...
11 years, 4 months ago (2012-12-17 18:53:51 UTC) #4
hazmat
Please take a look.
11 years, 3 months ago (2013-01-17 23:17:47 UTC) #5
hazmat
Please take a look.
11 years, 3 months ago (2013-01-17 23:20:53 UTC) #6
bcsaller
LGTM I didn't see a test around the login call returning the added unauthorized error ...
11 years, 3 months ago (2013-01-18 14:04:23 UTC) #7
hazmat
11 years, 3 months ago (2013-01-18 15:14:53 UTC) #8
thanks for the review

https://codereview.appspot.com/6935068/diff/12001/juju/rapi/context.py
File juju/rapi/context.py (right):

https://codereview.appspot.com/6935068/diff/12001/juju/rapi/context.py#newcode85
juju/rapi/context.py:85: if not self.authenticated and not func.__name__ ==
"_login":
On 2013/01/18 14:04:23, bcsaller wrote:
> func.__name__ has a bad smell to it but fair enough

its already playing with func.. not many other options outside of decorating
every other function with another attribute for perm, which still amounts to the
same, ie func inspection.

https://codereview.appspot.com/6935068/diff/12001/juju/rapi/transport/ws.py
File juju/rapi/transport/ws.py (right):

https://codereview.appspot.com/6935068/diff/12001/juju/rapi/transport/ws.py#n...
juju/rapi/transport/ws.py:68: 
On 2013/01/18 14:04:23, bcsaller wrote:
> Is there an use case for a logout/inverse to this stopping the delta? I
suspect
> not at this time.

logout not possible with the underlying zk auth mechanism, wrt to use not at the
moment outside of disconnect.

ideally stream sub/unsub would be explicit api methods, but doing so without gui
support first would break the gui.
Sign in to reply to this message.

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