from ..auth.casbin_db_adapter import get_casbin_enforcer as get_casbin_enforcer
from ..entity.auth_user import AuthUser as AuthUser
from ..exception.service_exception import PermissionException as PermissionException, ServiceErrorException as ServiceErrorException
from ..logger.logging_ import logging as logging
from ..services.auth_service import AuthService as AuthService
from ..services.db_engine_service import DBEngineService as DBEngineService
from .auth_data_rule import AuthDataRule as AuthDataRule, get_data_rule_from_request as get_data_rule_from_request
from _typeshed import Incomplete
from casbin import Enforcer as Enforcer
from fastapi import APIRouter, Request as Request
from sqlmodel.ext.asyncio.session import AsyncSession

async def get_enforcer(): ...

class AuthRouter(APIRouter):
    data_role: Incomplete
    data_obj: Incomplete
    data_rules: list[AuthDataRule]
    data_act: Incomplete
    db_config: Incomplete
    def __init__(self, data_role: str | None = None, data_obj: str | None = None, db_config_name: str | None = None, *args, **kwargs) -> None: ...
    async def get_async_session(self) -> AsyncSession: ...
    async def user_role_checker(self, e: Enforcer = ..., current_user: AuthUser = ...): ...
    async def user_permission_checker(self, request: Request, e: Enforcer = ..., current_user: AuthUser = ...): ...
    def api_route(self, path: str, *, auth: bool = True, role: str | None = None, data_obj: str | None = None, data_act: str | None = None, **kwargs): ...
    def add_auth_data_rule(self, path: str, **kwargs): ...
    def get(self, path: str, *, auth: bool = True, role: str | None = None, data_obj: str | None = None, data_act: str | None = None, **kwargs): ...
    def post(self, path: str, *, auth: bool = True, role: str | None = None, data_obj: str | None = None, data_act: str | None = None, **kwargs): ...
    def put(self, path: str, *, auth: bool = True, role: str | None = None, data_obj: str | None = None, data_act: str | None = None, **kwargs): ...
    def patch(self, path: str, *, auth: bool = True, role: str | None = None, data_obj: str | None = None, data_act: str | None = None, **kwargs): ...
    def delete(self, path: str, *, auth: bool = True, role: str | None = None, data_obj: str | None = None, data_act: str | None = None, **kwargs): ...
