livekit-api 1.2.2__tar.gz → 1.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: livekit-api
3
- Version: 1.2.2
3
+ Version: 1.2.3
4
4
  Summary: Python Server API for LiveKit
5
5
  Project-URL: Documentation, https://docs.livekit.io
6
6
  Project-URL: Website, https://livekit.io/
@@ -22,9 +22,9 @@ Classifier: Topic :: Multimedia :: Video
22
22
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
23
  Requires-Python: >=3.9.0
24
24
  Requires-Dist: aiohttp>=3.13.5; python_version < '3.10'
25
- Requires-Dist: aiohttp>=3.14.4; python_version >= '3.10'
25
+ Requires-Dist: aiohttp>=3.14.3; python_version >= '3.10'
26
26
  Requires-Dist: idna>=3.15
27
- Requires-Dist: livekit-protocol<2.0.0,>=1.1.27
27
+ Requires-Dist: livekit-protocol<2.0.0,>=1.1.32
28
28
  Requires-Dist: multidict>=6.9.1; python_version >= '3.10'
29
29
  Requires-Dist: protobuf>=4
30
30
  Requires-Dist: pyjwt>=2.15.1
@@ -50,6 +50,7 @@ from .access_token import (
50
50
  AgentGrants,
51
51
  AgentEndpointGrants,
52
52
  AgentThreadGrants,
53
+ AgentDatabaseGrants,
53
54
  VideoGrants,
54
55
  SIPGrants,
55
56
  AccessToken,
@@ -71,6 +72,7 @@ __all__ = [
71
72
  "AgentGrants",
72
73
  "AgentEndpointGrants",
73
74
  "AgentThreadGrants",
75
+ "AgentDatabaseGrants",
74
76
  "VideoGrants",
75
77
  "SIPGrants",
76
78
  "AccessToken",
@@ -101,8 +101,6 @@ class AgentGrants:
101
101
  admin: bool = False
102
102
  # manage simulations and scenarios for evaluating agents
103
103
  simulation_admin: bool = False
104
- # access the project's agent databases
105
- database_admin: bool = False
106
104
  # manage the project's agent dispatch queue
107
105
  dispatch_admin: bool = False
108
106
 
@@ -130,6 +128,21 @@ class AgentThreadGrants:
130
128
  write: bool = False
131
129
  read: bool = False
132
130
  delete: bool = False
131
+ # open a covered thread's database, whose id is the thread's
132
+ sql: bool = False
133
+
134
+
135
+ @dataclass
136
+ class AgentDatabaseGrants:
137
+ # databases that may be read, written and deleted
138
+ database_ids: Optional[List[str]] = None
139
+ read: bool = False
140
+ write: bool = False
141
+ delete: bool = False
142
+ # create databases in the project
143
+ create: bool = False
144
+ # list the project's databases
145
+ list: bool = False
133
146
 
134
147
 
135
148
  @dataclass
@@ -145,6 +158,7 @@ class Claims:
145
158
  agent: Optional[AgentGrants] = None
146
159
  agent_endpoint: Optional[AgentEndpointGrants] = None
147
160
  agent_thread: Optional[AgentThreadGrants] = None
161
+ agent_database: Optional[AgentDatabaseGrants] = None
148
162
  attributes: Optional[dict[str, str]] = None
149
163
  sha256: Optional[str] = None
150
164
  room_preset: Optional[str] = None
@@ -217,6 +231,10 @@ class AccessToken:
217
231
  self.claims.agent_thread = grants
218
232
  return self
219
233
 
234
+ def with_agent_database_grants(self, grants: AgentDatabaseGrants) -> "AccessToken":
235
+ self.claims.agent_database = grants
236
+ return self
237
+
220
238
  def with_identity(self, identity: str) -> "AccessToken":
221
239
  self.identity = identity
222
240
  return self
@@ -308,46 +326,21 @@ class TokenVerifier:
308
326
  leeway=self._leeway.total_seconds(),
309
327
  options={"verify_signature": False},
310
328
  )
311
- video_dict = claims.get("video", dict())
312
- video_dict = {camel_to_snake(k): v for k, v in video_dict.items()}
313
- video_dict = {k: v for k, v in video_dict.items() if k in VideoGrants.__dataclass_fields__}
314
- video = VideoGrants(**video_dict)
315
-
316
- sip_dict = claims.get("sip", dict())
317
- sip_dict = {camel_to_snake(k): v for k, v in sip_dict.items()}
318
- sip_dict = {k: v for k, v in sip_dict.items() if k in SIPGrants.__dataclass_fields__}
319
- sip = SIPGrants(**sip_dict)
320
-
321
- inference_dict = claims.get("inference", dict())
322
- inference_dict = {camel_to_snake(k): v for k, v in inference_dict.items()}
323
- inference_dict = {
324
- k: v for k, v in inference_dict.items() if k in InferenceGrants.__dataclass_fields__
325
- }
326
- inference = InferenceGrants(**inference_dict)
327
-
328
- observability_dict = claims.get("observability", dict())
329
- observability_dict = {camel_to_snake(k): v for k, v in observability_dict.items()}
330
- observability_dict = {
331
- k: v
332
- for k, v in observability_dict.items()
333
- if k in ObservabilityGrants.__dataclass_fields__
334
- }
335
- observability = ObservabilityGrants(**observability_dict)
336
-
337
329
  grant_claims = Claims(
338
330
  identity=claims.get("sub", ""),
339
331
  name=claims.get("name", ""),
340
332
  kind=claims.get("kind", ""),
341
- video=video,
342
- sip=sip,
343
- inference=inference,
344
- observability=observability,
333
+ video=_parse_grants(claims, "video", VideoGrants),
334
+ sip=_parse_grants(claims, "sip", SIPGrants),
335
+ inference=_parse_grants(claims, "inference", InferenceGrants),
336
+ observability=_parse_grants(claims, "observability", ObservabilityGrants),
345
337
  attributes=claims.get("attributes", {}),
346
338
  metadata=claims.get("metadata", ""),
347
339
  sha256=claims.get("sha256", ""),
348
340
  agent=_parse_grants(claims, "agent", AgentGrants),
349
341
  agent_endpoint=_parse_grants(claims, "agentEndpoint", AgentEndpointGrants),
350
342
  agent_thread=_parse_grants(claims, "agentThread", AgentThreadGrants),
343
+ agent_database=_parse_grants(claims, "agentDatabase", AgentDatabaseGrants),
351
344
  )
352
345
 
353
346
  if claims.get("roomPreset"):
@@ -0,0 +1 @@
1
+ __version__ = "1.2.3"
@@ -31,13 +31,13 @@ dependencies = [
31
31
  "pyjwt>=2.15.1",
32
32
  # aiohttp 3.14 dropped Python 3.9; keep its final compatible release there.
33
33
  "aiohttp>=3.13.5; python_version < '3.10'",
34
- "aiohttp>=3.14.4; python_version >= '3.10'",
34
+ "aiohttp>=3.14.3; python_version >= '3.10'",
35
35
  # Security floors for aiohttp's transitive dependencies.
36
36
  "idna>=3.15",
37
37
  "multidict>=6.9.1; python_version >= '3.10'",
38
38
  "protobuf>=4",
39
39
  "types-protobuf>=4",
40
- "livekit-protocol>=1.1.27,<2.0.0",
40
+ "livekit-protocol>=1.1.32,<2.0.0",
41
41
  ]
42
42
 
43
43
  [project.urls]
@@ -1 +0,0 @@
1
- __version__ = "1.2.2"
File without changes
File without changes