livekit-api 0.6.0__tar.gz → 0.7.0__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 (25) hide show
  1. {livekit_api-0.6.0 → livekit_api-0.7.0}/PKG-INFO +1 -1
  2. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit/api/access_token.py +6 -1
  3. livekit_api-0.7.0/livekit/api/version.py +1 -0
  4. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit_api.egg-info/PKG-INFO +1 -1
  5. {livekit_api-0.6.0 → livekit_api-0.7.0}/tests/test_access_token.py +3 -0
  6. livekit_api-0.6.0/livekit/api/version.py +0 -1
  7. {livekit_api-0.6.0 → livekit_api-0.7.0}/README.md +0 -0
  8. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit/api/__init__.py +0 -0
  9. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit/api/_service.py +0 -0
  10. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit/api/egress_service.py +0 -0
  11. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit/api/ingress_service.py +0 -0
  12. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit/api/livekit_api.py +0 -0
  13. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit/api/py.typed +0 -0
  14. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit/api/room_service.py +0 -0
  15. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit/api/sip_service.py +0 -0
  16. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit/api/twirp_client.py +0 -0
  17. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit/api/webhook.py +0 -0
  18. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit_api.egg-info/SOURCES.txt +0 -0
  19. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit_api.egg-info/dependency_links.txt +0 -0
  20. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit_api.egg-info/requires.txt +0 -0
  21. {livekit_api-0.6.0 → livekit_api-0.7.0}/livekit_api.egg-info/top_level.txt +0 -0
  22. {livekit_api-0.6.0 → livekit_api-0.7.0}/pyproject.toml +0 -0
  23. {livekit_api-0.6.0 → livekit_api-0.7.0}/setup.cfg +0 -0
  24. {livekit_api-0.6.0 → livekit_api-0.7.0}/setup.py +0 -0
  25. {livekit_api-0.6.0 → livekit_api-0.7.0}/tests/test_webhook.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: livekit-api
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: Python Server API for LiveKit
5
5
  Home-page: https://github.com/livekit/python-sdks
6
6
  License: Apache-2.0
@@ -77,6 +77,7 @@ class Claims:
77
77
  name: str = ""
78
78
  video: VideoGrants = dataclasses.field(default_factory=VideoGrants)
79
79
  sip: SIPGrants = dataclasses.field(default_factory=SIPGrants)
80
+ attributes: dict[str, str] = dataclasses.field(default_factory=dict)
80
81
  metadata: str = ""
81
82
  sha256: str = ""
82
83
 
@@ -125,6 +126,10 @@ class AccessToken:
125
126
  self.claims.metadata = metadata
126
127
  return self
127
128
 
129
+ def with_attributes(self, attributes: dict[str, str]) -> "AccessToken":
130
+ self.claims.attributes = attributes
131
+ return self
132
+
128
133
  def with_sha256(self, sha256: str) -> "AccessToken":
129
134
  self.claims.sha256 = sha256
130
135
  return self
@@ -148,7 +153,6 @@ class AccessToken:
148
153
  ),
149
154
  }
150
155
  )
151
-
152
156
  return jwt.encode(claims, self.api_secret, algorithm="HS256")
153
157
 
154
158
 
@@ -198,6 +202,7 @@ class TokenVerifier:
198
202
  name=claims.get("name", ""),
199
203
  video=video,
200
204
  sip=sip,
205
+ attributes=claims.get("attributes", {}),
201
206
  metadata=claims.get("metadata", ""),
202
207
  sha256=claims.get("sha256", ""),
203
208
  )
@@ -0,0 +1 @@
1
+ __version__ = "0.7.0"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: livekit-api
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Summary: Python Server API for LiveKit
5
5
  Home-page: https://github.com/livekit/python-sdks
6
6
  License: Apache-2.0
@@ -17,6 +17,7 @@ def test_verify_token():
17
17
  .with_metadata("test_metadata")
18
18
  .with_grants(grants)
19
19
  .with_sip_grants(sip)
20
+ .with_attributes({"key1": "value1", "key2": "value2"})
20
21
  .to_jwt()
21
22
  )
22
23
 
@@ -27,6 +28,8 @@ def test_verify_token():
27
28
  assert claims.metadata == "test_metadata"
28
29
  assert claims.video == grants
29
30
  assert claims.sip == sip
31
+ assert claims.attributes["key1"] == "value1"
32
+ assert claims.attributes["key2"] == "value2"
30
33
 
31
34
 
32
35
  def test_verify_token_invalid():
@@ -1 +0,0 @@
1
- __version__ = "0.6.0"
File without changes
File without changes
File without changes
File without changes