Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/issue 732 compose pub key validation #821

Merged
merged 11 commits into from
Oct 28, 2021

Conversation

sosnovsky
Copy link
Collaborator

@sosnovsky sosnovsky commented Oct 28, 2021

This PR adds pub keys validation before sending emails. It also updates encryption to use only valid keys.

close #732
close #744


Tests (delete all except exactly one):

  • Tests added or updated - added new tests for updated validation (testValidateMessageInputWithExpiredRecipientPubKey, testValidateMessageInputWithRevokedRecipientPubKey, testValidateMessageInputWithValidAndInvalidRecipientPubKeys)

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
  • is documented clearly and usefully, or doesn't need documentation

@sosnovsky sosnovsky requested a review from tomholub October 28, 2021 13:37
@sosnovsky
Copy link
Collaborator Author

@tomholub I currently have only 2 tasks assigned, can you please check which tasks should I take after these ones?

@tomholub tomholub changed the title Feature/issue 732 compose errors Feature/issue 732 compose pub key validation Oct 28, 2021
Copy link
Collaborator

@tomholub tomholub left a comment

Choose a reason for hiding this comment

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

Code looks good with a comment + two improvements to do in the future.

Will build and test it now

Comment on lines +256 to +257
let selectedRecipients = contextToSend.recipients.filter(\.state.isSelected)
selectedRecipients.forEach(evaluate)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not too sure about this - the validation happens asynchronously as a task. Would that be of any use? By the time it figures out it's wrong, this method may already finish.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's just for UI, because when recipient is selected then user won't be able to see if it's highlighted with red or orange color. Evaluation result isn't used for determining valid recipients.

@tomholub
Copy link
Collaborator

tomholub commented Oct 28, 2021

@sosnovsky I got this crash/assertionFailure but not sure if it's related or not?

#832

@tomholub
Copy link
Collaborator

Otherwise works well, and that one was an assertionFailure - not too bad, so I'll merge it. The asynchronous validation can be discussed in another issue.

@tomholub tomholub merged commit 838917c into master Oct 28, 2021
@tomholub tomholub deleted the feature/issue-732-compose-errors branch October 28, 2021 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants