Skip to content

Commit

Permalink
Use AuthContext with Annotated
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito committed Jan 10, 2024
1 parent efc65f7 commit a6414cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ars/adapters/inbound/fastapi_/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"""Module containing the main FastAPI router and all route functions."""

import logging
from typing import Optional
from typing import Annotated, Optional

from fastapi import APIRouter, Response
from fastapi.exceptions import HTTPException
Expand Down Expand Up @@ -72,7 +72,7 @@ async def health():
async def create_access_request(
creation_data: AccessRequestCreationData,
repository: dummies.AccessRequestRepoDummy,
auth_context: AuthContext = require_user_context,
auth_context: Annotated[AuthContext, require_user_context],
) -> str:
"""Create an access request"""
try:
Expand Down Expand Up @@ -109,10 +109,10 @@ async def create_access_request(
)
async def get_access_requests(
repository: dummies.AccessRequestRepoDummy,
auth_context: Annotated[AuthContext, require_user_context],
dataset_id: Optional[str] = None,
user_id: Optional[str] = None,
status: Optional[AccessRequestStatus] = None,
auth_context: AuthContext = require_user_context,
) -> list[AccessRequest]:
"""Get access requests"""
try:
Expand Down Expand Up @@ -150,7 +150,7 @@ async def patch_access_request(
access_request_id: str,
patch_data: AccessRequestPatchData,
repository: dummies.AccessRequestRepoDummy,
auth_context: AuthContext = require_steward_context,
auth_context: Annotated[AuthContext, require_steward_context],
) -> Response:
"""Set the status of an access request"""
status = patch_data.status
Expand Down

0 comments on commit a6414cb

Please sign in to comment.