Skip to content

feat: remind SBP bundle users when they change their emails#278

Merged
amandazhuyilan merged 3 commits into
mainfrom
SBP-398-remind-user-email-change-for-sbp-bundle
Jun 11, 2026
Merged

feat: remind SBP bundle users when they change their emails#278
amandazhuyilan merged 3 commits into
mainfrom
SBP-398-remind-user-email-change-for-sbp-bundle

Conversation

@amandazhuyilan

@amandazhuyilan amandazhuyilan commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Description

SBP-398: Auto-revoke SBP bundle when a user changes to a non-institutional email

Changes

  • On email-change confirmation (POST /me/profile/email/continue), if the user holds an approved SBP bundle and the new email is non-institutional, automatically revoke the bundle and its backing Auth0 role (via existing GroupMembership.revoke()).
  • Adds tri-state check_australian_research_institution_email() returning True/False/None; revocation only fires on a definitive non-institutional result — an indeterminate result (e.g. upstream outage) is logged and left untouched, so a transient failure never wrongly strips access.
  • Existing is_australian_research_institution_email() now delegates to the tri-state helper; its False-on-error contract (used by registration/request gates) is unchanged.
  • Remove biocommons.org.au that was whitelisted in the Australian Institutional list previously - now its added

Related front end changes: AustralianBioCommons/aai-portal#244

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)
  • For any new secrets, I have updated the shared spreadsheet and the GitHub Secrets.

How to Test Manually (if necessary)

uv run pytest

@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, just want to clarify how we record the revocation

Comment thread routers/user.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.

good to go

@amandazhuyilan amandazhuyilan merged commit 877d83a into main Jun 11, 2026
5 checks passed
@amandazhuyilan amandazhuyilan deleted the SBP-398-remind-user-email-change-for-sbp-bundle branch June 11, 2026 03:20
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.

2 participants