Commit daf0687
fix: fix circular import caused by type annotations (#111)
* refactor: rename user_is_admin -> user_is_general_admin to make purpose clearer
* refactor: rename SessionUser.is_admin SessionUser.is_biocommons_admin
* feat: add group/platform admin checks for the user
* refactor: rename get_current_user -> get_session_user for clarity
* refactor: add DB checks to user_is_general_admin check
* test: update tests to allow for updated admin check
* test: add tests of user_is_general_admin check
* test: add tests of DB admin checks
* refactor: update is-admin endpoint to is-general-admin
* refactor: update tests of is-admin check
* refactor: move user permissions to a new module
* feat: add check for is_biocommons_admin and a new router for biocommons admin routes
* chore: add biocommons_admin router to main app
* refactor: start moving routes to /biocommons-admin
* refactor: simplify creating groups in the API
* refactor: lookup methods for roles and platforms
* refactor: rework group/role/platform creation endpoints
* test: move biocommons-admin tests to a dedicated module
* test: fix mocks in user tests
* feat: add is_admin check for platform model
* refactor: rework UserQueryParams to add group/platform admin checks, use it in all endpoints
* test: update tests of get_users to include platform-specific users
* test: test group or platform admin access
* feat: more permissions checks that can be applied to endpoints
* refactor: move 'get_or_404' checks into models
* refactor: add permission checks to admin endpoints
* refactor: renamed get_for_admin_roles -> get_from_admin_roles
* refactor: move shared param types to schemas to avoid circular import
* fix: should use _or_404 for getting the group
* fix: need to return platform
* fix: fix checking admin roles for platform
* fix: allow for / in group IDs in URLs
* test: update tests of admin API to reflect permissions
* refactor: exclude biocommons-admin endpoints from docs/API schema
* test: include short_name when creating group
* feat: add simple endpoint for checking if current user has admin rights to a specific platform
* fix: sync platform roles to db, response typing
test: increase test coverate to 100%
* fix: undefiend role name in error message
* docs: docstring fixes
* docs: update DB diagram
* feat: add schemas for user profile data
* feat: add an endpoint for fetching profile data for current user
* fix: need to get user's name from Auth0 data
* test: test getting profile data from DB and Auth0 data
* test: test profile endpoint
* refactor: cache the Auth0 management token - fetching it is slow
* feat: add a dependency that allows looking up Auth0 userinfo endpoint directly
* refactor: update profile endpoint to use userinfo lookup
* test: update tests of profile data
* fix: exclude revoked memberships from user profile data
* test: check that revoked groups/platforms are excluded from profile data
* refactor: set up new cache before replacing the existing one
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix: use AsyncClient to get userinfo
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* test: fix override for get_auth0_user_info
* test: different method to override userinfo lookup
* fix: fix circular import by only importing db models for type checking
---------
Co-authored-by: Marius <marius.mather@gmail.com>
Co-authored-by: Uwe Winter <uwwint@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent 5cc64af commit daf0687
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
| |||
0 commit comments