Make sure auth key selection dialog lists only keys with auth subkey available.
Presently the dialog lists all master keys, and keys without auth subkeys are not marked in any way. Sleecting one of those via SSH authentication API will result in cryptic "Could not create description: null" message.master
parent
29b014edad
commit
4e4c070228
|
@ -164,6 +164,11 @@ public class KeyRepository extends AbstractDao {
|
|||
return mapAllRows(query, SubKey.UNIFIED_KEY_INFO_MAPPER);
|
||||
}
|
||||
|
||||
public List<UnifiedKeyInfo> getAllUnifiedKeyInfoWithAuthKeySecret() {
|
||||
SqlDelightQuery query = SubKey.FACTORY.selectAllUnifiedKeyInfoWithAuthKeySecret();
|
||||
return mapAllRows(query, SubKey.UNIFIED_KEY_INFO_MAPPER);
|
||||
}
|
||||
|
||||
public List<UserId> getUserIds(long... masterKeyIds) {
|
||||
SqlDelightQuery query = UserPacket.FACTORY.selectUserIdsByMasterKeyId(masterKeyIds);
|
||||
return mapAllRows(query, UserPacket.USER_ID_MAPPER);
|
||||
|
|
|
@ -104,7 +104,7 @@ public class RemoteSelectAuthenticationKeyActivity extends FragmentActivity {
|
|||
if (keyInfoLiveData == null) {
|
||||
keyInfoLiveData = new GenericLiveData<>(context, () -> {
|
||||
KeyRepository keyRepository = KeyRepository.create(context);
|
||||
return keyRepository.getAllUnifiedKeyInfoWithSecret();
|
||||
return keyRepository.getAllUnifiedKeyInfoWithAuthKeySecret();
|
||||
});
|
||||
}
|
||||
return keyInfoLiveData;
|
||||
|
|
|
@ -92,6 +92,11 @@ SELECT * FROM unifiedKeyView
|
|||
WHERE has_any_secret_int = 1
|
||||
ORDER BY creation DESC;
|
||||
|
||||
selectAllUnifiedKeyInfoWithAuthKeySecret:
|
||||
SELECT * FROM unifiedKeyView
|
||||
WHERE has_any_secret_int = 1 AND has_auth_key_int IS NOT NULL
|
||||
ORDER BY creation DESC;
|
||||
|
||||
selectMasterKeyIdBySubkey:
|
||||
SELECT master_key_id
|
||||
FROM keys
|
||||
|
|
Loading…
Reference in New Issue