Skip to content

issue #1317 WKD client - #1377

Merged
IvanPizhenko merged 2 commits into
masterfrom
ip-1317-wkd-client
Jul 31, 2021
Merged

issue #1317 WKD client#1377
IvanPizhenko merged 2 commits into
masterfrom
ip-1317-wkd-client

Conversation

@IvanPizhenko

@IvanPizhenkoIvanPizhenko commented Jul 30, 2021

Copy link
Copy Markdown
Contributor

This PR adds WKD client class with logic ported from Typescript

close#1317


Tests(delete all except exactly one):

  • Tests added or updated

To be filled by reviewers

I have reviewed that this PR... (tick whichever items you personally focused on during this review):

  • addresses the issue it closes (if any)
  • code is readable and understandable
  • is accompanied with tests, or tests are not needed
  • is free of vulnerabilities

fun nonExistingEmailTest() {
val keys = WkdClient.lookupEmail("no.such.email.for.sure@flowcrypt.com")
assertTrue("Key found for non-existing email", keys == null)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, should also test the following:

In both cases, it should return no pubkey without throwing or failing.

Timeout is 3 seconds when it cannot reach, then it returns 'no pubkey'.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tomholub
I've added tests with these emails.
In TypeScript timeout was 4 seconds, so I've used that.
Not sure how to test what will happen on timeout expiration.

@tomholub

tomholub commented Jul 30, 2021 via email

Copy link
Copy Markdown
Collaborator

@IvanPizhenko

IvanPizhenko commented Jul 31, 2021

Copy link
Copy Markdown
ContributorAuthor

@DenBond7 Any ideas how to test request timeout? Tom says you may know.

@IvanPizhenko

Copy link
Copy Markdown
ContributorAuthor

So I am merging this as and test for timeout will be added in separate issue. I think I've got an idea how to do it.

@IvanPizhenko
IvanPizhenko merged commit d842111 into masterJul 31, 2021
@IvanPizhenko
IvanPizhenko deleted the ip-1317-wkd-client branch July 31, 2021 15:28
@DenBond7

Copy link
Copy Markdown
Collaborator

@DenBond7 Any ideas how to test request timeout? Tom says you may know.

Sorry, I can't look at that until Monday. I'm a little far from my PC.

@IvanPizhenko

Copy link
Copy Markdown
ContributorAuthor

@DenBond7 Any ideas how to test request timeout? Tom says you may know.

Sorry, I can't look at that until Monday. I'm a little far from my PC.

No problem.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

implement WKD client class

3 participants

@IvanPizhenko@tomholub@DenBond7