|
12 | 12 | from uuid import UUID, uuid4 |
13 | 13 | from tempfile import NamedTemporaryFile |
14 | 14 |
|
15 | | -from typing import Optional, TYPE_CHECKING, Dict, Callable, List, AsyncGenerator, Any |
| 15 | +from typing import ( |
| 16 | + Awaitable, |
| 17 | + Optional, |
| 18 | + TYPE_CHECKING, |
| 19 | + Dict, |
| 20 | + Callable, |
| 21 | + List, |
| 22 | + AsyncGenerator, |
| 23 | + Any, |
| 24 | +) |
16 | 25 |
|
| 26 | +from motor.motor_asyncio import AsyncIOMotorDatabase |
17 | 27 | from pydantic import ValidationError |
18 | 28 | from pymongo import ReturnDocument |
19 | 29 | from pymongo.collation import Collation |
@@ -1498,13 +1508,13 @@ async def inc_org_bytes_stored_field(self, oid: UUID, field: str, size: int): |
1498 | 1508 | # ============================================================================ |
1499 | 1509 | # pylint: disable=too-many-statements, too-many-arguments |
1500 | 1510 | def init_orgs_api( |
1501 | | - app, |
1502 | | - mdb, |
| 1511 | + app: APIRouter, |
| 1512 | + mdb: AsyncIOMotorDatabase[Any], |
1503 | 1513 | user_manager: UserManager, |
1504 | 1514 | crawl_manager: CrawlManager, |
1505 | 1515 | invites: InviteOps, |
1506 | | - user_dep: Callable, |
1507 | | - user_or_shared_secret_dep: Callable, |
| 1516 | + user_dep: Callable[[str], Awaitable[User]], |
| 1517 | + user_or_shared_secret_dep: Callable[[str], Awaitable[User]], |
1508 | 1518 | ): |
1509 | 1519 | """Init organizations api router for /orgs""" |
1510 | 1520 | # pylint: disable=too-many-locals,invalid-name |
@@ -1568,7 +1578,7 @@ async def org_public(oid: UUID): |
1568 | 1578 |
|
1569 | 1579 | router = APIRouter( |
1570 | 1580 | prefix="/orgs/{oid}", |
1571 | | - dependencies=[Depends(org_dep)], |
| 1581 | + dependencies=[Depends(org_or_shared_secret_dep)], |
1572 | 1582 | responses={404: {"description": "Not found"}}, |
1573 | 1583 | ) |
1574 | 1584 |
|
|
0 commit comments