latch-asgi 1.0.2__py3-none-any.whl → 1.0.4__py3-none-any.whl

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/auth.py CHANGED
@@ -26,8 +26,9 @@ authentication_header_regex = re.compile(
26
26
  ^(
27
27
  Bearer \s+ (?P<oauth_token>.*) |
28
28
  Latch-Execution-Token \s+ (?P<execution_token>.*) |
29
- Latch-SDK-Token \s+ (?P<sdk_token>.*)
30
- Latch-X-Server-Token \s+ (?P<server_token>.*)
29
+ Latch-SDK-Token \s+ (?P<sdk_token>.*) |
30
+ Latch-X-Server-Token \s+ (?P<server_token>.*) |
31
+ Latch-Session-Token \s+ (?P<session_token>.*)
31
32
  )$
32
33
  """,
33
34
  re.IGNORECASE | re.VERBOSE,
@@ -58,6 +59,7 @@ class _HTTPUnauthorized(HTTPErrorResponse):
58
59
  class Authorization:
59
60
  oauth_sub: str | None = None
60
61
  execution_token: str | None = None
62
+ session_token: str | None = None
61
63
  sdk_token: str | None = None
62
64
  cross_server_token: str | None = None
63
65
 
@@ -105,6 +107,10 @@ def get_signer_sub(auth_header: str) -> Authorization:
105
107
  if sdk_token is not None:
106
108
  return Authorization(sdk_token=sdk_token)
107
109
 
110
+ session_token = auth_match.group("session_token")
111
+ if session_token is not None:
112
+ return Authorization(session_token=session_token)
113
+
108
114
  cross_server_token = auth_match.group("server_token")
109
115
  if cross_server_token is not None:
110
116
  if (
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: latch-asgi
3
- Version: 1.0.2
3
+ Version: 1.0.4
4
4
  Summary: ASGI python server
5
5
  Author-Email: Max Smolin <max@latch.bio>
6
6
  License: CC0-1.0
@@ -1,9 +1,9 @@
1
- latch_asgi-1.0.2.dist-info/METADATA,sha256=uNjp0FMS6N8X_--8cU-vF9Bx1ADd4Lt_nnV3ov7nTa0,580
2
- latch_asgi-1.0.2.dist-info/WHEEL,sha256=N2J68yzZqJh3mI_Wg92rwhw0rtJDFpZj9bwQIMJgaVg,90
3
- latch_asgi-1.0.2.dist-info/licenses/COPYING,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
1
+ latch_asgi-1.0.4.dist-info/METADATA,sha256=7XI3-sIgJ8P4MKSMl_QT5eFhhoBMD4zDNZTBRsQqTsk,580
2
+ latch_asgi-1.0.4.dist-info/WHEEL,sha256=SOP-4bEE0jbVaCHQGVvF08uWxk5rcSsfEybvoQVHlD8,90
3
+ latch_asgi-1.0.4.dist-info/licenses/COPYING,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
4
4
  latch_asgi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  latch_asgi/asgi_iface.py,sha256=JSmp9YnbcU7MymDcqo7DvIGGyP5wZWe-8QNtAtkgJnc,2199
6
- latch_asgi/auth.py,sha256=oemlPJfVaVCWjaDAdfyfkQSDFFvwuK4GXha2PszTfz0,5570
6
+ latch_asgi/auth.py,sha256=wbsdN7n9eDZBvuiPp7_Z4t_kdDeFvGGeSEZn8VKoCUI,5824
7
7
  latch_asgi/config.py,sha256=Tt3fj4sOz6TENfSIWI5_1fZM1aomIu9xQk4kfw4xDXA,276
8
8
  latch_asgi/context/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  latch_asgi/context/common.py,sha256=8Mc1kaQoD0JUAkxD9URFOK4SFE8deJgJ1CroytbuV_Y,2654
@@ -16,4 +16,4 @@ latch_asgi/framework/http.py,sha256=mAZJrsYUPyh3PHt-IL3AEc4bNG1z3Sq8a7mA4o3fPZ0,
16
16
  latch_asgi/framework/websocket.py,sha256=KaRiGGXb635R0U3m_dm9nIT5iWYEWel1IH000MHN3t0,8017
17
17
  latch_asgi/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  latch_asgi/server.py,sha256=Gg1ZUm7LCRgYXUjyIDn6TuZTXSGYk1jUM20ZWC-fseY,18418
19
- latch_asgi-1.0.2.dist-info/RECORD,,
19
+ latch_asgi-1.0.4.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: pdm-backend (2.1.8)
2
+ Generator: pdm-backend (2.3.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any