Merge lp:~dobey/ubuntuone-credentials/announce-errors-rtm into lp:ubuntuone-credentials/rtm-14.09

Proposed by dobey
Status: Merged
Approved by: dobey
Approved revision: 148
Merged at revision: 148
Proposed branch: lp:~dobey/ubuntuone-credentials/announce-errors-rtm
Merge into: lp:ubuntuone-credentials/rtm-14.09
Diff against target: 96 lines (+22/-1)
5 files modified
debian/libubuntuoneauth-2.0-0.symbols (+2/-0)
libubuntuoneauth/keyring.cpp (+7/-1)
libubuntuoneauth/keyring.h (+1/-0)
libubuntuoneauth/ssoservice.cpp (+11/-0)
libubuntuoneauth/ssoservice.h (+1/-0)
To merge this branch: bzr merge lp:~dobey/ubuntuone-credentials/announce-errors-rtm
Reviewer Review Type Date Requested Status
Alejandro J. Cura (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+247241@code.launchpad.net

Commit message

Handle keyringError from the keyring, by deleting token.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/libubuntuoneauth-2.0-0.symbols'
2--- debian/libubuntuoneauth-2.0-0.symbols 2014-09-09 13:53:07 +0000
3+++ debian/libubuntuoneauth-2.0-0.symbols 2015-01-21 23:20:15 +0000
4@@ -35,6 +35,7 @@
5 (c++)"UbuntuOne::SSOService::handleCredentialsFound(UbuntuOne::Token const&)@Base" 13.08
6 (c++)"UbuntuOne::SSOService::handleCredentialsNotFound()@Base" 13.08
7 (c++)"UbuntuOne::SSOService::handleTwoFactorAuthRequired()@Base" 13.08
8+ (c++)"UbuntuOne::SSOService::handleKeyringError(QString)@Base" 14.04+14.10.20140910bzr164
9 (c++)"UbuntuOne::SSOService::login(QString, QString, QString)@Base" 13.08
10 (c++)"UbuntuOne::SSOService::SSOService(QObject*)@Base" 13.08
11 (c++)"UbuntuOne::SSOService::SSOService(QObject*)@Base" 13.08
12@@ -117,6 +118,7 @@
13 (c++)"UbuntuOne::Keyring::tokenFound(UbuntuOne::Token const&)@Base" 13.08
14 (c++)"UbuntuOne::Keyring::deleteToken()@Base" 13.08
15 (c++)"UbuntuOne::Keyring::handleError(SignOn::Error const&)@Base" 13.08
16+ (c++)"UbuntuOne::Keyring::handleDeleteError(SignOn::Error const&)@Base" 14.04+14.10.20140910bzr165
17 (c++)"UbuntuOne::Keyring::qt_metacall(QMetaObject::Call, int, void**)@Base" 13.08
18 (c++)"UbuntuOne::Keyring::qt_metacast(char const*)@Base" 13.08
19 (c++)"UbuntuOne::Keyring::tokenStored()@Base" 13.08
20
21=== modified file 'libubuntuoneauth/keyring.cpp'
22--- libubuntuoneauth/keyring.cpp 2014-08-13 16:10:46 +0000
23+++ libubuntuoneauth/keyring.cpp 2015-01-21 23:20:15 +0000
24@@ -169,6 +169,12 @@
25 emit tokenDeleted();
26 }
27
28+ void Keyring::handleDeleteError(const SignOn::Error &error)
29+ {
30+ // Just log the error here, as we don't want to infinite loop.
31+ qWarning() << "Error deleting token:" << error.message();
32+ }
33+
34 void Keyring::deleteToken()
35 {
36 QString _acctName("ubuntuone");
37@@ -183,7 +189,7 @@
38 connect(account, SIGNAL(removed()),
39 this, SLOT(handleAccountRemoved()));
40 connect(identity, SIGNAL(error(const SignOn::Error&)),
41- this, SLOT(handleError(const SignOn::Error&)));
42+ this, SLOT(handleDeleteError(const SignOn::Error&)));
43
44 identity->remove();
45 account->remove();
46
47=== modified file 'libubuntuoneauth/keyring.h'
48--- libubuntuoneauth/keyring.h 2014-08-12 20:38:39 +0000
49+++ libubuntuoneauth/keyring.h 2015-01-21 23:20:15 +0000
50@@ -53,6 +53,7 @@
51 void handleSessionData(const SignOn::SessionData &data);
52 void handleCredentialsStored(const quint32 id);
53 void handleAccountRemoved();
54+ void handleDeleteError(const SignOn::Error &error);
55
56 private:
57 Accounts::Manager _manager;
58
59=== modified file 'libubuntuoneauth/ssoservice.cpp'
60--- libubuntuoneauth/ssoservice.cpp 2014-09-08 22:10:44 +0000
61+++ libubuntuoneauth/ssoservice.cpp 2015-01-21 23:20:15 +0000
62@@ -57,6 +57,9 @@
63 connect(_keyring, SIGNAL(tokenDeleted()),
64 this, SLOT(handleTokenDeleted()));
65
66+ connect(_keyring, SIGNAL(keyringError(QString)),
67+ this, SLOT(handleKeyringError(QString)));
68+
69 connect(_nam, SIGNAL(finished(QNetworkReply*)),
70 this, SLOT(accountPinged(QNetworkReply*)));
71
72@@ -166,4 +169,12 @@
73 emit requestFailed(error);
74 }
75
76+ void SSOService::handleKeyringError(QString message)
77+ {
78+ _tempPassword = "";
79+ /* Treat keyring errors as invalid/expired token.
80+ Delete the token and act like it wasn't found. */
81+ invalidateCredentials();
82+ emit credentialsNotFound();
83+ }
84 }
85
86=== modified file 'libubuntuoneauth/ssoservice.h'
87--- libubuntuoneauth/ssoservice.h 2013-07-04 07:43:16 +0000
88+++ libubuntuoneauth/ssoservice.h 2015-01-21 23:20:15 +0000
89@@ -65,6 +65,7 @@
90 void accountRegistered(const AccountResponse& account);
91 void errorOccurred(const ErrorResponse&);
92 void handleTwoFactorAuthRequired();
93+ void handleKeyringError(QString message);
94
95 private:
96 Keyring *_keyring;

Subscribers

People subscribed via source and target branches

to all changes: