geary/src/client/application/secret-mediator.vala

159 lines
6.6 KiB
Vala
Raw Normal View History

2015-02-06 12:43:33 -08:00
/* Copyright 2011-2015 Yorba Foundation
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
*/
// LibSecret password adapter.
public class SecretMediator : Geary.CredentialsMediator, Object {
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
private const string OLD_GEARY_USERNAME_PREFIX = "org.yorba.geary username:";
private Geary.Nonblocking.Mutex dialog_mutex = new Geary.Nonblocking.Mutex();
private string get_key_name(Geary.Service service, string user) {
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
switch (service) {
case Geary.Service.IMAP:
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
return "org.yorba.geary imap_username:" + user;
case Geary.Service.SMTP:
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
return "org.yorba.geary smtp_username:" + user;
default:
assert_not_reached();
}
}
private Geary.Credentials get_credentials(Geary.Service service, Geary.AccountInformation account_information) {
switch (service) {
case Geary.Service.IMAP:
return account_information.imap_credentials;
case Geary.Service.SMTP:
return account_information.smtp_credentials;
default:
assert_not_reached();
}
}
private async string? migrate_old_password(string old_key, string new_key, Cancellable? cancellable)
throws Error {
string? password = yield Secret.password_lookup(Secret.SCHEMA_COMPAT_NETWORK, cancellable,
"user", old_key);
if (password != null) {
bool result = yield Secret.password_store(Secret.SCHEMA_COMPAT_NETWORK,
null, new_key, password, cancellable, "user", new_key);
if (result)
yield Secret.password_clear(Secret.SCHEMA_COMPAT_NETWORK, cancellable, "user", old_key);
}
return password;
}
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
public virtual async string? get_password_async(
Geary.Service service, Geary.AccountInformation account_information, Cancellable? cancellable = null)
throws Error {
string key_name = get_key_name(service, account_information.email);
string? password = yield Secret.password_lookup(Secret.SCHEMA_COMPAT_NETWORK, cancellable,
"user", key_name);
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
// fallback to the old keyring key string for upgrading users
if (password == null) {
Geary.Credentials creds = get_credentials(service, account_information);
// <= 0.6
password = yield migrate_old_password(get_key_name(service, creds.user),
key_name, cancellable);
// 0.1
if (password == null) {
password = yield migrate_old_password(OLD_GEARY_USERNAME_PREFIX + creds.user,
key_name, cancellable);
}
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
}
if (password == null)
debug("Unable to fetch password in libsecret keyring for %s", account_information.email);
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
return password;
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
}
public virtual async void set_password_async(
Geary.Service service, Geary.AccountInformation account_information,
Cancellable? cancellable = null) throws Error {
string key_name = get_key_name(service, account_information.email);
Geary.Credentials credentials = get_credentials(service, account_information);
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
bool result = yield Secret.password_store(Secret.SCHEMA_COMPAT_NETWORK,
null, key_name, credentials.pass, cancellable, "user", key_name);
if (!result)
debug("Unable to store password for \"%s\" in libsecret keyring", key_name);
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
}
public virtual async void clear_password_async(
Geary.Service service, Geary.AccountInformation account_information, Cancellable? cancellable = null)
throws Error {
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
// delete new-style and old-style locations
Geary.Credentials credentials = get_credentials(service, account_information);
// new-style
yield Secret.password_clear(Secret.SCHEMA_COMPAT_NETWORK, cancellable, "user",
get_key_name(service, account_information.email));
// <= 0.6
yield Secret.password_clear(Secret.SCHEMA_COMPAT_NETWORK, cancellable, "user",
get_key_name(service, credentials.user));
// 0.1
yield Secret.password_clear(Secret.SCHEMA_COMPAT_NETWORK, cancellable, "user",
OLD_GEARY_USERNAME_PREFIX + credentials.user);
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
}
public virtual async bool prompt_passwords_async(Geary.ServiceFlag services,
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
Geary.AccountInformation account_information,
out string? imap_password, out string? smtp_password,
out bool imap_remember_password, out bool smtp_remember_password) throws Error {
// Our dialog doesn't support asking for both at once, even though this
// API would indicate it does. We need to revamp the API.
assert(!services.has_imap() || !services.has_smtp());
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
// to prevent multiple dialogs from popping up at the same time, use a nonblocking mutex
// to serialize the code
int token = yield dialog_mutex.claim_async(null);
// If the main window is hidden, make it visible now and present to user as transient parent
Gtk.Window? main_window = GearyApplication.instance.controller.main_window;
if (main_window != null && !main_window.visible) {
main_window.show_all();
main_window.present_with_time(Gdk.CURRENT_TIME);
}
PasswordDialog password_dialog = new PasswordDialog(main_window, services.has_smtp(),
account_information, services);
bool result = password_dialog.run();
dialog_mutex.release(ref token);
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
if (!result) {
// user cancelled the dialog
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
imap_password = null;
smtp_password = null;
imap_remember_password = false;
smtp_remember_password = false;
return false;
}
// password_dialog.password should never be null at this point. It will only be null when
// password_dialog.run() returns false, in which case we have already returned.
if (services.has_smtp()) {
imap_password = null;
imap_remember_password = false;
smtp_password = password_dialog.password;
smtp_remember_password = password_dialog.remember_password;
} else {
imap_password = password_dialog.password;
imap_remember_password = password_dialog.remember_password;
smtp_password = null;
smtp_remember_password = false;
}
Add basic pluggable keyring support; fix #6219 Squashed commit of the following: commit 9167aeb56be6789d49a3e7cdba2a21d2b015e40d Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 16:11:20 2013 -0800 Fix for code guidelines commit 7612a7ddc3df14ef207b9e74ee32fa23710e1ce9 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 15:26:48 2013 -0800 Fix code review issues commit 46635544c98df7a8b6c76f028715814907274389 Merge: 30b611e 6de36ae Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 25 12:54:03 2013 -0800 Merge branch 'master' into pluggable-auth commit 30b611ed415fe7a2c1d62746f94620132ec86623 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 17:12:24 2013 -0800 Only prompt for IMAP password on startup commit ca2953b4b33cb367c060164df9f2258217e94046 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:34:39 2013 -0800 Fix compile errors; cleanup commit 545764a6a914ff36a1ca187444d0830a28502bab Merge: 0460a68 e498354 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:31:43 2013 -0800 Merge branch 'master' into pluggable-auth Conflicts: src/client/geary-application.vala commit 0460a68af4de3e762522fd641c16675cfc7d2241 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:20:31 2013 -0800 Use Engine's mediator implicitly commit 22cbb8740e711ca3151b0389aef9cbb8c21928c7 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 16:19:55 2013 -0800 Use flags on things that are supposed to be flags commit 4dc0eb15d2fe23c92d8cc6cff8a3138b6cb1baf4 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 15:49:50 2013 -0800 Fix prompting in certain cases commit 56bb2265a6635a754b9a00b469ec457105390896 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 14:37:12 2013 -0800 Fix typo commit 926f47024f1280271bc36cd8c60eb948bed4a432 Author: Charles Lindsay <chaz@yorba.org> Date: Thu Jan 24 11:43:05 2013 -0800 Cleanup, compile, smoke test commit 9ff4257d125e67828f0c813e0806d3d34c114550 Author: Charles Lindsay <chaz@yorba.org> Date: Fri Jan 18 10:41:17 2013 -0800 First stab at new pluggable auth API
2013-01-25 16:13:46 -08:00
return true;
}
}