feat: auth bypass for dev and testing

ENVIRONMENT must be "local" and DISABLE_AUTH set for this to be active. Both of these default to production values to prevent this being enabled accidentally.

Resolves #5
This commit is contained in:
Chris Milne 2026-05-26 11:42:49 +01:00
parent 652dfb7b4a
commit fa8439cc6c
3 changed files with 11 additions and 2 deletions

View file

@ -28,6 +28,9 @@ from src.organisation.dependencies import org_model_dependency
oidc = OpenIdConnect(openIdConnectUrl=auth_settings.OIDC_CONFIG)
oidc_dependency = Annotated[str, Depends(oidc)]
def get_dev_user():
return {"db_id": 1}
async def get_current_user(oidc_auth_string: oidc_dependency) -> dict[str, Any]:
config_url = urlopen(auth_settings.OIDC_CONFIG)