signup: add DNS checker and run against suspicious hosts #3
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "nbsp/town:suspicious-hosts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
extremely WIP, proof of concept, entirely untested end-to-end, but the function part works wonders
a few open questions:
definitely need to move the suspicious hosts list into an admin-only file if we're to add any more of thesemoved to a table on signups.sql (a non-destructive migration is needed)as mentioned this also adds some as-yet-unused errors that will prove useful for notifying the user that their email doesn't exist. implementing that is out of scope for this PR i think
fde4ee9ccctob80c5cd8ccb80c5cd8ccto0f73197728add DNS checker and run against suspicious hoststo signup: add DNS checker and run against suspicious hosts521af4dfd5to49bf74e692I like this direction <3 thank you! extremely minor change requested
@ -205,0 +242,4 @@su.Email = string(s.Input.Bytes())suspiciousHosts, err := models.SuspiciousHosts(db)if err != nil {// XXX: maybe log somewhere that the database failedlogging good, see lockingwriter package and its use
@ -205,0 +252,4 @@if records, err := DigMX(su.Email); err == nil {for _, record := range records {if slices.Contains(shDomains, record) {su.Notes = append(su.Notes, models.SignupNote{I love using notes for this
@ -205,2 +263,4 @@},func(s *scene, tv *tview.TextView, msg string) {// TODO could check and see if it's email shaped and admonish if not// NOTE(nbsp): DigMX call can see if email is invalid but this isn't used yetI predict splitting out the regex from DigMX but it's fine the way it is now.
The signing up user should not have any notion of suspicious email hosts but we should gently prod them until we see an email shaped thing
@ -27,0 +30,4 @@id INTEGER PRIMARY KEY,domain TEXT,-- unused but worth adding instead of another migration laterI find unused stuff more confusing than later need to migrate so I'd leave out unused columns for now
Checkout
From your project repository, check out a new branch and test the changes.