-
Notifications
You must be signed in to change notification settings - Fork 325
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
Make account registration whitelists local #3043
Conversation
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 - ""
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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*
.
oops, thanks! b1d530c |
import Brig.API.Error | ||
import qualified Brig.AWS as AWS | ||
import Brig.App | ||
import Brig.CanonicalInterpreter (BrigCanonicalEffects, runBrigToIO) | ||
import Brig.Email (Email) | ||
import Brig.Options (setWhitelist) | ||
import Brig.Options (setAllowlistEmailDomains, setAllowlistPhonePrefixes) | ||
import Brig.Phone (Phone, PhoneException (..)) | ||
import qualified Brig.Whitelist as Whitelist |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe worth going all in and changing terms everywhere? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
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