11import json
22import msgpack
3- from typing import Optional
3+ from typing import Optional , Set
44from jsonschema import ValidationError
55
66from event_model import DocumentNames , schema_validators
77from fastapi import APIRouter , Depends , HTTPException , Request , Security
88import pydantic
99from starlette .responses import StreamingResponse
10- from tiled .server .authentication import check_scopes , get_current_principal , get_current_scopes , get_session_state
10+ from tiled .server .authentication import (
11+ check_scopes ,
12+ get_current_access_tags ,
13+ get_current_principal ,
14+ get_current_scopes ,
15+ get_session_state
16+ )
1117from tiled .server .dependencies import get_entry , get_root_tree
1218from tiled .type_aliases import Scopes
1319
@@ -28,6 +34,7 @@ async def get_documents(
2834 principal = Depends (get_current_principal ),
2935 root_tree = Depends (get_root_tree ),
3036 session_state : dict = Depends (get_session_state ),
37+ authn_access_tags : Optional [Set [str ]] = Depends (get_current_access_tags ),
3138 authn_scopes : Scopes = Depends (get_current_scopes ),
3239 fill : Optional [bool ] = False ,
3340 _ = Security (check_scopes , scopes = ["read:data" , "read:metadata" ])
@@ -39,6 +46,7 @@ async def get_documents(
3946 path ,
4047 ["read:data" , "read:metadata" ],
4148 principal ,
49+ authn_access_tags ,
4250 authn_scopes ,
4351 root_tree ,
4452 session_state ,
@@ -88,6 +96,7 @@ async def post_documents(
8896 principal = Depends (get_current_principal ),
8997 root_tree = Depends (get_root_tree ),
9098 session_state : dict = Depends (get_session_state ),
99+ authn_access_tags : Optional [Set [str ]] = Depends (get_current_access_tags ),
91100 authn_scopes : Scopes = Depends (get_current_scopes ),
92101 fill : Optional [bool ] = False ,
93102 _ = Security (check_scopes , scopes = ["write:data" , "write:metadata" ])
@@ -98,6 +107,7 @@ async def post_documents(
98107 path ,
99108 ["write:data" , "write:metadata" ],
100109 principal ,
110+ authn_access_tags ,
101111 authn_scopes ,
102112 root_tree ,
103113 session_state ,
0 commit comments