Uh oh!
There was an error while loading. Please reload this page.
Added handling disallow_attester_search_for_domains OrgRule - #1387
Merged
IvanPizhenko merged 3 commits intoAug 9, 2021
Conversation
DenBond7force-pushed
the
issue_1203_disallow_attester_search_for_domains
branch
from
August 6, 2021 07:12
9f1b659 to
8d0fe16CompareDenBond7
marked this pull request as ready for review
August 6, 2021 13:37
| throw IllegalStateException("Not a valid email $emailAddr") | ||
| } | ||
| return !disallowedDomains.contains(userDomain) |
Contributor
There was a problem hiding this comment.
doesn't this require sort of case-insensitive comparison?
CollaboratorAuthor
There was a problem hiding this comment.
This realization is based on https://github.com/FlowCrypt/flowcrypt-browser/blob/48cb02a244b71a2acffbbc0fdb6ed4254baa0da3/extension/js/common/org-rules.ts#L170-L192.
Does include mean case-insensitive comparison?
Contributor
There was a problem hiding this comment.
In typescript we have:
publiccanLookupThisRecipientOnAttester=(emailAddr: string): boolean=>{
....constuserDomain=Str.getDomainFromEmailAddress(emailAddr);if(!userDomain){thrownewError(`Not a valid email ${emailAddr}`);}return!disallowedDomains.includes(userDomain);}and then:
publicstaticgetDomainFromEmailAddress=(emailAddr: string)=>{// todo: parseEmail()?returnemailAddr.toLowerCase().split('@')[1];}So function for getting domain in the typescript casts it to lowercase and then if you configure everything in lowercase, all works.
In Kotlin that doesn't happen:
// from EmailUtil.ktfungetDomain(email:String): String {
returnwhen {
TextUtils.isEmpty(email) ->""
email.contains("@") -> email.substring(email.indexOf('@') +1)
else->""
}
}CollaboratorAuthor
There was a problem hiding this comment.
I see. Thank you. I will fix it.
tomholub
commented
Aug 8, 2021
Collaborator
Well noticed, Ivan - thank you. |
IvanPizhenko
approved these changes
Aug 9, 2021
IvanPizhenko
deleted the
issue_1203_disallow_attester_search_for_domains
branch
August 9, 2021 20:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR added handling disallow_attester_search_for_domains OrgRule
close#1203
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):