Skip to content
Merged
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
15477f3
refactor: rename user_is_admin -> user_is_general_admin to make purpo…
marius-mather Oct 8, 2025
1099540
refactor: rename SessionUser.is_admin SessionUser.is_biocommons_admin
marius-mather Oct 8, 2025
d517f73
feat: add group/platform admin checks for the user
marius-mather Oct 9, 2025
f0c02bf
refactor: rename get_current_user -> get_session_user for clarity
marius-mather Oct 9, 2025
ff75d43
refactor: add DB checks to user_is_general_admin check
marius-mather Oct 9, 2025
6d5b1bf
test: update tests to allow for updated admin check
marius-mather Oct 9, 2025
6bbdb7a
test: add tests of user_is_general_admin check
marius-mather Oct 9, 2025
1aab11c
test: add tests of DB admin checks
marius-mather Oct 9, 2025
ed90978
refactor: update is-admin endpoint to is-general-admin
marius-mather Oct 9, 2025
2c0dba4
refactor: update tests of is-admin check
marius-mather Oct 9, 2025
7fb258b
refactor: move user permissions to a new module
marius-mather Oct 9, 2025
f577d7d
feat: add check for is_biocommons_admin and a new router for biocommo…
marius-mather Oct 10, 2025
aaa1a22
chore: add biocommons_admin router to main app
marius-mather Oct 10, 2025
3ea3f68
refactor: start moving routes to /biocommons-admin
marius-mather Oct 10, 2025
e3f868f
refactor: simplify creating groups in the API
marius-mather Oct 10, 2025
5d3ad88
refactor: lookup methods for roles and platforms
marius-mather Oct 10, 2025
cbce2f9
refactor: rework group/role/platform creation endpoints
marius-mather Oct 10, 2025
054e08f
test: move biocommons-admin tests to a dedicated module
marius-mather Oct 10, 2025
ca90616
test: fix mocks in user tests
marius-mather Oct 10, 2025
2c4f193
Merge remote-tracking branch 'origin/main' into feature/role-permissions
marius-mather Oct 10, 2025
6838b2f
feat: add is_admin check for platform model
marius-mather Oct 13, 2025
71a6946
refactor: rework UserQueryParams to add group/platform admin checks, …
marius-mather Oct 13, 2025
d721326
test: update tests of get_users to include platform-specific users
marius-mather Oct 13, 2025
fdf7252
test: test group or platform admin access
marius-mather Oct 13, 2025
613badf
feat: more permissions checks that can be applied to endpoints
marius-mather Oct 14, 2025
5252ffb
refactor: move 'get_or_404' checks into models
marius-mather Oct 14, 2025
6cc4e13
refactor: add permission checks to admin endpoints
marius-mather Oct 14, 2025
304ce96
refactor: renamed get_for_admin_roles -> get_from_admin_roles
marius-mather Oct 14, 2025
b6fd0ad
refactor: move shared param types to schemas to avoid circular import
marius-mather Oct 14, 2025
16dcb81
fix: should use _or_404 for getting the group
marius-mather Oct 14, 2025
89661a9
fix: need to return platform
marius-mather Oct 14, 2025
3f68368
fix: fix checking admin roles for platform
marius-mather Oct 14, 2025
af00ffd
fix: allow for / in group IDs in URLs
marius-mather Oct 14, 2025
55de3bc
test: update tests of admin API to reflect permissions
marius-mather Oct 14, 2025
977c68b
refactor: exclude biocommons-admin endpoints from docs/API schema
marius-mather Oct 14, 2025
fb0793f
Merge remote-tracking branch 'origin/main' into feature/role-permissions
marius-mather Oct 14, 2025
753e5a7
test: include short_name when creating group
marius-mather Oct 14, 2025
bb10103
feat: add simple endpoint for checking if current user has admin righ…
onesandzeroes Oct 16, 2025
5fd68f7
Merge branch 'main' into feature/role-permissions
uwwint Oct 16, 2025
bbda631
fix: sync platform roles to db, response typing
uwwint Oct 16, 2025
a75510c
fix: undefiend role name in error message
marius-mather Oct 16, 2025
c63a41c
docs: docstring fixes
marius-mather Oct 16, 2025
541a27d
Merge branch 'feature/role-permissions' of github.com:AustralianBioCo…
marius-mather Oct 16, 2025
3ce3997
docs: update DB diagram
marius-mather Oct 16, 2025
29c27c7
Merge remote-tracking branch 'origin/main' into feature/role-permissions
marius-mather Oct 26, 2025
ba4ab49
feat: add schemas for user profile data
marius-mather Oct 27, 2025
14f885b
feat: add an endpoint for fetching profile data for current user
marius-mather Oct 27, 2025
00f0ab4
fix: need to get user's name from Auth0 data
marius-mather Oct 27, 2025
16aa1aa
test: test getting profile data from DB and Auth0 data
marius-mather Oct 27, 2025
848e5b8
test: test profile endpoint
marius-mather Oct 27, 2025
cb5f863
refactor: cache the Auth0 management token - fetching it is slow
marius-mather Oct 28, 2025
4fdeb3f
feat: add a dependency that allows looking up Auth0 userinfo endpoint…
marius-mather Oct 28, 2025
e2e65ee
refactor: update profile endpoint to use userinfo lookup
marius-mather Oct 28, 2025
1e07c53
test: update tests of profile data
marius-mather Oct 28, 2025
14f5c47
fix: exclude revoked memberships from user profile data
marius-mather Oct 28, 2025
f78116b
test: check that revoked groups/platforms are excluded from profile data
marius-mather Oct 28, 2025
7ba8d56
Merge remote-tracking branch 'origin/main' into feature/user-profile-api
marius-mather Oct 28, 2025
261fd48
refactor: set up new cache before replacing the existing one
marius-mather Oct 28, 2025
1e76963
fix: use AsyncClient to get userinfo
marius-mather Oct 28, 2025
5e5d43d
test: fix override for get_auth0_user_info
marius-mather Oct 28, 2025
dcb791a
test: different method to override userinfo lookup
marius-mather Oct 28, 2025
cb7f2b2
fix: fix circular import by only importing db models for type checking
marius-mather Oct 28, 2025
1aa73df
Merge remote-tracking branch 'origin/main' into feature/user-profile-api
marius-mather Oct 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions schemas/biocommons.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
These are the core schemas we use for storing/representing users
and their metadata
"""
from __future__ import annotations

import re
from datetime import datetime
from typing import Annotated, List, Literal, Optional, Self
from typing import TYPE_CHECKING, Annotated, List, Literal, Optional, Self

from fastapi import Path
from pydantic import (
Expand All @@ -22,9 +23,11 @@
import db
import schemas
from auth0.user_info import UserInfo
from db import models
from db.types import ApprovalStatusEnum, GroupMembershipData, PlatformMembershipData

if TYPE_CHECKING:
from db import models

# From Auth0 password settings
ALLOWED_SPECIAL_CHARS = "!@#$%^&*"
VALID_PASSWORD_REGEX = re.compile(
Expand Down