latch-asgi 1.0.6.dev2__tar.gz → 1.1.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.
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/PKG-INFO +2 -2
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/context/websocket.py +2 -35
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/framework/common.py +0 -1
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/pyproject.toml +2 -2
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/COPYING +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/README.md +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/__init__.py +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/asgi_iface.py +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/auth.py +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/config.py +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/context/__init__.py +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/context/common.py +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/context/http.py +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/datadog_propagator.py +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/framework/__init__.py +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/framework/http.py +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/framework/websocket.py +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/py.typed +0 -0
- {latch_asgi-1.0.6.dev2 → latch_asgi-1.1.0}/latch_asgi/server.py +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: latch-asgi
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: ASGI python server
|
|
5
5
|
Author-Email: Max Smolin <max@latch.bio>
|
|
6
6
|
License: CC0-1.0
|
|
7
7
|
Requires-Python: <4.0,>=3.11
|
|
8
8
|
Requires-Dist: hypercorn[uvloop]<1.0.0,>=0.14.3
|
|
9
9
|
Requires-Dist: latch-data-validation<1.0.0,>=0.1.3
|
|
10
|
-
Requires-Dist: latch-o11y<
|
|
10
|
+
Requires-Dist: latch-o11y<2.0.0,>=1.2.0
|
|
11
11
|
Requires-Dist: latch-config<1.0.0,>=0.1.6
|
|
12
12
|
Requires-Dist: PyJWT[crypto]<3.0.0,>=2.6.0
|
|
13
13
|
Requires-Dist: orjson<4.0.0,>=3.8.5
|
|
@@ -27,42 +27,9 @@ class Context(
|
|
|
27
27
|
|
|
28
28
|
@trace_app_function
|
|
29
29
|
async def accept_connection(
|
|
30
|
-
self: Self,
|
|
31
|
-
*,
|
|
32
|
-
subprotocol: str | None = None,
|
|
33
|
-
headers: Headers | None = None,
|
|
34
|
-
negotiate_permessage_deflate: bool = False,
|
|
30
|
+
self: Self, *, subprotocol: str | None = None, headers: Headers | None = None
|
|
35
31
|
) -> None:
|
|
36
|
-
|
|
37
|
-
await accept_connection(self.send, subprotocol=subprotocol, headers=headers)
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
offer = self.header_str("sec-websocket-extensions")
|
|
41
|
-
|
|
42
|
-
headers_out: Headers = {}
|
|
43
|
-
if headers is not None:
|
|
44
|
-
headers_out = dict(headers)
|
|
45
|
-
|
|
46
|
-
def _has_extensions_header(h: Headers) -> bool:
|
|
47
|
-
for k in h.keys():
|
|
48
|
-
if isinstance(k, bytes):
|
|
49
|
-
if k.decode("latin-1").lower() == "sec-websocket-extensions":
|
|
50
|
-
return True
|
|
51
|
-
else:
|
|
52
|
-
if k.lower() == "sec-websocket-extensions":
|
|
53
|
-
return True
|
|
54
|
-
return False
|
|
55
|
-
|
|
56
|
-
if (
|
|
57
|
-
offer is not None
|
|
58
|
-
and "permessage-deflate" in offer.replace(" ", "").lower()
|
|
59
|
-
and not _has_extensions_header(headers_out)
|
|
60
|
-
):
|
|
61
|
-
headers_out["Sec-WebSocket-Extensions"] = "permessage-deflate"
|
|
62
|
-
|
|
63
|
-
await accept_connection(
|
|
64
|
-
self.send, subprotocol=subprotocol, headers=headers_out or headers
|
|
65
|
-
)
|
|
32
|
+
await accept_connection(self.send, subprotocol=subprotocol, headers=headers)
|
|
66
33
|
|
|
67
34
|
@trace_app_function
|
|
68
35
|
async def receive_message(self: Self, cls: type[T]) -> T:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "latch-asgi"
|
|
3
|
-
version = "1.0
|
|
3
|
+
version = "1.1.0"
|
|
4
4
|
description = "ASGI python server"
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Max Smolin", email = "max@latch.bio" },
|
|
@@ -8,7 +8,7 @@ authors = [
|
|
|
8
8
|
dependencies = [
|
|
9
9
|
"hypercorn[uvloop]<1.0.0,>=0.14.3",
|
|
10
10
|
"latch-data-validation<1.0.0,>=0.1.3",
|
|
11
|
-
"latch-o11y<
|
|
11
|
+
"latch-o11y<2.0.0,>=1.2.0",
|
|
12
12
|
"latch-config<1.0.0,>=0.1.6",
|
|
13
13
|
"PyJWT[crypto]<3.0.0,>=2.6.0",
|
|
14
14
|
"orjson<4.0.0,>=3.8.5",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|