|
1 |
| -from typing import Optional, Tuple, Union |
| 1 | +from typing import Any, Callable, Mapping, Optional, Tuple, Union |
2 | 2 |
|
3 | 3 | from fastapi import Depends, HTTPException, Query, Request, Security
|
4 | 4 | from starlette.status import HTTP_403_FORBIDDEN, HTTP_404_NOT_FOUND
|
|
13 | 13 | SLICE_REGEX = rf"^{DIM_REGEX}(?:,{DIM_REGEX})*$"
|
14 | 14 |
|
15 | 15 |
|
16 |
| -def SecureEntryBuilder(get_current_principal, tree, get_session_state): |
| 16 | +def SecureEntryBuilder( |
| 17 | + tree: Mapping[str, Any], |
| 18 | + get_current_principal: Callable[..., Optional[str]], |
| 19 | + get_session_state: Callable[..., Optional[dict[str, Any]]], |
| 20 | +): |
17 | 21 | def SecureEntry(scopes, structure_families=None):
|
18 | 22 | async def inner(
|
19 | 23 | path: str,
|
20 | 24 | request: Request,
|
21 |
| - principal: str = Depends(get_current_principal), |
22 |
| - session_state: dict = Depends(get_session_state), |
| 25 | + principal: Optional[str] = Depends(get_current_principal), |
| 26 | + session_state: Optional[dict[str, Any]] = Depends(get_session_state), |
23 | 27 | ):
|
24 | 28 | """
|
25 | 29 | Obtain a node in the tree from its path.
|
|
0 commit comments