Skip to content

[DO NOT MERGE] Backend work for testing AAF integration work on aaf-dev tenant - #282

Draft
amandazhuyilan wants to merge 22 commits into
mainfrom
aaf-dev
Draft

amandazhuyilan wants to merge 22 commits into
mainfrom
aaf-dev

Conversation

@amandazhuyilan

Copy link
Copy Markdown
Contributor

No description provided.

@amandazhuyilan
amandazhuyilan marked this pull request as draft July 6, 2026 00:25
amandazhuyilan and others added 19 commits July 31, 2026 14:06
* feat: add account_type field to BiocommonsUser

* chore: add migration for account type

* test: unit test enum handling for account_type

* refactor: make app_metadata mandatory, but allow for Auth0 responses not including it

* refactor: set account type when creating user from Auth0 data

* fix: make migration compatible with sqlite

* test: update tests with account_type

* fix: set account type automatically when syncing exported users

* test: factory functions for new schemas

* test: update tests to reflect changed schemas

* fix: add path_separator to alembic config to address deprecation warning

* fix: add httpx2 for starlette test client

* fix: bump starlette-admin to fix deprecation warning

* fix: make sure account type enum is created in migration

* feat: add account permissions for checking if user can change email/password etc

* chore: apply account permission checks to password/username/email change endpoints

* test: add unit test of endpoint permissions for AAF accounts

* feat: add account type to export

* test: update tests of export

* feat: allow exporting users for specific connections

* chore: allow testing workflows to run on all PRs, not just to main

* feat: Auth0 client methods to get connections

* fix: only sync DB connection users for now

* chore: add pytest-sugar for better test output

* test: factories for Auth0 connection data

* test: tests of connection methods

* fix: disable username change for AAF for now, needs more thought

* test: update test of AAF change username
…4) (#294)

* feat: allow filtering users by connection when searching by email

* feat: updated schemas for AAF info

* feat: link_identity method for Auth0Client

* feat: record other user ID for users

* feat: method to link account for BiocommonsUser

* fix: linking_completed_at should be datetime

* feat: dependency to check Auth0 action tokens

* feat: router with initial /aaf/check-link endpoint

* chore: include aaf router in main

* refactor: use a base URL for Auth0 API calls

* test: unit tests of new Auth0Client methods

* test: unit tests of AAF link function

* test: tests of require_action_token

* test: unit tests of account linking endpoint

* fix: get connection correctly when linking accounts

* fix: skip linking if already done

* fix: update app_metadata to mark user AAF only if no existing account

* test: unit tests of app_metadata for AAF-only accounts

* fix: handle errors when Auth0 already linked
…urn a response (AAI-877) (#295)

* feat: allow filtering users by connection when searching by email

* feat: updated schemas for AAF info

* feat: link_identity method for Auth0Client

* feat: record other user ID for users

* feat: method to link account for BiocommonsUser

* fix: linking_completed_at should be datetime

* feat: dependency to check Auth0 action tokens

* feat: router with initial /aaf/check-link endpoint

* chore: include aaf router in main

* refactor: use a base URL for Auth0 API calls

* test: unit tests of new Auth0Client methods

* test: unit tests of AAF link function

* test: tests of require_action_token

* test: unit tests of account linking endpoint

* fix: get connection correctly when linking accounts

* fix: skip linking if already done

* fix: update app_metadata to mark user AAF only if no existing account

* test: unit tests of app_metadata for AAF-only accounts

* fix: handle errors when Auth0 already linked

* feat: create_action_token function to sign tokens for Auth0 actions

* fix: need to return a redirect response to Auth0 in check-link

* test: update tests of check-link

* fix: fall back to Auth0 domain if custom domain not defined

* test: make sure we test redirect location

* fix: set required fields on action token payload

* fix: make sure we're including all the required fields for a token returned to Auth0

* test: update tests

* fix: action token should also contain iat field

* fix: don't return 403 response for blocked accounts, return a token to Auth0

* fix: can't link on this side, return identity to Auth0 for linking

* test: update tests

* fix: remove response_model - response is a redirect
* feat: delete_user method for Auth0Client

* feat: hard-delete method for BiocommonsUser

* feat: allow hard-delete in db-admin (dev-aaf env only)

* test: unit tests of hard-delete
* chore: replace httpx usage with httpx2

* feat: replace httpx dependency with httpx2

* fix: workarounds to make respx work with httpx2

* chore: update lock file
* feat: add login proxy URL to settings - used to check AAF emails

* test: add proxy URL to mock settings for testing

* feat: function to check if email is AAF

* test: unit test of is_aaf_email

* refactor: move common registration logic to a shared module

* refactor: use shared utils in existing register function

* feat: schemas for AAF registration/metadata

* feat: initial implementation of AAF register endpoint

* test: rework tests of sbp domain check

* refactor: move platform/bundle creation into shared utils

* fix: catch error when updating Auth0 metadata

* refactor: use bundle/platform utils in AAF register function

* fix: block requests for SBP if not enabled

* test: unit test for validating token from Auth0

* fix: make name values optional in registration token

* test: set email_verified by default when generating Auth0UserData

* refactor: move AAF registration route to existing register router

* test: unit tests of AAF register

* fix: set aaf_only, account_type in app_metadata
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