Skip to content

AAI-386: Restrict user registration to a restricted list of domains [SBP]#82

Merged
minh-biocommons merged 7 commits into
mainfrom
sbp-register-whitelist
Sep 28, 2025
Merged

AAI-386: Restrict user registration to a restricted list of domains [SBP]#82
minh-biocommons merged 7 commits into
mainfrom
sbp-register-whitelist

Conversation

@minh-biocommons

@minh-biocommons minh-biocommons commented Sep 26, 2025

Copy link
Copy Markdown
Collaborator

Description

AAI-386: Restrict user registration to a restricted list of domains [SBP]

Changes

  • Added email domain validation for sbp register route
  • Added sbp allowed list to settings
  • Added/updated relevant tests

Checklist

  • I have commented my code, particularly in hard-to-understand areas
  • I have added unit / integration tests that prove my fix is effective or that my feature works
  • I have run all tests locally and they pass
  • I have updated the documentation (if applicable)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Implements email domain validation for SBP user registration to restrict registration to approved institutional domains.

  • Added domain validation logic to check email addresses against an allowed list
  • Added configuration for approved institutional domains (UNSW, BioCommons, USyd, WEHI, Monash, Griffith, UoM)
  • Updated tests to use approved domains and validate the new restriction functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
config.py Adds list of approved email domains for SBP registration
routers/sbp_register.py Implements email domain validation with rejection logic
tests/test_sbp_register.py Updates test data and adds validation tests

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread routers/sbp_register.py Outdated
Comment thread routers/sbp_register.py Outdated
Comment thread tests/test_sbp_register.py Outdated

@marius-mather marius-mather left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A few minor comments, but please use an existing email parser like email-validator to extract the domain - email addresses can have all kinds of weirdness, better to use a library that already handles all of it.

Comment thread config.py Outdated
Comment thread config.py
Comment thread routers/sbp_register.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread routers/sbp_register.py
Comment thread routers/sbp_register.py

@marius-mather marius-mather left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, thanks

@minh-biocommons minh-biocommons merged commit 79f1236 into main Sep 28, 2025
3 checks passed
@amandazhuyilan amandazhuyilan deleted the sbp-register-whitelist branch June 19, 2026 03:22
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.

3 participants