You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every single time when public key is pulled from external sources, it would use a general PubLookup class, which has lookupEmail(email: string) method on it.
Inside the Attester class, disallow_attester_search_for_domains would be used so that it returns empty in case searching is disabled on that domain (or completely), meaning this setting does not affect searching on WKD.
I recommend to open above code in vscode so that you can explore it (with ctrl+click) and get a better understanding of where it is used (right click + see usages) or how it fits together.
As I understand it relates to search by email only (for fingerprints we use attester). Right?
I'd like to remind you what logic we use:
User types user@example.test
We search by email via attester
User sends a message. We already have a pub key for user@example.test in the cache
User creates a new message again
User types user@example.test
As we already have a pub key for user@example.test in the cache we make a request by fingerprint(via attester) to fetch the latest pub key to keep keys fresh
As we already have a pub key for user@example.test in the cache we make a request by fingerprint(via attester) to fetch the latest pub key to keep keys fresh
This should be using PubLookup as well - a general place to search for external public keys
PubLookup.getFingerprint(fingerprint: string) should only try Attester, because WKD does not support pulling by fingerprint. However, disallow_attester_search_for_domains is set to ["*"] then attester should always return an empty result, even when searching by fingerprint. I'm not sure if I highlighted this before. Is this already implemented or should we first add that?
That means, with disallow_attester_search_for_domains: ["*"] in client configuration, that keys will never get updated this way.
I'll file an issue for 3) separately, as we still need a solution for WKD, and it will work by re-fetching by email. I thought we already did that on browser extension - will investigate, and then describe the logic on that issue too.
However, disallow_attester_search_for_domains is set to ["*"] then attester should always return an empty result, even when searching by fingerprint. I'm not sure if I highlighted this before. Is this already implemented or should we first add that?
It's already true for now = if disallow_attester_search_for_domains is set to ["*"] then attester always return an empty result
Activity
DenBond7 commentedon Aug 10, 2021
@tomholub Could you show me the logic that you use for the web extension? Where you use the
WKDclient to fetch pub keys.tomholub commentedon Aug 10, 2021
Every single time when public key is pulled from external sources, it would use a general
PubLookupclass, which haslookupEmail(email: string)method on it.It's implemented here: https://github.com/FlowCrypt/flowcrypt-browser/blob/master/extension/js/common/api/pub-lookup.ts
When the method is called:
In the code I linked above, there is also a third pubkey source
internalSkswhich we will not be implementing on Android.tomholub commentedon Aug 10, 2021
Inside the
Attesterclass,disallow_attester_search_for_domainswould be used so that it returns empty in case searching is disabled on that domain (or completely), meaning this setting does not affect searching on WKD.tomholub commentedon Aug 10, 2021
I recommend to open above code in vscode so that you can explore it (with ctrl+click) and get a better understanding of where it is used (right click + see usages) or how it fits together.
DenBond7 commentedon Aug 10, 2021
As I understand it relates to
search by emailonly (for fingerprints we useattester). Right?I'd like to remind you what logic we use:
user@example.testby emailviaattesteruser@example.testin the cacheuser@example.testuser@example.testin the cache we make a request byfingerprint(viaattester) to fetch the latest pub key to keep keys freshtomholub commentedon Aug 10, 2021
The browser extension logic is here:
https://github.com/FlowCrypt/flowcrypt-browser/blob/ecf83dda1cb272a1096321ab4ff244ca567364ca/extension/chrome/elements/compose-modules/compose-storage-module.ts#L141
This should be using
PubLookupas well - a general place to search for external public keysPubLookup.getFingerprint(fingerprint: string)should only try Attester, because WKD does not support pulling by fingerprint. However,disallow_attester_search_for_domainsis set to["*"]then attester should always return an empty result, even when searching by fingerprint. I'm not sure if I highlighted this before. Is this already implemented or should we first add that?That means, with
disallow_attester_search_for_domains: ["*"]in client configuration, that keys will never get updated this way.I'll file an issue for 3) separately, as we still need a solution for WKD, and it will work by re-fetching by email. I thought we already did that on browser extension - will investigate, and then describe the logic on that issue too.
DenBond7 commentedon Aug 10, 2021
It's already
truefor now = if disallow_attester_search_for_domains is set to ["*"] then attester always return an empty resulttomholub commentedon Aug 10, 2021
Even when calling by fingerprint? Just checking :-)
DenBond7 commentedon Aug 10, 2021
Yup :)
flowcrypt-android/FlowCrypt/src/main/java/com/flowcrypt/email/api/retrofit/FlowcryptApiRepository.kt
Line 113 in 4771ba0
15 remaining items
Renamed CreateMessageActivityTestTest to CreateMessageActivityTest.| #…
Refactored code to use PubLookup.| #1201
Added CreateMessageActivityWkdTest(not completed). Refactored code.| #…
DenBond7 commentedon Aug 12, 2021
Just for history. To be able to test WKD need to execute the following
We run a mock web server on https://localhost:1212. For testing we need to route all traffic for
localhosttolocalhost:1212Added more tests. Refactored code.| #1201
Refactored code.| #1201
Added one more test. Refactored code.| #1201
Modified ci-wait-for-emulator.sh to route all traffic for localhost t…
Modified PubLookup to get first matching key by 'usableForEncryption'…
Switched to use "platforms;android-30" fro tests on CI.| #1201
Modified existed tests.| #1201
Restored WkdClientTest with a few changes.| #1201
Refactored code.| #1201
issue #1201 Integrated WKD in the app (#1399)