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

feat: support whitelisting domains through agencies table #1141

Merged
merged 2 commits into from
Apr 26, 2021

Conversation

lamkeewei
Copy link
Contributor

Problem

Closes #1115

Solution

Features:

  • Add Agency model and table in database
  • Validate whitelisted domain using both config domains and agencies table domains

Improvements:

  • Log matched domain for each authentication request

Tests

  • Add email domain (e.g. @gmail.com) to agencies table using the following query:
INSERT INTO agencies VALUES('@gmail.com', CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
  • Check that you will be able to request for the OTP with an email belonging to the newly inserted domain
  • Delete the domain in agencies table
  • Check that you will not be able to request for an OTP with an email belonging to the deleted domain

@lamkeewei lamkeewei requested a review from miazima April 26, 2021 01:33
Copy link
Contributor

@miazima miazima left a comment

Choose a reason for hiding this comment

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

Tested adding and removing whitelisted agencies, lgtm

@miazima miazima merged commit dde8fe8 into develop Apr 26, 2021
@miazima miazima deleted the agency-table-whitelist branch April 26, 2021 07:58
lamkeewei added a commit that referenced this pull request May 5, 2021
* develop:
  refactor: use shared function to initialize models (#1172)
  chore: setup scaffolding for backend tests (#940)
  1.23.0
  fix(frontend): fix frontend test flakiness (#1162)
  fix: update successful delivery status only if error does not exist (#1150)
  chore: upgrade dependencies (#1153)
  feat: add unit tests for error states in critical workflows (#1118)
  feat: support whitelisting domains through `agencies` table (#1141)
  feat: add tests for happy paths in critical workflows (#1110)
  fix: prevent campaign names from causing dashboard rows to overflow (#1147)
  fix(email): Fix SendGrid fallback integration (#1026)
lamkeewei added a commit that referenced this pull request May 5, 2021
* develop:
  feat: refactor msg template components; add telegram character limit (#1148)
  refactor: use shared function to initialize models (#1172)
  chore: setup scaffolding for backend tests (#940)
  1.23.0
  fix(frontend): fix frontend test flakiness (#1162)
  fix: update successful delivery status only if error does not exist (#1150)
  chore: upgrade dependencies (#1153)
  feat: add unit tests for error states in critical workflows (#1118)
  feat: support whitelisting domains through `agencies` table (#1141)
  feat: add tests for happy paths in critical workflows (#1110)
  fix: prevent campaign names from causing dashboard rows to overflow (#1147)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Whitelisted email domains table
2 participants