File tree Expand file tree Collapse file tree 5 files changed +1233
-5
lines changed
src/ai/backend/manager/api Expand file tree Collapse file tree 5 files changed +1233
-5
lines changed Original file line number Diff line number Diff line change 1+ On perpose of soft merging for manager's auth apis, defining DTO's and actions, moving auth into seperated directory.
Original file line number Diff line number Diff line change 1+ """
2+ Auth API package.
3+
4+ Re-exports from auth.auth (legacy function-based handlers) for backward compatibility.
5+ """
6+
7+ from .auth import ( # noqa: F401
8+ _extract_auth_params ,
9+ admin_required ,
10+ admin_required_for_method ,
11+ auth_middleware ,
12+ auth_required ,
13+ auth_required_for_method ,
14+ authorize ,
15+ check_date ,
16+ create_app ,
17+ generate_ssh_keypair ,
18+ get_role ,
19+ get_ssh_keypair ,
20+ sign_request ,
21+ signout ,
22+ signup ,
23+ superadmin_required ,
24+ superadmin_required_for_method ,
25+ test ,
26+ update_full_name ,
27+ update_password ,
28+ update_password_no_auth ,
29+ upload_ssh_keypair ,
30+ validate_ip ,
31+ whois_timezone_info ,
32+ )
Original file line number Diff line number Diff line change 1+ """
2+ Legacy auth handlers (function-based).
3+
4+ DEPRECATED: This module is preserved for regression testing only.
5+ Use ai.backend.manager.api.auth (class-based handlers) for production.
6+ """
7+
18from __future__ import annotations
29
310import functools
2330from ai .backend .common import validators as tx
2431from ai .backend .common .contexts .user import with_user
2532from ai .backend .common .data .user .types import UserData , UserRole
26- from ai .backend .common .dto .manager .auth .field import (
33+ from ai .backend .common .dto .manager .auth .types import (
2734 AuthResponseType ,
2835 AuthSuccessResponse ,
2936 AuthTokenType ,
3441from ai .backend .common .types import ReadableCIDR
3542from ai .backend .logging import BraceStyleAdapter
3643from ai .backend .logging .utils import with_log_context_fields
44+ from ai .backend .manager .api .types import CORSOptions , WebMiddleware
45+ from ai .backend .manager .api .utils import check_api_params , get_handler_attr , set_handler_attr
3746from ai .backend .manager .errors .auth import (
3847 AuthorizationFailed ,
3948 InvalidAuthParameters ,
6069)
6170from ai .backend .manager .services .auth .actions .upload_ssh_keypair import UploadSSHKeypairAction
6271
63- from .types import CORSOptions , WebMiddleware
64- from .utils import check_api_params , get_handler_attr , set_handler_attr
65-
6672if TYPE_CHECKING :
67- from .context import RootContext
73+ from ai . backend . manager . api .context import RootContext
6874
6975log : Final = BraceStyleAdapter (logging .getLogger (__spec__ .name )) # type: ignore[name-defined]
7076
Original file line number Diff line number Diff line change 1+ """
2+ Legacy API handlers.
3+
4+ This module contains old function-based handlers preserved for regression testing.
5+ These handlers should NOT be used in production - use the new class-based handlers instead.
6+
7+ Contents:
8+ - auth: Legacy auth handlers (replaced by api/auth/ package)
9+ """
10+
11+ from __future__ import annotations
12+
13+ from . import auth
14+
15+ __all__ = ("auth" ,)
You can’t perform that action at this time.
0 commit comments