Imporve gateway auth for all services
This commit is contained in:
@@ -4,7 +4,7 @@ User management API routes
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from typing import List
|
||||
from typing import Dict, Any
|
||||
import structlog
|
||||
|
||||
from app.core.database import get_db
|
||||
@@ -14,12 +14,19 @@ from app.services.user_service import UserService
|
||||
from app.core.auth import get_current_user
|
||||
from app.models.users import User
|
||||
|
||||
# Import unified authentication from shared library
|
||||
from shared.auth.decorators import (
|
||||
get_current_user_dep,
|
||||
get_current_tenant_id_dep,
|
||||
require_role # For admin-only endpoints
|
||||
)
|
||||
|
||||
logger = structlog.get_logger()
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/me", response_model=UserResponse)
|
||||
async def get_current_user_info(
|
||||
current_user: User = Depends(get_current_user),
|
||||
current_user: Dict[str, Any] = Depends(get_current_user_dep),
|
||||
db: AsyncSession = Depends(get_db)
|
||||
):
|
||||
"""Get current user information"""
|
||||
|
||||
Reference in New Issue
Block a user