fix: finalize semantic repair and test updates
This commit is contained in:
@@ -4,9 +4,10 @@
|
||||
# @SEMANTICS: api, auth, routes, login, logout
|
||||
# @PURPOSE: Authentication API endpoints.
|
||||
# @LAYER: API
|
||||
# @RELATION: USES ->[AuthService:Class]
|
||||
# @RELATION: USES ->[get_auth_db:Function]
|
||||
# @RELATION: DEPENDS_ON ->[AuthRepository:Class]
|
||||
# @RELATION: DEPENDS_ON -> [AuthService]
|
||||
# @RELATION: DEPENDS_ON -> [get_auth_db]
|
||||
# @RELATION: DEPENDS_ON -> [get_current_user]
|
||||
# @RELATION: DEPENDS_ON -> [is_adfs_configured]
|
||||
# @INVARIANT: All auth endpoints must return consistent error codes.
|
||||
|
||||
# [SECTION: IMPORTS]
|
||||
@@ -24,7 +25,7 @@ import starlette.requests
|
||||
# [/SECTION]
|
||||
|
||||
# [DEF:router:Variable]
|
||||
# @RELATION: DEPENDS_ON -> fastapi.APIRouter
|
||||
# @RELATION: DEPENDS_ON -> [fastapi.APIRouter]
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: APIRouter instance for authentication routes.
|
||||
router = APIRouter(prefix="/api/auth", tags=["auth"])
|
||||
@@ -40,8 +41,8 @@ router = APIRouter(prefix="/api/auth", tags=["auth"])
|
||||
# @PARAM: form_data (OAuth2PasswordRequestForm) - Login credentials.
|
||||
# @PARAM: db (Session) - Auth database session.
|
||||
# @RETURN: Token - The generated JWT token.
|
||||
# @RELATION: CALLS -> [authenticate_user]
|
||||
# @RELATION: CALLS -> [create_session]
|
||||
# @RELATION: CALLS -> [AuthService.authenticate_user]
|
||||
# @RELATION: CALLS -> [AuthService.create_session]
|
||||
@router.post("/login", response_model=Token)
|
||||
async def login_for_access_token(
|
||||
form_data: OAuth2PasswordRequestForm = Depends(), db: Session = Depends(get_auth_db)
|
||||
@@ -125,8 +126,9 @@ async def login_adfs(request: starlette.requests.Request):
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Handles the callback from ADFS after successful authentication.
|
||||
# @POST: Provisions user JIT and returns session token.
|
||||
# @RELATION: CALLS -> [provision_adfs_user]
|
||||
# @RELATION: CALLS -> [create_session]
|
||||
# @RELATION: DEPENDS_ON -> [is_adfs_configured]
|
||||
# @RELATION: CALLS -> [AuthService.provision_adfs_user]
|
||||
# @RELATION: CALLS -> [AuthService.create_session]
|
||||
@router.get("/callback/adfs", name="auth_callback_adfs")
|
||||
async def auth_callback_adfs(
|
||||
request: starlette.requests.Request, db: Session = Depends(get_auth_db)
|
||||
|
||||
Reference in New Issue
Block a user