Make account registration whitelists local#3043
Merged
Conversation
fisx
commented
Feb 8, 2023
services/brig/src/Brig/Whitelist.hs
Outdated
| -- email/phone address is whitelisted. | ||
| verify :: Maybe WhitelistEmailDomains -> Maybe WhitelistPhonePrefixes -> Either Email Phone -> Bool | ||
| verify (Just (WhitelistEmailDomains allowed)) _ (Left email) = emailDomain email `elem` allowed | ||
| verify _ (Just (WhitelistPhonePrefixes allowed)) (Right phone) = any (`Text.isPrefixOf` fromPhone phone) allowed |
Contributor
Author
There was a problem hiding this comment.
this allows for empty prefixes, which may or may not be what the admin wants, but i'm leaning against adding a special case that ignores or errors out on - "".
jschaul
reviewed
Feb 8, 2023
Member
jschaul
left a comment
There was a problem hiding this comment.
While you're at it, could you rename Whitelist to Allowlist in the types everywhere consistently? I see the config is called Allowlist; but the code still uses Whitelist*.
Contributor
Author
oops, thanks! b1d530c |
elland
reviewed
Feb 9, 2023
| import Brig.Options (setWhitelist) | ||
| import Brig.Options (setAllowlistEmailDomains, setAllowlistPhonePrefixes) | ||
| import Brig.Phone (Phone, PhoneException (..)) | ||
| import qualified Brig.Whitelist as Whitelist |
Contributor
There was a problem hiding this comment.
Maybe worth going all in and changing terms everywhere? :)
Contributor
Author
Contributor
Author
This was referenced Mar 6, 2023
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 free
to 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.
https://wearezeta.atlassian.net/browse/SQPIT-405 (a related wire infrastructure PR is linked in the ticket)
This is changing a feature wire has been using on our staging environment, and (probably?) not anywhere else. See the changelog if you think you may be affected.
Since the service is both outdated and almost unused, this PR moves the data from that service into the local server config yaml.
Migration should be painless, since the new settings are in a different place than the old ones. Just make sure the new fields are added to the config before the upgrade, and then you can remove the old ones at any time after.
Checklist
changelog.d