livekit-api 1.0.3__tar.gz → 1.0.4__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.
Files changed (26) hide show
  1. {livekit_api-1.0.3 → livekit_api-1.0.4}/PKG-INFO +1 -1
  2. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit/api/access_token.py +7 -7
  3. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit/api/sip_service.py +5 -3
  4. livekit_api-1.0.4/livekit/api/version.py +1 -0
  5. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit_api.egg-info/PKG-INFO +1 -1
  6. livekit_api-1.0.3/livekit/api/version.py +0 -1
  7. {livekit_api-1.0.3 → livekit_api-1.0.4}/README.md +0 -0
  8. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit/api/__init__.py +0 -0
  9. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit/api/_service.py +0 -0
  10. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit/api/agent_dispatch_service.py +0 -0
  11. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit/api/egress_service.py +0 -0
  12. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit/api/ingress_service.py +0 -0
  13. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit/api/livekit_api.py +0 -0
  14. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit/api/py.typed +0 -0
  15. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit/api/room_service.py +0 -0
  16. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit/api/twirp_client.py +0 -0
  17. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit/api/webhook.py +0 -0
  18. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit_api.egg-info/SOURCES.txt +0 -0
  19. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit_api.egg-info/dependency_links.txt +0 -0
  20. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit_api.egg-info/requires.txt +0 -0
  21. {livekit_api-1.0.3 → livekit_api-1.0.4}/livekit_api.egg-info/top_level.txt +0 -0
  22. {livekit_api-1.0.3 → livekit_api-1.0.4}/pyproject.toml +0 -0
  23. {livekit_api-1.0.3 → livekit_api-1.0.4}/setup.cfg +0 -0
  24. {livekit_api-1.0.3 → livekit_api-1.0.4}/setup.py +0 -0
  25. {livekit_api-1.0.3 → livekit_api-1.0.4}/tests/test_access_token.py +0 -0
  26. {livekit_api-1.0.3 → livekit_api-1.0.4}/tests/test_webhook.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: livekit-api
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: Python Server API for LiveKit
5
5
  Home-page: https://github.com/livekit/python-sdks
6
6
  License: Apache-2.0
@@ -199,22 +199,22 @@ class TokenVerifier:
199
199
  api_key = api_key or os.getenv("LIVEKIT_API_KEY")
200
200
  api_secret = api_secret or os.getenv("LIVEKIT_API_SECRET")
201
201
 
202
- if not api_key or not api_secret:
203
- raise ValueError("api_key and api_secret must be set")
204
-
205
202
  self.api_key = api_key
206
203
  self.api_secret = api_secret
207
204
  self._leeway = leeway
208
205
 
209
- def verify(self, token: str) -> Claims:
206
+ def verify(self, token: str, *, verify_signature: bool = True) -> Claims:
207
+ if verify_signature and (not self.api_key or not self.api_secret):
208
+ raise ValueError("api_key and api_secret must be set")
209
+
210
210
  claims = jwt.decode(
211
211
  token,
212
- self.api_secret,
213
- issuer=self.api_key,
212
+ key=self.api_secret or "",
213
+ issuer=self.api_key or "",
214
214
  algorithms=["HS256"],
215
215
  leeway=self._leeway.total_seconds(),
216
+ options={"verify_signature": verify_signature},
216
217
  )
217
-
218
218
  video_dict = claims.get("video", dict())
219
219
  video_dict = {camel_to_snake(k): v for k, v in video_dict.items()}
220
220
  video_dict = {k: v for k, v in video_dict.items() if k in VideoGrants.__dataclass_fields__}
@@ -330,10 +330,12 @@ class SipService(Service):
330
330
  Only provided fields will be updated.
331
331
  """
332
332
  update = SIPDispatchRuleUpdate(
333
- name=name, metadata=metadata, rule=rule, attributes=attributes
333
+ name=name,
334
+ metadata=metadata,
335
+ rule=rule,
336
+ attributes=attributes,
337
+ trunk_ids=ListUpdate(set=trunk_ids) if trunk_ids else None,
334
338
  )
335
- if trunk_ids is not None:
336
- update.trunk_ids = ListUpdate(set=trunk_ids)
337
339
  return await self._client.request(
338
340
  SVC,
339
341
  "UpdateSIPDispatchRule",
@@ -0,0 +1 @@
1
+ __version__ = "1.0.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: livekit-api
3
- Version: 1.0.3
3
+ Version: 1.0.4
4
4
  Summary: Python Server API for LiveKit
5
5
  Home-page: https://github.com/livekit/python-sdks
6
6
  License: Apache-2.0
@@ -1 +0,0 @@
1
- __version__ = "1.0.3"
File without changes
File without changes
File without changes
File without changes