Skip to content

Commit 199e0de

Browse files
authored
Merge pull request #860 from danielballan/post-document-authn-access-tags
Update post_document endpoint with new get_entry API
2 parents fd9ca39 + be57d3e commit 199e0de

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

databroker/server.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
import json
22
import msgpack
3-
from typing import Optional
3+
from typing import Optional, Set
44
from jsonschema import ValidationError
55

66
from event_model import DocumentNames, schema_validators
77
from fastapi import APIRouter, Depends, HTTPException, Request, Security
88
import pydantic
99
from 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+
)
1117
from tiled.server.dependencies import get_entry, get_root_tree
1218
from 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

Comments
 (0)