Uh oh!
There was an error while loading. Please reload this page.
Added an ability to allow attester search only for domains.| #1827 - #1831
Conversation
Uh oh!
There was an error while loading. Please reload this page.
…ainsEmptyFlowTest.| #1827
tomholub
left a comment
There was a problem hiding this comment.
looks good, but see comment - there are now two ways to disable attester completely
Eventually we'll remove the * method
What exactly does disallowLookupOnAttester do that canLookupThisRecipientOnAttester wouldn't already do?
| return allowAttesterSearchOnlyForDomains == null | ||
| && (disallowAttesterSearchForDomains ?: emptyList()).contains("*") |
There was a problem hiding this comment.
Also add (original condition) || (allowAttesterSearchOnlyForDomains != null && allowAttesterSearchOnlyForDomains.isEmpty)
There was a problem hiding this comment.
Eventually we'll remove the * method
Maybe will be better to remove disallowLookupOnAttester in that case. Please look at #1831 (comment)
tomholub
commented
Jun 7, 2022
maybe that's for fingerprint lookup, but do we still support that? |
DenBond7
commented
Jun 7, 2022
@tomholub we use this code here if (identData.isValidEmail()) {
val wkdResult = getResult(requestCode = requestCode) {
val pgpPublicKeyRingCollection =WkdClient.lookupEmail(context, identData)
//For now, we just peak at the first matching key. It should be improved inthe future.// See more details here https://github.com/FlowCrypt/flowcrypt-android/issues/480val firstMatchingKey = pgpPublicKeyRingCollection?.firstOrNull {
KeyRingInfo(it)
.getEncryptionSubkeys(EncryptionPurpose.ANY)
.isNotEmpty()
}
firstMatchingKey?.armor()?.let { armoredPubKey ->Response.success(armoredPubKey)
} ?:Response.error(HttpURLConnection.HTTP_NOT_FOUND, "Not found".toResponseBody())
}
if (wkdResult.status ==Result.Status.SUCCESS&& wkdResult.data?.isNotEmpty() ==true) {
return@withContext resultWrapperFun(wkdResult)
}
if (orgRules?.canLookupThisRecipientOnAttester(identData) ==false) {
return@withContext Result.success(
requestCode = requestCode,
data =PubResponse(null, null)
)
}
} elseif (orgRules?.disallowLookupOnAttester() ==true) { // <------- HEREreturn@withContext Result.success(
requestCode = requestCode,
data =PubResponse(null, null)
)
}
val apiService =ApiHelper.getInstance(context).retrofit.create(ApiService::class.java)
val result = getResult(requestCode = requestCode) { apiService.getPubFromAttester(identData) }
return@withContext resultWrapperFun(result)But maybe it's not relevant today. It may relay to the following #1399 and #1201 (comment) |
I suspect maybe this branch is never called anymore } elseif (orgRules?.disallowLookupOnAttester() ==true) { // <------- HEREreturn@withContext Result.success(
requestCode = requestCode,
data =PubResponse(null, null)
)
}because when getting updated public keys, we no longer do it by fingerprint. We search them again on email, regardless of source (wkd or attester). I don't think we have any |
DenBond7
commented
Jun 7, 2022
Agree. Currently we have |
This PR added an ability to allow attester search only for domains
close#1827
Tests(delete all except exactly one):
To be filled by reviewers
I have reviewed that this PR... (tick whichever items you personally focused on during this review):