Merge lp:~mandel/ubuntu-sso-client/webclient-use-dialog into lp:ubuntu-sso-client
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Natalia Bidart on 2012-03-09 | ||||
| Approved revision: | 929 | ||||
| Merged at revision: | 903 | ||||
| Proposed branch: | lp:~mandel/ubuntu-sso-client/webclient-use-dialog | ||||
| Merge into: | lp:ubuntu-sso-client | ||||
| Prerequisite: | lp:~mandel/ubuntu-sso-client/fix-credentials-text | ||||
| Diff against target: |
699 lines (+419/-29) 8 files modified
ubuntu_sso/__init__.py (+2/-0) ubuntu_sso/qt/proxy_dialog.py (+4/-7) ubuntu_sso/qt/tests/test_proxy_dialog.py (+2/-2) ubuntu_sso/utils/webclient/__init__.py (+1/-0) ubuntu_sso/utils/webclient/common.py (+69/-1) ubuntu_sso/utils/webclient/libsoup.py (+48/-4) ubuntu_sso/utils/webclient/qtnetwork.py (+88/-15) ubuntu_sso/utils/webclient/tests/test_webclient.py (+205/-0) |
||||
| To merge this branch: | bzr merge lp:~mandel/ubuntu-sso-client/webclient-use-dialog | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Natalia Bidart | 2012-02-23 | Approve on 2012-03-09 | |
| Alejandro J. Cura (community) | Approve on 2012-03-08 | ||
|
Review via email:
|
|||
Commit Message
- Added the required code to allow the webclient use authenticated proxies and request the creds when needed (LP: #933727).
Description of the Change
Provides the required code to use auth proxies within sso.
| Brian Curtin (brian.curtin) wrote : | # |
| Brian Curtin (brian.curtin) wrote : | # |
> 140 + if (self.proxy_
> 141 + and self.proxy_password is not None):
>
> """if all((self.
> verbose way of doing the same thing. I think it's clearer, but it's no more
> correct than what you have so it's merely a comment and not a requirement to
> fix.
I misunderstood the original lines. If "" and "" are acceptable username and password values, then my suggestion is incorrect and would change the behavior.
- 911. By Manuel de la Peña on 2012-02-24
-
Merged fix-credentials
-text into webclient- use-dialog. - 912. By Manuel de la Peña on 2012-02-24
-
Merged fix-credentials
-text into webclient- use-dialog. - 913. By Manuel de la Peña on 2012-02-24
-
Merged fix-credentials
-text into webclient- use-dialog. - 914. By Manuel de la Peña on 2012-02-27
-
Merged with parent.
- 915. By Manuel de la Peña on 2012-02-27
-
Merged fix-credentials
-text into webclient- use-dialog. - 916. By Manuel de la Peña on 2012-02-29
-
Merged fix-credentials
-text into webclient- use-dialog. - 917. By Manuel de la Peña on 2012-02-29
-
Merged fix-credentials
-text into webclient- use-dialog. - 918. By Manuel de la Peña on 2012-02-29
-
Merged fix-credentials
-text into webclient- use-dialog. - 919. By Manuel de la Peña on 2012-02-29
-
Merged fix-credentials
-text into webclient- use-dialog. - 920. By Manuel de la Peña on 2012-03-01
-
Merged fix-credentials
-text into webclient- use-dialog. - 921. By Manuel de la Peña on 2012-03-01
-
Merged fix-credentials
-text into webclient- use-dialog. - 922. By Manuel de la Peña on 2012-03-05
-
Merged with trunk.
- 923. By Manuel de la Peña on 2012-03-05
-
Use add_feature instead of add_feature_
by_type. - 924. By Manuel de la Peña on 2012-03-06
-
Merged with trunk.
- 925. By Manuel de la Peña on 2012-03-07
-
Merged with trunk.
- 926. By Manuel de la Peña on 2012-03-07
-
Reuse vars from ubuntu-sso
| Natalia Bidart (nataliabidart) wrote : | # |
Thanks for this work!
* Could you please change this line:
to be:
so the exception is logged and we know what happened? Please apply the same to every logger.error inside a try-except block.
* This new import from ubuntu_
* Can you please move the constants EXCEPTION_RAISED and PROXY_CREDS_DIALOG to ubuntu_
* Unless strictly necessary, please avoid having imports inside functions. Can this import be moved at the beginning of the python file?
def _load_proxy_
"""Load the proxy creds from the keyring."""
from ubuntu_sso.keyring import Keyring
Same for:
def _launch_
"""Launch the dialog used to get the creds."""
from ubuntu_sso.utils import get_bin_dir
* I would guess you need to pass the app_name here?
args = (os.path.
* Why are you defining new variables:
given that the BaseWebClient class already has:
?
* The import of ProxyUnauthoriz
* Shouldn't the self.session.
* Instead of calling settings.
| Manuel de la Peña (mandel) wrote : | # |
> Thanks for this work!
>
> * Could you please change this line:
>
> logger.error('Could not set credentials.')
>
> to be:
>
> logger.
>
> so the exception is logged and we know what happened? Please apply the same to
> every logger.error inside a try-except block.
Sorted, I always forget about the diff, thx!
>
> * This new import from ubuntu_
> alphabetically ordered.
>
Sorted out.
> * Can you please move the constants EXCEPTION_RAISED and PROXY_CREDS_DIALOG to
> ubuntu_
>
Done.
> * Unless strictly necessary, please avoid having imports inside functions. Can
> this import be moved at the beginning of the python file?
>
> def _load_proxy_
> """Load the proxy creds from the keyring."""
> from ubuntu_sso.keyring import Keyring
>
>
> Same for:
>
> def _launch_
> """Launch the dialog used to get the creds."""
> from ubuntu_sso.utils import get_bin_dir
>
Unfortunately there is a circular import due to the fact that keyring is in utils too, there is no other way to fix this atm.
> * I would guess you need to pass the app_name here?
>
> args = (os.path.
>
By the looks at the strings proposed by design (we need to talk about this with them) there is no need at the moment. This looks like a bug in the ui design.
> * Why are you defining new variables:
>
> self.proxy_username = None
> self.proxy_password = None
>
> given that the BaseWebClient class already has:
>
> self.username = username
> self.password = password
> ?
>
There is a diff between the username and password in the server side and the proxy username and password. We have two different pairs, when there is an auth issue coming from the server (that is username/password) and when there is an auth issue coming from the proxy (proxy_
> * The import of ProxyUnauthoriz
>
Sorted!
> * Shouldn't the self.session.
>
Is in order once the exception var is moved out.
> * Instead of calling settings.
> that to a variable? same for port=settings.
Certainly.
- 927. By Manuel de la Peña on 2012-03-08
-
Fixed according to the reviews.
- 928. By Manuel de la Peña on 2012-03-08
-
Use try/finally to ensure that we always unpause the message.
| Alejandro J. Cura (alecu) wrote : | # |
Lovely branch!
I really like that you managed to work around the qt issue regarding proxy authentication.
just two typos ;-)
* "going throw a proxy" -> *thru*
* _on_aunthenticate
Otherwise a great branch.
| Manuel de la Peña (mandel) wrote : | # |
> Lovely branch!
> I really like that you managed to work around the qt issue regarding proxy
> authentication.
>
> just two typos ;-)
>
> * "going throw a proxy" -> *thru*
> * _on_aunthenticate
>
> Otherwise a great branch.
Fixed, thx for the review!!
- 929. By Manuel de la Peña on 2012-03-09
-
Fixed typos.

140 + if (self.proxy_ username is not None
141 + and self.proxy_password is not None):
"""if all((self. proxy_username, self.self. proxy_password) ):""" would be a less verbose way of doing the same thing. I think it's clearer, but it's no more correct than what you have so it's merely a comment and not a requirement to fix.
424 + if "username" in settings and "password" in settings:
Just so you know I'm not crazy with the any/all builtins, I don't suggest """if all(key in settings for key in ("user", "pass"))""" :)
(comment for now - will approve/reject after I can run the tests)