From 8956689d0121e669c61327640f9cc629b0ed0251 Mon Sep 17 00:00:00 2001 From: daniel-panhead Date: Mon, 23 Nov 2026 23:12:12 +0000 Subject: [PATCH 1/7] [PROD-871] The CLI can carry the linked proxy gateway's streams to public destinations Co-authored-by: Cursor --- src/gumloop/linked_proxy/__init__.py | 1 + src/gumloop/linked_proxy/destinations.py | 171 +++++++++++++++++ src/gumloop/linked_proxy/frames.py | 92 +++++++++ src/gumloop/linked_proxy/tunnel.py | 228 +++++++++++++++++++++++ tests/linked_proxy/__init__.py | 1 + tests/linked_proxy/fixtures/frames.json | 24 +++ tests/linked_proxy/test_destinations.py | 67 +++++++ tests/linked_proxy/test_frames.py | 39 ++++ tests/linked_proxy/test_tunnel.py | 160 ++++++++++++++++ 9 files changed, 783 insertions(+) create mode 100644 src/gumloop/linked_proxy/__init__.py create mode 100644 src/gumloop/linked_proxy/destinations.py create mode 100644 src/gumloop/linked_proxy/frames.py create mode 100644 src/gumloop/linked_proxy/tunnel.py create mode 100644 tests/linked_proxy/__init__.py create mode 100644 tests/linked_proxy/fixtures/frames.json create mode 100644 tests/linked_proxy/test_destinations.py create mode 100644 tests/linked_proxy/test_frames.py create mode 100644 tests/linked_proxy/test_tunnel.py diff --git a/src/gumloop/linked_proxy/__init__.py b/src/gumloop/linked_proxy/__init__.py new file mode 100644 index 0000000..9d48db4 --- /dev/null +++ b/src/gumloop/linked_proxy/__init__.py @@ -0,0 +1 @@ +from __future__ import annotations diff --git a/src/gumloop/linked_proxy/destinations.py b/src/gumloop/linked_proxy/destinations.py new file mode 100644 index 0000000..05bf059 --- /dev/null +++ b/src/gumloop/linked_proxy/destinations.py @@ -0,0 +1,171 @@ +"""Which destinations the tunnel may connect to. These are the linked proxy gateway's +own checks, applied again here because names resolve on this machine, whose +network may route ranges the gateway can't see.""" + +from __future__ import annotations + +import asyncio +import enum +import ipaddress +import re +import socket +import string +from dataclasses import dataclass + +ALLOWED_PORTS = frozenset({80, 443}) +DIAL_TIMEOUT_SECONDS = 10.0 + +# Special-use IPv4 ranges (RFC 6890) that the linked proxy gateway also refuses. +_DENIED_NETWORKS = tuple( + ipaddress.IPv4Network(network) + for network in ( + "10.0.0.0/8", + "100.64.0.0/10", + "127.0.0.0/8", + "169.254.0.0/16", + "172.16.0.0/12", + "192.168.0.0/16", + "0.0.0.0/8", + "192.0.0.0/24", + "192.0.2.0/24", + "198.18.0.0/15", + "198.51.100.0/24", + "203.0.113.0/24", + "240.0.0.0/4", + ) +) +_PORT = re.compile(r"[0-9]+") +_LABEL_CHARACTERS = frozenset(string.ascii_lowercase + string.digits + "-_") + + +class Refusal(str, enum.Enum): + PORT = "port" + ADDRESS = "address" + HOST = "host" + + +class RefusedError(Exception): + """A destination the tunnel may not reach. It never carries the destination.""" + + def __init__(self, reason: Refusal) -> None: + super().__init__(f"destination refused: {reason.value}") + self.reason = reason + + +@dataclass(frozen=True) +class Target: + """A lower-case hostname, or a public IPv4 literal, on port 80 or 443.""" + + host: str + port: int + + +def parse_target(hostport: str) -> Target: + host, separator, port_text = hostport.rpartition(":") + if host.startswith("[") and host.endswith("]"): + host = host[1:-1] + elif ":" in host: + raise RefusedError(Refusal.HOST) + if not separator or not host: + raise RefusedError(Refusal.HOST) + if not _PORT.fullmatch(port_text) or int(port_text) not in ALLOWED_PORTS: + raise RefusedError(Refusal.PORT) + port = int(port_text) + + try: + address = ipaddress.ip_address(host) + except ValueError: + address = None + if address is not None: + if not is_public_ipv4(address): + raise RefusedError(Refusal.ADDRESS) + return Target(host=str(_unmap(address)), port=port) + + host = host.lower().removesuffix(".") + if not _is_hostname(host): + raise RefusedError(Refusal.HOST) + + return Target(host=host, port=port) + + +def is_public_ipv4(address: ipaddress.IPv4Address | ipaddress.IPv6Address) -> bool: + address = _unmap(address) + if not isinstance(address, ipaddress.IPv4Address): + return False + if address.is_multicast or address == ipaddress.IPv4Address("255.255.255.255"): + return False + + return not any(address in network for network in _DENIED_NETWORKS) + + +def _unmap(address: ipaddress.IPv4Address | ipaddress.IPv6Address) -> ipaddress.IPv4Address | ipaddress.IPv6Address: + if isinstance(address, ipaddress.IPv6Address) and address.ipv4_mapped is not None: + return address.ipv4_mapped + return address + + +def _is_hostname(host: str) -> bool: + """DNS names only. A last label of digits is refused because some resolvers + read names like "2130706433" or "127.1" as addresses.""" + if not host or len(host) > 253: + return False + labels = host.split(".") + for label in labels: + if not label or len(label) > 63 or label[0] == "-" or label[-1] == "-": + return False + if not set(label) <= _LABEL_CHARACTERS: + return False + + return labels[-1].strip(string.digits) != "" + + +async def connect(target: Target) -> tuple[asyncio.StreamReader, asyncio.StreamWriter]: + """Resolves the target here, refuses it if any address is not public, then + tries the addresses in the resolver's order.""" + addresses = await _resolve(target) + errors: list[OSError] = [] + for address in addresses: + try: + reader, writer = await asyncio.wait_for(asyncio.open_connection(address, target.port), DIAL_TIMEOUT_SECONDS) + except (OSError, asyncio.TimeoutError) as error: + errors.append(error if isinstance(error, OSError) else TimeoutError("dial timed out")) + continue + if _reaches_this_machine(writer): + writer.close() + raise RefusedError(Refusal.ADDRESS) + return reader, writer + + raise OSError(f"could not connect to any of {len(addresses)} addresses") from (errors[-1] if errors else None) + + +def _reaches_this_machine(writer: asyncio.StreamWriter) -> bool: + """A public address on one of this machine's own interfaces, such as a VPS's, would reach its local services.""" + local = writer.get_extra_info("sockname") + remote = writer.get_extra_info("peername") + return local is not None and remote is not None and local[0] == remote[0] + + +async def _resolve(target: Target) -> list[str]: + try: + literal = ipaddress.ip_address(target.host) + except ValueError: + literal = None + if literal is not None: + candidates = [literal] + else: + infos = await asyncio.get_running_loop().getaddrinfo( + target.host, target.port, family=socket.AF_INET, type=socket.SOCK_STREAM + ) + candidates = [ipaddress.ip_address(info[4][0]) for info in infos] + if not candidates: + raise OSError("no IPv4 addresses for the target") + + addresses: list[str] = [] + for candidate in candidates: + if not is_public_ipv4(candidate): + raise RefusedError(Refusal.ADDRESS) + text = str(_unmap(candidate)) + if text not in addresses: + addresses.append(text) + + return addresses diff --git a/src/gumloop/linked_proxy/frames.py b/src/gumloop/linked_proxy/frames.py new file mode 100644 index 0000000..6d579d6 --- /dev/null +++ b/src/gumloop/linked_proxy/frames.py @@ -0,0 +1,92 @@ +"""The linked proxy gateway's tunnel frames. Each binary WebSocket message is one +frame: a type byte, a big-endian uint32 stream id, then the payload. The +gateway defines the layout; ``tests/linked_proxy/fixtures/frames.json`` is a +byte copy of its fixture.""" + +from __future__ import annotations + +import enum +import struct +from dataclasses import dataclass + +MAX_DATA_LENGTH = 32 * 1024 +# How many bytes each side may send on a new stream before the other grants more. +INITIAL_WINDOW = 256 * 1024 +OPEN_FAIL_DIAL = "dial" + +_HEADER = struct.Struct(">BI") +_WINDOW = struct.Struct(">I") +_MAX_FRAME_LENGTH = _HEADER.size + MAX_DATA_LENGTH +_MAX_TARGET_LENGTH = 253 + len(":65535") +_MAX_REASON_LENGTH = 32 +_MAX_GATEWAY_TOKEN_LENGTH = 1024 + + +class FrameType(enum.IntEnum): + # The gateway asks for a connection to the "host:port" in the payload. Only the gateway opens streams. + OPEN = 1 + OPEN_OK = 2 + # The payload is a refusal ("port", "address", "host") or OPEN_FAIL_DIAL. + OPEN_FAIL = 3 + DATA = 4 + # Ends the stream both ways; the other side sends nothing back. + CLOSE = 5 + # Lets the other side send as many more bytes as the big-endian uint32 payload. + WINDOW = 6 + # A fresh gateway token, sent by the CLI only. It is the only frame on stream 0. + GATEWAY_TOKEN = 7 + + +class ProtocolError(Exception): + """The gateway sent something the tunnel protocol doesn't allow.""" + + +@dataclass(frozen=True) +class Frame: + type: FrameType + stream_id: int + payload: bytes = b"" + + def encode(self) -> bytes: + return _HEADER.pack(self.type, self.stream_id) + self.payload + + @classmethod + def decode(cls, data: bytes) -> Frame: + """Checks the layout only; whether the frame fits its stream is the tunnel's check.""" + if not _HEADER.size <= len(data) <= _MAX_FRAME_LENGTH: + raise ProtocolError(f"a {len(data)}-byte frame") + type_byte, stream_id = _HEADER.unpack_from(data) + payload = data[_HEADER.size :] + if (stream_id == 0) != (type_byte == FrameType.GATEWAY_TOKEN): + raise ProtocolError(f"frame type {type_byte} on stream {stream_id}") + try: + frame_type = FrameType(type_byte) + except ValueError: + raise ProtocolError(f"frame type {type_byte}") from None + + size = len(payload) + valid = { + FrameType.OPEN: 0 < size <= _MAX_TARGET_LENGTH, + FrameType.OPEN_OK: size == 0, + FrameType.OPEN_FAIL: 0 < size <= _MAX_REASON_LENGTH, + FrameType.DATA: size > 0, + FrameType.CLOSE: size == 0, + FrameType.WINDOW: size == _WINDOW.size and _WINDOW.unpack(payload)[0] > 0, + FrameType.GATEWAY_TOKEN: 0 < size <= _MAX_GATEWAY_TOKEN_LENGTH, + }[frame_type] + if not valid: + raise ProtocolError(f"frame type {type_byte} with a {size}-byte payload") + + return cls(type=frame_type, stream_id=stream_id, payload=payload) + + @classmethod + def window(cls, stream_id: int, increment: int) -> Frame: + return cls(type=FrameType.WINDOW, stream_id=stream_id, payload=_WINDOW.pack(increment)) + + @classmethod + def gateway_token(cls, token: str) -> Frame: + return cls(type=FrameType.GATEWAY_TOKEN, stream_id=0, payload=token.encode()) + + @property + def window_increment(self) -> int: + return _WINDOW.unpack(self.payload)[0] diff --git a/src/gumloop/linked_proxy/tunnel.py b/src/gumloop/linked_proxy/tunnel.py new file mode 100644 index 0000000..565158d --- /dev/null +++ b/src/gumloop/linked_proxy/tunnel.py @@ -0,0 +1,228 @@ +"""Serves the streams the linked proxy gateway opens over the CLI's WebSocket: each +one becomes a connection from this machine to an allowed destination.""" + +from __future__ import annotations + +import asyncio +from collections.abc import Awaitable +from collections.abc import Callable +from typing import Protocol + +from gumloop.linked_proxy.destinations import RefusedError +from gumloop.linked_proxy.destinations import Target +from gumloop.linked_proxy.destinations import connect +from gumloop.linked_proxy.destinations import parse_target +from gumloop.linked_proxy.frames import INITIAL_WINDOW +from gumloop.linked_proxy.frames import MAX_DATA_LENGTH +from gumloop.linked_proxy.frames import OPEN_FAIL_DIAL +from gumloop.linked_proxy.frames import Frame +from gumloop.linked_proxy.frames import FrameType +from gumloop.linked_proxy.frames import ProtocolError + +# Bounds the credit the gateway may grant, so a stream's window stays sane. +_MAX_SEND_WINDOW = 64 * 1024 * 1024 + +Dial = Callable[[Target], Awaitable[tuple[asyncio.StreamReader, asyncio.StreamWriter]]] + + +class Connection(Protocol): + """The WebSocket to the gateway. ``websockets``' client connection is one.""" + + async def send(self, message: bytes) -> None: ... + + async def recv(self) -> bytes | str: ... + + +class Tunnel: + def __init__( + self, + connection: Connection, + *, + dial: Dial = connect, + on_open: Callable[[Target], None] | None = None, + ) -> None: + self._connection = connection + self._dial = dial + self._on_open = on_open + self._send_lock = asyncio.Lock() + self._streams: dict[int, _Stream] = {} + self._last_id = 0 + self._tasks: set[asyncio.Task[None]] = set() + + async def run(self) -> None: + """Serves streams until ``recv`` raises: the WebSocket closed, or the + gateway broke the protocol (``ProtocolError``). Every stream ends with it.""" + try: + while True: + message = await self._connection.recv() + if isinstance(message, str): + raise ProtocolError("a text message") + self._deliver(Frame.decode(message)) + finally: + for stream in list(self._streams.values()): + stream.shut() + for task in self._tasks: + task.cancel() + + def _deliver(self, frame: Frame) -> None: + if frame.type is FrameType.OPEN: + # Stream ids only grow, so a late frame can't reach a newer stream. + if frame.stream_id <= self._last_id: + raise ProtocolError(f"stream {frame.stream_id} opened again") + self._last_id = frame.stream_id + stream = _Stream(self, frame.stream_id) + self._streams[frame.stream_id] = stream + stream.start(self._spawn(stream.open(frame.payload.decode("utf-8", errors="replace")))) + return + if frame.type in (FrameType.OPEN_OK, FrameType.OPEN_FAIL, FrameType.GATEWAY_TOKEN): + raise ProtocolError(f"the gateway sent {frame.type.name}") + + stream = self._streams.get(frame.stream_id) + if stream is None: + if frame.stream_id <= self._last_id: + # The stream already ended here; the gateway's frames crossed its CLOSE. + return + raise ProtocolError(f"a frame for stream {frame.stream_id}, which was never opened") + if frame.type is FrameType.DATA: + stream.receive(frame.payload) + elif frame.type is FrameType.WINDOW: + stream.grant(frame.window_increment) + elif frame.type is FrameType.CLOSE: + stream.shut() + + async def send_gateway_token(self, token: str) -> None: + """The gateway checks it right away and uses it for its rechecks from then on.""" + await self._send(Frame.gateway_token(token)) + + def _spawn(self, coroutine: Awaitable[None]) -> asyncio.Task[None]: + task = asyncio.ensure_future(coroutine) + self._tasks.add(task) + task.add_done_callback(self._finished) + return task + + def _finished(self, task: asyncio.Task[None]) -> None: + self._tasks.discard(task) + # A stream fails when the WebSocket does; run() reports that once. + if not task.cancelled(): + task.exception() + + async def _send(self, frame: Frame) -> None: + async with self._send_lock: + await self._connection.send(frame.encode()) + + def _forget(self, stream_id: int) -> None: + self._streams.pop(stream_id, None) + + +class _Stream: + """One connection to a destination. Its frames arrive on the tunnel's read + loop; its own tasks dial and relay.""" + + def __init__(self, tunnel: Tunnel, stream_id: int) -> None: + self._tunnel = tunnel + self.id = stream_id + self._tasks: list[asyncio.Task[None]] = [] + self._writer: asyncio.StreamWriter | None = None + self._open = False + self._ended = False + self._send_window = INITIAL_WINDOW + self._can_send = asyncio.Event() + self._can_send.set() + self._recv_window = INITIAL_WINDOW + self._incoming: asyncio.Queue[bytes] = asyncio.Queue() + + def start(self, task: asyncio.Task[None]) -> None: + self._tasks.append(task) + + async def open(self, hostport: str) -> None: + try: + target = parse_target(hostport) + if self._tunnel._on_open is not None: + self._tunnel._on_open(target) + reader, writer = await self._tunnel._dial(target) + except RefusedError as error: + await self._fail(error.reason.value) + return + except OSError: + await self._fail(OPEN_FAIL_DIAL) + return + if self._ended: + writer.close() + return + + self._writer = writer + self._open = True + await self._tunnel._send(Frame(type=FrameType.OPEN_OK, stream_id=self.id)) + self._tasks.append(self._tunnel._spawn(self._upload(reader))) + self._tasks.append(self._tunnel._spawn(self._download(writer))) + + async def _fail(self, reason: str) -> None: + self._ended = True + self._tunnel._forget(self.id) + await self._tunnel._send(Frame(type=FrameType.OPEN_FAIL, stream_id=self.id, payload=reason.encode())) + + def receive(self, data: bytes) -> None: + if not self._open: + raise ProtocolError(f"data before OPEN_OK on stream {self.id}") + if len(data) > self._recv_window: + raise ProtocolError(f"data past the window on stream {self.id}") + self._recv_window -= len(data) + self._incoming.put_nowait(data) + + def grant(self, increment: int) -> None: + self._send_window += increment + if self._send_window > _MAX_SEND_WINDOW: + raise ProtocolError(f"a window past {_MAX_SEND_WINDOW} bytes on stream {self.id}") + self._can_send.set() + + async def _upload(self, reader: asyncio.StreamReader) -> None: + """Destination to gateway, within the gateway's window.""" + try: + while True: + await self._can_send.wait() + data = await reader.read(min(self._send_window, MAX_DATA_LENGTH)) + if not data: + break + self._send_window -= len(data) + if self._send_window == 0: + self._can_send.clear() + await self._tunnel._send(Frame(type=FrameType.DATA, stream_id=self.id, payload=data)) + except OSError: + pass + await self._close() + + async def _download(self, writer: asyncio.StreamWriter) -> None: + """Gateway to destination. Credit goes back once half the window is written.""" + unacked = 0 + try: + while True: + data = await self._incoming.get() + writer.write(data) + await writer.drain() + unacked += len(data) + if unacked >= INITIAL_WINDOW // 2: + self._recv_window += unacked + await self._tunnel._send(Frame.window(self.id, unacked)) + unacked = 0 + except OSError: + await self._close() + + async def _close(self) -> None: + """Ends the stream from this side and tells the gateway.""" + if self._ended: + return + self.shut() + await self._tunnel._send(Frame(type=FrameType.CLOSE, stream_id=self.id)) + + def shut(self) -> None: + """Ends the stream without telling the gateway: it closed the stream, or the tunnel ended.""" + if self._ended: + return + self._ended = True + self._tunnel._forget(self.id) + current = asyncio.current_task() + for task in self._tasks: + if task is not current: + task.cancel() + if self._writer is not None: + self._writer.close() diff --git a/tests/linked_proxy/__init__.py b/tests/linked_proxy/__init__.py new file mode 100644 index 0000000..bf77bdb --- /dev/null +++ b/tests/linked_proxy/__init__.py @@ -0,0 +1 @@ +"""Browser proxy tunnel tests.""" diff --git a/tests/linked_proxy/fixtures/frames.json b/tests/linked_proxy/fixtures/frames.json new file mode 100644 index 0000000..bfe55e3 --- /dev/null +++ b/tests/linked_proxy/fixtures/frames.json @@ -0,0 +1,24 @@ +{ + "valid": [ + {"name": "open", "frame": "01000000016578616d706c652e636f6d3a343433", "type": 1, "stream_id": 1, "payload": "6578616d706c652e636f6d3a343433"}, + {"name": "open_ok", "frame": "0200000001", "type": 2, "stream_id": 1, "payload": ""}, + {"name": "open_fail", "frame": "030000000261646472657373", "type": 3, "stream_id": 2, "payload": "61646472657373"}, + {"name": "data", "frame": "04000000016869", "type": 4, "stream_id": 1, "payload": "6869"}, + {"name": "data on a big-endian stream id", "frame": "040102030400ff", "type": 4, "stream_id": 16909060, "payload": "00ff"}, + {"name": "close", "frame": "0500000001", "type": 5, "stream_id": 1, "payload": ""}, + {"name": "window", "frame": "060000000100040000", "type": 6, "stream_id": 1, "payload": "00040000"}, + {"name": "gateway_token", "frame": "0700000000746f6b", "type": 7, "stream_id": 0, "payload": "746f6b"} + ], + "invalid": [ + {"name": "shorter than the header", "frame": "01000000"}, + {"name": "unknown type", "frame": "0800000001"}, + {"name": "stream 0", "frame": "04000000006869"}, + {"name": "gateway token on stream 1", "frame": "0700000001746f6b"}, + {"name": "gateway token with no payload", "frame": "0700000000"}, + {"name": "open with no target", "frame": "0100000001"}, + {"name": "open_ok with a payload", "frame": "020000000100"}, + {"name": "data with no payload", "frame": "0400000001"}, + {"name": "window of two bytes", "frame": "06000000010004"}, + {"name": "window of zero", "frame": "060000000100000000"} + ] +} diff --git a/tests/linked_proxy/test_destinations.py b/tests/linked_proxy/test_destinations.py new file mode 100644 index 0000000..d406a92 --- /dev/null +++ b/tests/linked_proxy/test_destinations.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +import asyncio + +import pytest + +from gumloop.linked_proxy.destinations import Refusal +from gumloop.linked_proxy.destinations import RefusedError +from gumloop.linked_proxy.destinations import Target +from gumloop.linked_proxy.destinations import connect +from gumloop.linked_proxy.destinations import parse_target + + +@pytest.mark.parametrize( + ("hostport", "reason"), + [ + ("example.com:22", Refusal.PORT), + ("10.0.0.1:443", Refusal.ADDRESS), + ("[::1]:443", Refusal.ADDRESS), + ("127.1:443", Refusal.HOST), + ("example.com", Refusal.HOST), + ], +) +def test_parse_target_refuses_what_the_gateway_refuses(hostport: str, reason: Refusal) -> None: + with pytest.raises(RefusedError) as refused: + parse_target(hostport) + + assert refused.value.reason is reason + + +def test_parse_target_accepts_a_hostname_and_a_public_address() -> None: + assert parse_target("Example.COM.:443") == Target(host="example.com", port=443) + assert parse_target("93.184.215.14:80") == Target(host="93.184.215.14", port=80) + + +def test_connect_refuses_a_name_that_resolves_to_a_private_address() -> None: + with pytest.raises(RefusedError) as refused: + asyncio.run(connect(Target(host="localhost", port=443))) + + assert refused.value.reason is Refusal.ADDRESS + + +class _Writer: + def __init__(self, local: str, remote: str) -> None: + self._addresses = {"sockname": (local, 50000), "peername": (remote, 443)} + self.closed = False + + def get_extra_info(self, name: str) -> tuple[str, int]: + return self._addresses[name] + + def close(self) -> None: + self.closed = True + + +def test_connect_refuses_a_public_address_of_this_machine(monkeypatch) -> None: + writer = _Writer(local="93.184.215.14", remote="93.184.215.14") + + async def open_connection(host: str, port: int) -> tuple[asyncio.StreamReader, _Writer]: + return asyncio.StreamReader(), writer + + monkeypatch.setattr(asyncio, "open_connection", open_connection) + + with pytest.raises(RefusedError) as refused: + asyncio.run(connect(Target(host="93.184.215.14", port=443))) + + assert refused.value.reason is Refusal.ADDRESS + assert writer.closed diff --git a/tests/linked_proxy/test_frames.py b/tests/linked_proxy/test_frames.py new file mode 100644 index 0000000..ad96efa --- /dev/null +++ b/tests/linked_proxy/test_frames.py @@ -0,0 +1,39 @@ +from __future__ import annotations + +import hashlib +import json +from pathlib import Path + +import pytest + +from gumloop.linked_proxy.frames import Frame +from gumloop.linked_proxy.frames import FrameType +from gumloop.linked_proxy.frames import ProtocolError + +FIXTURE = Path(__file__).parent / "fixtures" / "frames.json" +# The linked proxy gateway pins its own copy of this file by the same hash; change both together. +FIXTURE_SHA256 = "a19bdf1ec020eeab8bbf966c0ee6e4a0eb47748b0d27983ff5b758dcf84489c1" + + +def _fixture() -> dict[str, list[dict[str, str | int]]]: + raw = FIXTURE.read_bytes() + assert hashlib.sha256(raw).hexdigest() == FIXTURE_SHA256 + return json.loads(raw) + + +@pytest.mark.parametrize("case", _fixture()["valid"], ids=lambda case: str(case["name"])) +def test_frames_decode_and_encode_like_the_gateway(case: dict[str, str | int]) -> None: + encoded = bytes.fromhex(str(case["frame"])) + + frame = Frame.decode(encoded) + + assert frame.type is FrameType(case["type"]) + assert frame.stream_id == case["stream_id"] + assert frame.payload == bytes.fromhex(str(case["payload"])) + assert frame.encode() == encoded + + +@pytest.mark.parametrize("case", _fixture()["invalid"], ids=lambda case: str(case["name"])) +def test_frames_the_gateway_refuses_are_refused(case: dict[str, str | int]) -> None: + with pytest.raises(ProtocolError): + Frame.decode(bytes.fromhex(str(case["frame"]))) diff --git a/tests/linked_proxy/test_tunnel.py b/tests/linked_proxy/test_tunnel.py new file mode 100644 index 0000000..44f6832 --- /dev/null +++ b/tests/linked_proxy/test_tunnel.py @@ -0,0 +1,160 @@ +from __future__ import annotations + +import asyncio +import os +from collections.abc import Callable + +import pytest + +from gumloop.linked_proxy.destinations import Target +from gumloop.linked_proxy.frames import INITIAL_WINDOW +from gumloop.linked_proxy.frames import MAX_DATA_LENGTH +from gumloop.linked_proxy.frames import Frame +from gumloop.linked_proxy.frames import FrameType +from gumloop.linked_proxy.frames import ProtocolError +from gumloop.linked_proxy.tunnel import Tunnel + + +class FakeGateway: + """The gateway's end of the WebSocket. Frames pushed here reach the tunnel's + ``recv``; frames the tunnel sends come back from ``next_frame``.""" + + def __init__(self) -> None: + self._inbound: asyncio.Queue[bytes | None] = asyncio.Queue() + self._sent: asyncio.Queue[Frame] = asyncio.Queue() + + async def send(self, message: bytes) -> None: + self._sent.put_nowait(Frame.decode(message)) + + async def recv(self) -> bytes: + message = await self._inbound.get() + if message is None: + raise ConnectionError("the WebSocket closed") + return message + + def push(self, frame: Frame) -> None: + self._inbound.put_nowait(frame.encode()) + + def close(self) -> None: + self._inbound.put_nowait(None) + + async def next_frame(self) -> Frame: + return await asyncio.wait_for(self._sent.get(), 5) + + +async def _echo(reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None: + while data := await reader.read(65536): + writer.write(data) + await writer.drain() + writer.close() + + +async def _open( + gateway: FakeGateway, port: int, *, on_open: Callable[[Target], None] | None = None +) -> asyncio.Task[None]: + """Opens stream 1 to the echo server on port and returns the running tunnel.""" + + async def dial(target: Target) -> tuple[asyncio.StreamReader, asyncio.StreamWriter]: + return await asyncio.open_connection("127.0.0.1", port) + + run = asyncio.ensure_future(Tunnel(gateway, dial=dial, on_open=on_open).run()) + gateway.push(Frame(type=FrameType.OPEN, stream_id=1, payload=b"example.com:443")) + assert (await gateway.next_frame()).type is FrameType.OPEN_OK + + return run + + +@pytest.mark.timeout(10) +def test_tunnel_relays_more_than_a_window_each_way() -> None: + async def scenario() -> None: + server = await asyncio.start_server(_echo, "127.0.0.1", 0) + gateway = FakeGateway() + opened: list[Target] = [] + run = await _open(gateway, server.sockets[0].getsockname()[1], on_open=opened.append) + + sent = os.urandom(4 * INITIAL_WINDOW) + offset, send_window, unacked = 0, INITIAL_WINDOW, 0 + received = bytearray() + while len(received) < len(sent): + while offset < len(sent) and send_window > 0: + chunk = sent[offset : offset + min(MAX_DATA_LENGTH, send_window)] + gateway.push(Frame(type=FrameType.DATA, stream_id=1, payload=chunk)) + offset, send_window = offset + len(chunk), send_window - len(chunk) + frame = await gateway.next_frame() + if frame.type is FrameType.WINDOW: + send_window += frame.window_increment + elif frame.type is FrameType.DATA: + received += frame.payload + unacked += len(frame.payload) + if unacked >= INITIAL_WINDOW // 2: + gateway.push(Frame.window(1, unacked)) + unacked = 0 + + assert bytes(received) == sent + assert opened == [Target(host="example.com", port=443)] + gateway.close() + with pytest.raises(ConnectionError): + await run + server.close() + await server.wait_closed() + + asyncio.run(scenario()) + + +@pytest.mark.timeout(10) +def test_tunnel_refuses_a_private_destination_without_dialing() -> None: + async def scenario() -> None: + dialed: list[Target] = [] + + async def dial(target: Target) -> tuple[asyncio.StreamReader, asyncio.StreamWriter]: + dialed.append(target) + raise AssertionError("a refused destination is never dialed") + + gateway = FakeGateway() + run = asyncio.ensure_future(Tunnel(gateway, dial=dial).run()) + gateway.push(Frame(type=FrameType.OPEN, stream_id=1, payload=b"10.0.0.1:443")) + + assert await gateway.next_frame() == Frame(type=FrameType.OPEN_FAIL, stream_id=1, payload=b"address") + assert dialed == [] + gateway.close() + with pytest.raises(ConnectionError): + await run + + asyncio.run(scenario()) + + +@pytest.mark.timeout(10) +def test_tunnel_ends_when_the_gateway_sends_past_the_window() -> None: + async def scenario() -> None: + server = await asyncio.start_server(_echo, "127.0.0.1", 0) + gateway = FakeGateway() + run = await _open(gateway, server.sockets[0].getsockname()[1]) + + # Pushed without yielding, so the tunnel reads them back to back before granting anything. + for _ in range(INITIAL_WINDOW // MAX_DATA_LENGTH): + gateway.push(Frame(type=FrameType.DATA, stream_id=1, payload=bytes(MAX_DATA_LENGTH))) + gateway.push(Frame(type=FrameType.DATA, stream_id=1, payload=b"\x00")) + + with pytest.raises(ProtocolError): + await run + server.close() + await server.wait_closed() + + asyncio.run(scenario()) + + +@pytest.mark.timeout(10) +def test_tunnel_sends_a_gateway_token_and_ends_when_the_gateway_sends_one() -> None: + async def scenario() -> None: + gateway = FakeGateway() + tunnel = Tunnel(gateway) + run = asyncio.ensure_future(tunnel.run()) + + await tunnel.send_gateway_token("fresh-token") + gateway.push(Frame.gateway_token("from-the-gateway")) + + assert await gateway.next_frame() == Frame.gateway_token("fresh-token") + with pytest.raises(ProtocolError): + await run + + asyncio.run(scenario()) From 602d4142f4e421713fa6341e1080fec3879ec7ba Mon Sep 17 00:00:00 2001 From: daniel-panhead Date: Mon, 23 Nov 2026 23:30:18 +0000 Subject: [PATCH 2/7] [PROD-871] The CLI can register a linked proxy and keep its tunnel to the linked proxy gateway open Co-authored-by: Cursor --- pyproject.toml | 3 + src/gumloop/_client.py | 4 + src/gumloop/cli/credentials.py | 4 +- src/gumloop/cli/linked_proxy_key.py | 92 +++++ src/gumloop/linked_proxy/connection.py | 142 ++++++++ src/gumloop/linked_proxy/frames.py | 4 +- src/gumloop/linked_proxy/sign_in.py | 48 +++ src/gumloop/resources/__init__.py | 4 + src/gumloop/resources/linked_proxies.py | 59 ++++ src/gumloop/types.py | 29 ++ tests/cli/test_linked_proxy_key.py | 40 +++ tests/linked_proxy/test_connection.py | 174 +++++++++ tests/linked_proxy/test_sign_in.py | 37 ++ tests/sdk/test_linked_proxies.py | 56 +++ uv.lock | 452 +++++++++++++++++++----- 15 files changed, 1064 insertions(+), 84 deletions(-) create mode 100644 src/gumloop/cli/linked_proxy_key.py create mode 100644 src/gumloop/linked_proxy/connection.py create mode 100644 src/gumloop/linked_proxy/sign_in.py create mode 100644 src/gumloop/resources/linked_proxies.py create mode 100644 tests/cli/test_linked_proxy_key.py create mode 100644 tests/linked_proxy/test_connection.py create mode 100644 tests/linked_proxy/test_sign_in.py create mode 100644 tests/sdk/test_linked_proxies.py diff --git a/pyproject.toml b/pyproject.toml index f0d900a..9d9ebdd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,8 @@ classifiers = [ "Programming Language :: Python :: 3.13", ] dependencies = [ + # The linked proxy trusts certifi's roots only, never the OS store. + "certifi>=2024.2.2", "cryptography>=42.0.0", "httpx>=0.24.1", "httpx-sse>=0.4.0", @@ -31,6 +33,7 @@ dependencies = [ "rich", "click>=8.0", "typer>=0.25.1,<0.30", + "websockets>=14", ] [tool.hatch.version] diff --git a/src/gumloop/_client.py b/src/gumloop/_client.py index 3ccbb24..c0ab8ab 100644 --- a/src/gumloop/_client.py +++ b/src/gumloop/_client.py @@ -23,6 +23,7 @@ from gumloop.resources import AsyncChat from gumloop.resources import AsyncDecisions from gumloop.resources import AsyncEvaluations +from gumloop.resources import AsyncLinkedProxies from gumloop.resources import AsyncMCP from gumloop.resources import AsyncModels from gumloop.resources import AsyncOrganizations @@ -36,6 +37,7 @@ from gumloop.resources import Chat from gumloop.resources import Decisions from gumloop.resources import Evaluations +from gumloop.resources import LinkedProxies from gumloop.resources import Models from gumloop.resources import Organizations from gumloop.resources import Sessions @@ -120,6 +122,7 @@ def __init__( self.artifacts = Artifacts(self._http) self.brain = Brain(self._http) self.browser_profiles = BrowserProfiles(self._http) + self.linked_proxies = LinkedProxies(self._http) self.oauth = OAuth(base_url=self.base_url, timeout=self.timeout) def close(self) -> None: @@ -188,6 +191,7 @@ def __init__( self.artifacts = AsyncArtifacts(self._http) self.brain = AsyncBrain(self._http) self.browser_profiles = AsyncBrowserProfiles(self._http) + self.linked_proxies = AsyncLinkedProxies(self._http) self.oauth = OAuth(base_url=self.base_url, timeout=self.timeout) async def __aenter__(self) -> AsyncGumloop: diff --git a/src/gumloop/cli/credentials.py b/src/gumloop/cli/credentials.py index 524216f..0f1a377 100644 --- a/src/gumloop/cli/credentials.py +++ b/src/gumloop/cli/credentials.py @@ -60,7 +60,7 @@ def is_keyring_available() -> bool: return not isinstance(keyring.get_keyring(), keyring.backends.fail.Keyring) -def _require_keyring() -> None: +def require_keyring() -> None: if is_keyring_available(): return raise GumloopError( @@ -90,7 +90,7 @@ def load_credentials(profile: str = DEFAULT_PROFILE) -> Credentials: def save_credentials(creds: Credentials, profile: str = DEFAULT_PROFILE) -> None: """Persist ``creds``. Fields set to ``None`` delete their keychain entry.""" - _require_keyring() + require_keyring() for field in _FIELDS: value = getattr(creds, field) account = _account(profile, field) diff --git a/src/gumloop/cli/linked_proxy_key.py b/src/gumloop/cli/linked_proxy_key.py new file mode 100644 index 0000000..c5912bd --- /dev/null +++ b/src/gumloop/cli/linked_proxy_key.py @@ -0,0 +1,92 @@ +"""This machine's linked proxy on one backend: the Ed25519 key it signs in to the +linked proxy gateway with, kept in the OS keychain, and the linked proxy that key +registered as.""" + +from __future__ import annotations + +import base64 +import os +from pathlib import Path +from urllib.parse import urlsplit + +import keyring +import keyring.errors +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey +from cryptography.hazmat.primitives.serialization import Encoding +from cryptography.hazmat.primitives.serialization import NoEncryption +from cryptography.hazmat.primitives.serialization import PrivateFormat +from pydantic import BaseModel +from pydantic import ConfigDict +from pydantic import Field +from pydantic import ValidationError +from pydantic import field_validator + +from gumloop import GumloopError +from gumloop.cli.credentials import KEYRING_SERVICE +from gumloop.cli.credentials import require_keyring + +_LOOPBACK_HOSTS = frozenset({"localhost", "127.0.0.1", "::1"}) + + +class LinkedProxyRegistration(BaseModel): + model_config = ConfigDict(extra="forbid") + + linked_proxy_id: str = Field(min_length=1) + gateway_url: str = Field(min_length=1) + + @field_validator("gateway_url") + @classmethod + def _require_encrypted_gateway(cls, gateway_url: str) -> str: + """Over plain ws:// the sign-in token and the tunnelled traffic are readable on the network.""" + parts = urlsplit(gateway_url) + if parts.scheme == "wss" or (parts.scheme == "ws" and parts.hostname in _LOOPBACK_HOSTS): + return gateway_url + raise ValueError("the linked proxy gateway must use wss:// unless it runs on this computer") + + +def backend_host(base_url: str) -> str: + """Each backend gets its own key and registration, so staging and production never share one.""" + return urlsplit(base_url).netloc + + +def load_or_create_key(host: str) -> Ed25519PrivateKey: + require_keyring() + account = _key_account(host) + try: + stored = keyring.get_password(KEYRING_SERVICE, account) + if stored is None: + key = Ed25519PrivateKey.generate() + raw = key.private_bytes(Encoding.Raw, PrivateFormat.Raw, NoEncryption()) + keyring.set_password(KEYRING_SERVICE, account, base64.urlsafe_b64encode(raw).decode()) + return key + except keyring.errors.KeyringError as error: + raise GumloopError(f"Could not use the linked proxy key in the OS keychain: {error}") from error + try: + return Ed25519PrivateKey.from_private_bytes(base64.urlsafe_b64decode(stored)) + except ValueError as error: + raise GumloopError(f"The linked proxy key for {host} in the OS keychain is unreadable.") from error + + +def load_registration(host: str, home: Path | None = None) -> LinkedProxyRegistration | None: + try: + return LinkedProxyRegistration.model_validate_json(_registration_path(host, home).read_text(encoding="utf-8")) + except (OSError, ValidationError): + return None + + +def save_registration(host: str, registration: LinkedProxyRegistration, home: Path | None = None) -> None: + destination = _registration_path(host, home) + destination.parent.mkdir(mode=0o700, parents=True, exist_ok=True) + staging = destination.with_name(f".{destination.name}.tmp") + descriptor = os.open(staging, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600) + with os.fdopen(descriptor, "w", encoding="utf-8") as file: + file.write(registration.model_dump_json()) + os.replace(staging, destination) + + +def _key_account(host: str) -> str: + return f"linked-proxy:{host}" + + +def _registration_path(host: str, home: Path | None) -> Path: + return (home or Path.home()) / ".gumloop" / "linked-proxy" / f"{host}.json" diff --git a/src/gumloop/linked_proxy/connection.py b/src/gumloop/linked_proxy/connection.py new file mode 100644 index 0000000..096d71c --- /dev/null +++ b/src/gumloop/linked_proxy/connection.py @@ -0,0 +1,142 @@ +"""Keeps this machine's tunnel to the linked proxy gateway open: signs in, serves the +gateway's streams, and reconnects until the gateway refuses the sign-in or the +user signs out.""" + +from __future__ import annotations + +import asyncio +import functools +import random +import ssl +import time +from collections.abc import Awaitable +from collections.abc import Callable +from contextlib import AbstractAsyncContextManager + +import certifi +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey +from websockets.asyncio.client import connect as websocket_connect +from websockets.exceptions import ConnectionClosed +from websockets.exceptions import InvalidStatus +from websockets.exceptions import WebSocketException + +from gumloop._http import user_agent +from gumloop.linked_proxy.destinations import Target +from gumloop.linked_proxy.frames import MAX_FRAME_LENGTH +from gumloop.linked_proxy.frames import ProtocolError +from gumloop.linked_proxy.sign_in import sign_in_token +from gumloop.linked_proxy.tunnel import Connection +from gumloop.linked_proxy.tunnel import Tunnel + +# The gateway's close code and refusal header for a sign-in it won't accept. +CLOSE_SIGN_IN_REFUSED = 4001 +ERROR_HEADER = "X-Gumloop-Linked-Proxy-Error" +SIGN_IN_REFUSED = "sign_in_refused" + +FIRST_RETRY_SECONDS = 1.0 +MAX_RETRY_SECONDS = 60.0 +# A connection that stayed up this long starts the backoff over. +STABLE_SECONDS = 60.0 +_OPEN_TIMEOUT_SECONDS = 10.0 + +Open = Callable[[str, dict[str, str]], AbstractAsyncContextManager[Connection]] + + +class SignInRefused(Exception): + """The gateway won't accept this linked proxy: it was unlinked, or its owner can't use it anymore.""" + + def __init__(self, reason: str) -> None: + super().__init__(reason) + self.reason = reason + + +class SignedOut(Exception): + """The user has no stored login for this backend.""" + + +class GatewayTokenUnavailable(Exception): + """Gumloop didn't hand out a gateway token this time; the connection retries.""" + + +class GatewayConnection: + def __init__( + self, + *, + gateway_url: str, + linked_proxy_id: str, + key: Ed25519PrivateKey, + signed_in: Callable[[], bool], + gateway_token: Callable[[], str], + on_open: Callable[[Target], None] | None = None, + open_websocket: Open | None = None, + sleep: Callable[[float], Awaitable[None]] = asyncio.sleep, + ) -> None: + self._gateway_url = gateway_url + self._linked_proxy_id = linked_proxy_id + self._key = key + self._signed_in = signed_in + self._gateway_token = gateway_token + self._on_open = on_open + self._open = open_websocket or _open_websocket + self._sleep = sleep + + async def run(self) -> None: + """Runs until it raises ``SignInRefused`` or ``SignedOut``. Every other + failure reconnects after a random wait whose cap doubles up to ``MAX_RETRY_SECONDS``. + ``gateway_token`` runs in a thread before each connect, and raises + ``SignInRefused`` or ``GatewayTokenUnavailable`` when it has no token.""" + retry_cap = FIRST_RETRY_SECONDS + while True: + if not self._signed_in(): + raise SignedOut() + started = time.monotonic() + try: + await self._serve() + except (OSError, asyncio.TimeoutError, WebSocketException, ProtocolError, GatewayTokenUnavailable) as error: + reason = _sign_in_refusal(error) + if reason is not None: + raise SignInRefused(reason) from error + if time.monotonic() - started >= STABLE_SECONDS: + retry_cap = FIRST_RETRY_SECONDS + await self._sleep(random.uniform(FIRST_RETRY_SECONDS, retry_cap)) + retry_cap = min(retry_cap * 2, MAX_RETRY_SECONDS) + + async def _serve(self) -> None: + gateway_token = await asyncio.to_thread(self._gateway_token) + token = sign_in_token( + self._key, + linked_proxy_id=self._linked_proxy_id, + audience=self._gateway_url, + gateway_token=gateway_token, + ) + async with self._open(self._gateway_url, {"Authorization": f"Bearer {token}"}) as websocket: + await Tunnel(websocket, on_open=self._on_open).run() + + +def _sign_in_refusal(error: BaseException) -> str | None: + if isinstance(error, ConnectionClosed) and error.rcvd is not None and error.rcvd.code == CLOSE_SIGN_IN_REFUSED: + return error.rcvd.reason or SIGN_IN_REFUSED + if ( + isinstance(error, InvalidStatus) + and error.response.status_code == 401 + and error.response.headers.get(ERROR_HEADER) == SIGN_IN_REFUSED + ): + return SIGN_IN_REFUSED + return None + + +def _open_websocket(url: str, headers: dict[str, str]) -> AbstractAsyncContextManager[Connection]: + return websocket_connect( + url, + additional_headers=headers, + user_agent_header=user_agent(), + ssl=_tls_context() if url.startswith("wss://") else None, + compression=None, + max_size=MAX_FRAME_LENGTH, + open_timeout=_OPEN_TIMEOUT_SECONDS, + ) + + +@functools.cache +def _tls_context() -> ssl.SSLContext: + return ssl.create_default_context(cafile=certifi.where()) diff --git a/src/gumloop/linked_proxy/frames.py b/src/gumloop/linked_proxy/frames.py index 6d579d6..660346f 100644 --- a/src/gumloop/linked_proxy/frames.py +++ b/src/gumloop/linked_proxy/frames.py @@ -16,7 +16,7 @@ _HEADER = struct.Struct(">BI") _WINDOW = struct.Struct(">I") -_MAX_FRAME_LENGTH = _HEADER.size + MAX_DATA_LENGTH +MAX_FRAME_LENGTH = _HEADER.size + MAX_DATA_LENGTH _MAX_TARGET_LENGTH = 253 + len(":65535") _MAX_REASON_LENGTH = 32 _MAX_GATEWAY_TOKEN_LENGTH = 1024 @@ -53,7 +53,7 @@ def encode(self) -> bytes: @classmethod def decode(cls, data: bytes) -> Frame: """Checks the layout only; whether the frame fits its stream is the tunnel's check.""" - if not _HEADER.size <= len(data) <= _MAX_FRAME_LENGTH: + if not _HEADER.size <= len(data) <= MAX_FRAME_LENGTH: raise ProtocolError(f"a {len(data)}-byte frame") type_byte, stream_id = _HEADER.unpack_from(data) payload = data[_HEADER.size :] diff --git a/src/gumloop/linked_proxy/sign_in.py b/src/gumloop/linked_proxy/sign_in.py new file mode 100644 index 0000000..81c34c0 --- /dev/null +++ b/src/gumloop/linked_proxy/sign_in.py @@ -0,0 +1,48 @@ +"""The token the CLI signs in to the linked proxy gateway with: a compact EdDSA JWS +signed by this machine's linked proxy key. The gateway accepts a token only for its +own URL, for at most a minute, and only once.""" + +from __future__ import annotations + +import base64 +import json +import secrets +import time + +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey +from cryptography.hazmat.primitives.serialization import Encoding +from cryptography.hazmat.primitives.serialization import PublicFormat + +TOKEN_LIFETIME_SECONDS = 60 + + +def public_key_text(key: Ed25519PrivateKey) -> str: + """The raw public key in unpadded base64url, the form the backend registers.""" + return _encode(key.public_key().public_bytes(Encoding.Raw, PublicFormat.Raw)) + + +def sign_in_token( + key: Ed25519PrivateKey, *, linked_proxy_id: str, audience: str, gateway_token: str, now: float | None = None +) -> str: + """``gateway_token`` is the backend's token for this linked proxy. The + gateway learns the key to verify the sign-in token with from it.""" + issued_at = int(time.time() if now is None else now) + header = {"alg": "EdDSA", "typ": "JWT"} + claims = { + "sub": linked_proxy_id, + "aud": audience, + "iat": issued_at, + "exp": issued_at + TOKEN_LIFETIME_SECONDS, + "jti": secrets.token_urlsafe(16), + "gateway_token": gateway_token, + } + signing_input = f"{_encode_json(header)}.{_encode_json(claims)}" + return f"{signing_input}.{_encode(key.sign(signing_input.encode()))}" + + +def _encode_json(value: dict[str, str | int]) -> str: + return _encode(json.dumps(value, separators=(",", ":")).encode()) + + +def _encode(raw: bytes) -> str: + return base64.urlsafe_b64encode(raw).rstrip(b"=").decode() diff --git a/src/gumloop/resources/__init__.py b/src/gumloop/resources/__init__.py index 6dd0b3c..2ca03a8 100644 --- a/src/gumloop/resources/__init__.py +++ b/src/gumloop/resources/__init__.py @@ -16,6 +16,8 @@ from gumloop.resources.decisions import Decisions from gumloop.resources.evaluations import AsyncEvaluations from gumloop.resources.evaluations import Evaluations +from gumloop.resources.linked_proxies import AsyncLinkedProxies +from gumloop.resources.linked_proxies import LinkedProxies from gumloop.resources.mcp import MCP from gumloop.resources.mcp import AsyncMCP from gumloop.resources.organizations import AsyncOrganizations @@ -39,6 +41,7 @@ "AsyncAgents", "AsyncArtifacts", "AsyncBrain", + "AsyncLinkedProxies", "AsyncBrowserProfiles", "AsyncChat", "AsyncDecisions", @@ -50,6 +53,7 @@ "AsyncSkills", "AsyncTeams", "Brain", + "LinkedProxies", "BrowserProfiles", "Chat", "Decisions", diff --git a/src/gumloop/resources/linked_proxies.py b/src/gumloop/resources/linked_proxies.py new file mode 100644 index 0000000..5a8f723 --- /dev/null +++ b/src/gumloop/resources/linked_proxies.py @@ -0,0 +1,59 @@ +from __future__ import annotations + +from urllib.parse import quote + +from gumloop._http import AsyncHttpClient +from gumloop._http import HttpClient +from gumloop.types import CliLinkedProxyRegisterRequest +from gumloop.types import CliLinkedProxyRegistration +from gumloop.types import LinkedProxyGatewayToken + + +class LinkedProxies: + def __init__(self, client: HttpClient) -> None: + self._client = client + + def register_cli( + self, *, name: str, public_key: str, machine_name: str, cli_version: str + ) -> CliLinkedProxyRegistration: + """Registering a key the caller already registered returns that linked proxy unchanged.""" + body = CliLinkedProxyRegisterRequest( + name=name, public_key=public_key, machine_name=machine_name, cli_version=cli_version + ).model_dump() + return CliLinkedProxyRegistration.model_validate( + self._client.post("linked-proxies/cli", json=body, scoped=False) + ) + + def create_gateway_token(self, linked_proxy_id: str) -> LinkedProxyGatewayToken: + """The token a CLI linked proxy signs in to the linked proxy gateway with.""" + return LinkedProxyGatewayToken.model_validate( + self._client.post(f"linked-proxies/{quote(linked_proxy_id, safe='')}/gateway-token", scoped=False) + ) + + def delete(self, linked_proxy_id: str) -> None: + self._client.delete(f"linked-proxies/{quote(linked_proxy_id, safe='')}", scoped=False) + + +class AsyncLinkedProxies: + def __init__(self, client: AsyncHttpClient) -> None: + self._client = client + + async def register_cli( + self, *, name: str, public_key: str, machine_name: str, cli_version: str + ) -> CliLinkedProxyRegistration: + """Registering a key the caller already registered returns that linked proxy unchanged.""" + body = CliLinkedProxyRegisterRequest( + name=name, public_key=public_key, machine_name=machine_name, cli_version=cli_version + ).model_dump() + return CliLinkedProxyRegistration.model_validate( + await self._client.post("linked-proxies/cli", json=body, scoped=False) + ) + + async def create_gateway_token(self, linked_proxy_id: str) -> LinkedProxyGatewayToken: + """The token a CLI linked proxy signs in to the linked proxy gateway with.""" + return LinkedProxyGatewayToken.model_validate( + await self._client.post(f"linked-proxies/{quote(linked_proxy_id, safe='')}/gateway-token", scoped=False) + ) + + async def delete(self, linked_proxy_id: str) -> None: + await self._client.delete(f"linked-proxies/{quote(linked_proxy_id, safe='')}", scoped=False) diff --git a/src/gumloop/types.py b/src/gumloop/types.py index 62c48de..f7174ed 100644 --- a/src/gumloop/types.py +++ b/src/gumloop/types.py @@ -795,6 +795,35 @@ class BrowserProfileDeleteResponse(_Model): status: Literal["success"] +class LinkedProxy(_Model): + """A machine the agent browser can exit through. Each ``kind`` ("cli", + "tailscale") adds its own fields.""" + + id: str + name: str + kind: str + is_default: bool = False + + +class CliLinkedProxyRegisterRequest(_Model): + name: str = Field(min_length=1, max_length=100, pattern=r"\S") + # The linked proxy key's raw Ed25519 public key, in unpadded base64url. + public_key: str = Field(min_length=1, max_length=64) + machine_name: str = Field(min_length=1, max_length=255, pattern=r"\S") + cli_version: str = Field(min_length=1, max_length=50) + + +class CliLinkedProxyRegistration(_Model): + linked_proxy: LinkedProxy + # The linked proxy gateway's WebSocket. Sign-in tokens name it as their audience. + gateway_url: str + + +class LinkedProxyGatewayToken(_Model): + # Opaque to the CLI, which puts it in its sign-in tokens. It expires after an hour. + gateway_token: str + + MAX_SDP_OFFER_BYTES = 1024 * 1024 diff --git a/tests/cli/test_linked_proxy_key.py b/tests/cli/test_linked_proxy_key.py new file mode 100644 index 0000000..b15bd41 --- /dev/null +++ b/tests/cli/test_linked_proxy_key.py @@ -0,0 +1,40 @@ +from __future__ import annotations + +import pytest +from pydantic import ValidationError + +from gumloop.cli.linked_proxy_key import LinkedProxyRegistration +from gumloop.cli.linked_proxy_key import load_or_create_key +from gumloop.cli.linked_proxy_key import load_registration +from gumloop.cli.linked_proxy_key import save_registration +from gumloop.linked_proxy.sign_in import public_key_text + + +def test_key_and_registration_persist(temporary_home): + host = "api.gumloop.com" + registration = LinkedProxyRegistration( + linked_proxy_id="dp-1", gateway_url="wss://linked-proxy-gateway.gumloop.com/v1/cli/connect" + ) + + first = public_key_text(load_or_create_key(host)) + save_registration(host, registration) + + assert public_key_text(load_or_create_key(host)) == first + assert load_registration(host) == registration + + +@pytest.mark.parametrize( + "gateway_url", + ["wss://linked-proxy-gateway.gumloop.com/v1/cli/connect", "ws://localhost:8443/v1/cli/connect"], +) +def test_registration_accepts_an_encrypted_or_local_gateway(gateway_url): + registration = LinkedProxyRegistration(linked_proxy_id="dp-1", gateway_url=gateway_url) + + assert registration.gateway_url == gateway_url + + +def test_registration_refuses_an_unencrypted_remote_gateway(): + with pytest.raises(ValidationError): + LinkedProxyRegistration( + linked_proxy_id="dp-1", gateway_url="ws://linked-proxy-gateway.gumloop.com/v1/cli/connect" + ) diff --git a/tests/linked_proxy/test_connection.py b/tests/linked_proxy/test_connection.py new file mode 100644 index 0000000..cf8e332 --- /dev/null +++ b/tests/linked_proxy/test_connection.py @@ -0,0 +1,174 @@ +from __future__ import annotations + +import asyncio +import base64 +import contextlib +import json +from collections.abc import AsyncIterator +from collections.abc import Callable +from dataclasses import dataclass + +import pytest +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey +from websockets.datastructures import Headers +from websockets.exceptions import ConnectionClosed +from websockets.exceptions import InvalidStatus +from websockets.frames import Close +from websockets.http11 import Response + +from gumloop.linked_proxy.connection import ERROR_HEADER +from gumloop.linked_proxy.connection import FIRST_RETRY_SECONDS +from gumloop.linked_proxy.connection import GatewayConnection +from gumloop.linked_proxy.connection import GatewayTokenUnavailable +from gumloop.linked_proxy.connection import SignedOut +from gumloop.linked_proxy.connection import SignInRefused + +GATEWAY_URL = "wss://linked-proxy-gateway.gumloop.com/v1/cli/connect" + + +@dataclass(frozen=True) +class Outcome: + """How one connect attempt ends: ``error`` is raised while opening the + WebSocket, or by its first ``recv`` when ``opened``.""" + + error: BaseException + opened: bool = False + + +class FailingConnection: + def __init__(self, error: BaseException) -> None: + self._error = error + + async def send(self, message: bytes) -> None: + pass + + async def recv(self) -> bytes: + raise self._error + + +class ScriptedGateway: + def __init__(self, outcomes: list[Outcome]) -> None: + self._outcomes = outcomes + self.authorizations: list[str] = [] + self.waits: list[float] = [] + + @contextlib.asynccontextmanager + async def open(self, url: str, headers: dict[str, str]) -> AsyncIterator[FailingConnection]: + self.authorizations.append(headers["Authorization"]) + outcome = self._outcomes.pop(0) + if not outcome.opened: + raise outcome.error + yield FailingConnection(outcome.error) + + async def sleep(self, seconds: float) -> None: + self.waits.append(seconds) + + +def _refused_handshake(status: int, outcome: str) -> InvalidStatus: + return InvalidStatus(Response(status, "", Headers({ERROR_HEADER: outcome}))) + + +def _gateway_token_claim(authorization: str) -> str: + claims = authorization.removeprefix("Bearer ").split(".")[1] + return json.loads(base64.urlsafe_b64decode(claims + "=" * (-len(claims) % 4)))["gateway_token"] + + +def _run( + gateway: ScriptedGateway, + signed_in_checks: list[bool], + gateway_token: Callable[[], str] = lambda: "token-1", +) -> None: + connection = GatewayConnection( + gateway_url=GATEWAY_URL, + linked_proxy_id="dp-1", + key=Ed25519PrivateKey.generate(), + signed_in=lambda: signed_in_checks.pop(0), + gateway_token=gateway_token, + open_websocket=gateway.open, + sleep=gateway.sleep, + ) + asyncio.run(connection.run()) + + +@pytest.mark.parametrize( + ("outcome", "reason"), + [ + (Outcome(ConnectionClosed(Close(4001, "not_a_member"), None), opened=True), "not_a_member"), + (Outcome(_refused_handshake(401, "sign_in_refused")), "sign_in_refused"), + ], +) +def test_refused_sign_in_stops_without_reconnecting(outcome, reason): + gateway = ScriptedGateway([outcome]) + + with pytest.raises(SignInRefused) as refused: + _run(gateway, [True]) + + assert refused.value.reason == reason + assert gateway.waits == [] + + +def test_other_failures_reconnect_with_a_growing_wait_until_signed_out(): + gateway = ScriptedGateway( + [ + Outcome(ConnectionClosed(Close(4002, "already_connected"), None), opened=True), + Outcome(OSError("unreachable")), + ] + ) + + with pytest.raises(SignedOut): + _run(gateway, [True, True, False]) + + assert len(gateway.waits) == 2 + for wait, cap in zip(gateway.waits, [1.0, 2.0]): + assert FIRST_RETRY_SECONDS <= wait <= cap + assert len(set(gateway.authorizations)) == 2 + + +@pytest.mark.parametrize( + "refused_token", + [ + Outcome(ConnectionClosed(Close(4004, "bad_token"), None), opened=True), + Outcome(_refused_handshake(401, "gateway_token_refused")), + ], +) +def test_a_refused_gateway_token_reconnects_with_a_fresh_one(refused_token): + gateway = ScriptedGateway([refused_token, Outcome(OSError("unreachable"))]) + tokens = iter(["token-1", "token-2"]) + + with pytest.raises(SignedOut): + _run(gateway, [True, True, False], gateway_token=lambda: next(tokens)) + + assert [_gateway_token_claim(authorization) for authorization in gateway.authorizations] == ["token-1", "token-2"] + + +def test_a_gateway_token_gumloop_did_not_give_is_retried_before_connecting(): + gateway = ScriptedGateway([Outcome(OSError("unreachable"))]) + tokens: list[str | Exception] = [ + GatewayTokenUnavailable("Gumloop didn't give a gateway token (HTTP 503)"), + "token-1", + ] + + def gateway_token() -> str: + result = tokens.pop(0) + if isinstance(result, Exception): + raise result + return result + + with pytest.raises(SignedOut): + _run(gateway, [True, True, False], gateway_token=gateway_token) + + assert len(gateway.waits) == 2 + assert [_gateway_token_claim(authorization) for authorization in gateway.authorizations] == ["token-1"] + + +def test_a_gateway_token_refused_by_gumloop_stops_without_connecting(): + gateway = ScriptedGateway([]) + + def gateway_token() -> str: + raise SignInRefused("removed") + + with pytest.raises(SignInRefused): + _run(gateway, [True], gateway_token=gateway_token) + + assert gateway.authorizations == [] + assert gateway.waits == [] diff --git a/tests/linked_proxy/test_sign_in.py b/tests/linked_proxy/test_sign_in.py new file mode 100644 index 0000000..53fb02a --- /dev/null +++ b/tests/linked_proxy/test_sign_in.py @@ -0,0 +1,37 @@ +from __future__ import annotations + +import base64 +import json + +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey + +from gumloop.linked_proxy.sign_in import public_key_text +from gumloop.linked_proxy.sign_in import sign_in_token + +AUDIENCE = "wss://linked-proxy-gateway.gumloop.com/v1/cli/connect" + + +def _decode(segment: str) -> bytes: + return base64.urlsafe_b64decode(segment + "=" * (-len(segment) % 4)) + + +def test_token_is_signed_by_the_registered_key_for_one_minute_and_carries_the_gateway_token(): + key = Ed25519PrivateKey.generate() + public_key = Ed25519PublicKey.from_public_bytes(_decode(public_key_text(key))) + + token = sign_in_token(key, linked_proxy_id="dp-1", audience=AUDIENCE, gateway_token="token-1", now=1_800_000_000) + other = sign_in_token(key, linked_proxy_id="dp-1", audience=AUDIENCE, gateway_token="token-1", now=1_800_000_000) + + header, claims, signature = token.split(".") + public_key.verify(_decode(signature), f"{header}.{claims}".encode()) + assert json.loads(_decode(header))["alg"] == "EdDSA" + decoded = json.loads(_decode(claims)) + assert {name: decoded[name] for name in ("sub", "aud", "iat", "exp", "gateway_token")} == { + "sub": "dp-1", + "aud": AUDIENCE, + "iat": 1_800_000_000, + "exp": 1_800_000_060, + "gateway_token": "token-1", + } + assert decoded["jti"] != json.loads(_decode(other.split(".")[1]))["jti"] diff --git a/tests/sdk/test_linked_proxies.py b/tests/sdk/test_linked_proxies.py new file mode 100644 index 0000000..935a1c8 --- /dev/null +++ b/tests/sdk/test_linked_proxies.py @@ -0,0 +1,56 @@ +from __future__ import annotations + +import asyncio +import json + +import pytest +import respx + +from gumloop import AsyncGumloop +from gumloop import Gumloop +from tests.sdk.helpers import API_BASE + +REGISTRATION = { + "linked_proxy": {"id": "dp-1", "name": "Ada's laptop", "kind": "cli", "is_default": True}, + "gateway_url": "wss://linked-proxy-gateway.gumloop.com/v1/cli/connect", +} +REGISTER_ARGS = { + "name": "Ada's laptop", + "public_key": "MCowBQYDK2VwAyEA", + "machine_name": "Ada's MacBook Pro", + "cli_version": "0.6.0", +} +OPERATIONS = [ + ("register_cli", (), REGISTER_ARGS, "POST", "linked-proxies/cli", 201, REGISTRATION), + ( + "create_gateway_token", + ("dp-1",), + {}, + "POST", + "linked-proxies/dp-1/gateway-token", + 200, + {"gateway_token": "t"}, + ), + ("delete", ("dp-1",), {}, "DELETE", "linked-proxies/dp-1", 204, None), +] + + +@pytest.mark.parametrize(("operation", "args", "kwargs", "method", "path", "status", "payload"), OPERATIONS) +@pytest.mark.parametrize("asynchronous", [False, True]) +@respx.mock +def test_linked_proxy_operations(operation, args, kwargs, method, path, status, payload, asynchronous): + route = respx.request(method, f"{API_BASE}/{path}").respond(status, json=payload) + + async def run(): + async with AsyncGumloop(api_key="key", user_id="actor") as client: + return await getattr(client.linked_proxies, operation)(*args, **kwargs) + + if asynchronous: + response = asyncio.run(run()) + else: + with Gumloop(api_key="key", user_id="actor") as client: + response = getattr(client.linked_proxies, operation)(*args, **kwargs) + + assert (response.model_dump() if response is not None else None) == payload + request = route.calls[0].request + assert (json.loads(request.content) if request.content else None) == (kwargs or None) diff --git a/uv.lock b/uv.lock index c36e263..1284dfc 100644 --- a/uv.lock +++ b/uv.lock @@ -1,11 +1,15 @@ version = 1 -revision = 3 +revision = 5 requires-python = ">=3.10" +resolution-markers = [ + "python_full_version >= '3.11'", + "python_full_version < '3.11'", +] [[package]] name = "annotated-doc" version = "0.0.4" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz", hash = "sha256:fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4", size = 7288, upload-time = "2025-11-10T22:07:42.062Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/1e/d3/26bf1008eb3d2daa8ef4cacc7f3bfdc11818d111f7e2d0201bc6e3b49d45/annotated_doc-0.0.4-py3-none-any.whl", hash = "sha256:571ac1dc6991c450b25a9c2d84a3705e2ae7a53467b5d111c24fa8baabbed320", size = 5303, upload-time = "2025-11-10T22:07:40.673Z" }, @@ -14,7 +18,7 @@ wheels = [ [[package]] name = "annotated-types" version = "0.7.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89", size = 16081, upload-time = "2024-05-20T21:33:25.928Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/78/b6/6307fbef88d9b5ee7421e68d78a9f162e0da4900bc5f5793f6d3d0e34fb8/annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53", size = 13643, upload-time = "2024-05-20T21:33:24.1Z" }, @@ -23,7 +27,7 @@ wheels = [ [[package]] name = "anyio" version = "4.13.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, { name = "idna" }, @@ -37,7 +41,7 @@ wheels = [ [[package]] name = "backports-tarfile" version = "1.2.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/86/72/cd9b395f25e290e633655a100af28cb253e4393396264a98bd5f5951d50f/backports_tarfile-1.2.0.tar.gz", hash = "sha256:d75e02c268746e1b8144c278978b6e98e85de6ad16f8e4b0844a154557eca991", size = 86406, upload-time = "2024-05-28T17:01:54.731Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/b9/fa/123043af240e49752f1c4bd24da5053b6bd00cad78c2be53c0d1e8b975bc/backports.tarfile-1.2.0-py3-none-any.whl", hash = "sha256:77e284d754527b01fb1e6fa8a1afe577858ebe4e9dad8919e34c862cb399bc34", size = 30181, upload-time = "2024-05-28T17:01:53.112Z" }, @@ -46,7 +50,7 @@ wheels = [ [[package]] name = "build" version = "1.4.4" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama", marker = "os_name == 'nt'" }, { name = "importlib-metadata", marker = "python_full_version < '3.10.2'" }, @@ -62,7 +66,7 @@ wheels = [ [[package]] name = "certifi" version = "2026.10.19" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/a6/bd/1436c50cc46699de0230fbaacc1d1de7bfec413176099949e9d5112e88f2/certifi-2026.10.19.tar.gz", hash = "sha256:035c1e85572b141bf1c3a3eff0e33a8eb74917522f2559075ff8d2fea780a1ae", size = 137598, upload-time = "2026-10-20T02:24:16.604Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/c4/51/29046e48f693c54e5b7412216d447a1d8362c9653148d98c02cdf65fa733/certifi-2026.10.19-py3-none-any.whl", hash = "sha256:42d35340cc5b9ba78e818ddbff0c5b1c2b779de448a340fd1b989f5fa8670e1b", size = 136464, upload-time = "2026-10-20T02:24:15.072Z" }, @@ -71,7 +75,7 @@ wheels = [ [[package]] name = "cffi" version = "2.0.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pycparser", marker = "implementation_name != 'PyPy'" }, ] @@ -153,7 +157,7 @@ wheels = [ [[package]] name = "cfgv" version = "3.5.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/4e/b5/721b8799b04bf9afe054a3899c6cf4e880fcf8563cc71c15610242490a0c/cfgv-3.5.0.tar.gz", hash = "sha256:d5b1034354820651caa73ede66a6294d6e95c1b00acc5e9b098e917404669132", size = 7334, upload-time = "2025-11-19T20:55:51.612Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/db/3c/33bac158f8ab7f89b2e59426d5fe2e4f63f7ed25df84c036890172b412b5/cfgv-3.5.0-py2.py3-none-any.whl", hash = "sha256:a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0", size = 7445, upload-time = "2025-11-19T20:55:50.744Z" }, @@ -162,7 +166,7 @@ wheels = [ [[package]] name = "charset-normalizer" version = "3.4.7" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/e7/a1/67fe25fac3c7642725500a3f6cfe5821ad557c3abb11c9d20d12c7008d3e/charset_normalizer-3.4.7.tar.gz", hash = "sha256:ae89db9e5f98a11a4bf50407d4363e7b09b31e55bc117b4f7d80aab97ba009e5", size = 144271, upload-time = "2026-04-02T09:28:39.342Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/26/08/0f303cb0b529e456bb116f2d50565a482694fbb94340bf56d44677e7ed03/charset_normalizer-3.4.7-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cdd68a1fb318e290a2077696b7eb7a21a49163c455979c639bf5a5dcdc46617d", size = 315182, upload-time = "2026-04-02T09:25:40.673Z" }, @@ -267,7 +271,7 @@ wheels = [ [[package]] name = "click" version = "8.3.3" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama", marker = "sys_platform == 'win32'" }, ] @@ -279,7 +283,7 @@ wheels = [ [[package]] name = "colorama" version = "0.4.6" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, @@ -288,7 +292,7 @@ wheels = [ [[package]] name = "cryptography" version = "47.0.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, { name = "typing-extensions", marker = "python_full_version < '3.11'" }, @@ -348,7 +352,7 @@ wheels = [ [[package]] name = "distlib" version = "0.4.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/96/8e/709914eb2b5749865801041647dc7f4e6d00b549cfe88b65ca192995f07c/distlib-0.4.0.tar.gz", hash = "sha256:feec40075be03a04501a973d81f633735b4b69f98b05450592310c0f401a4e0d", size = 614605, upload-time = "2025-07-17T16:52:00.465Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/33/6b/e0547afaf41bf2c42e52430072fa5658766e3d65bd4b03a563d1b6336f57/distlib-0.4.0-py2.py3-none-any.whl", hash = "sha256:9659f7d87e46584a30b5780e43ac7a2143098441670ff0a49d5f9034c54a6c16", size = 469047, upload-time = "2025-07-17T16:51:58.613Z" }, @@ -357,7 +361,7 @@ wheels = [ [[package]] name = "docutils" version = "0.22.4" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/ae/b6/03bb70946330e88ffec97aefd3ea75ba575cb2e762061e0e62a213befee8/docutils-0.22.4.tar.gz", hash = "sha256:4db53b1fde9abecbb74d91230d32ab626d94f6badfc575d6db9194a49df29968", size = 2291750, upload-time = "2025-12-18T19:00:26.443Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/02/10/5da547df7a391dcde17f59520a231527b8571e6f46fc8efb02ccb370ab12/docutils-0.22.4-py3-none-any.whl", hash = "sha256:d0013f540772d1420576855455d050a2180186c91c15779301ac2ccb3eeb68de", size = 633196, upload-time = "2025-12-18T19:00:18.077Z" }, @@ -366,9 +370,9 @@ wheels = [ [[package]] name = "exceptiongroup" version = "1.3.1" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "typing-extensions" }, ] sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } wheels = [ @@ -378,7 +382,7 @@ wheels = [ [[package]] name = "execnet" version = "2.1.2" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/bf/89/780e11f9588d9e7128a3f87788354c7946a9cbb1401ad38a48c4db9a4f07/execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd", size = 166622, upload-time = "2025-11-12T09:56:37.75Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/ab/84/02fc1827e8cdded4aa65baef11296a9bbe595c474f0d6d758af082d849fd/execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec", size = 40708, upload-time = "2025-11-12T09:56:36.333Z" }, @@ -387,7 +391,7 @@ wheels = [ [[package]] name = "filelock" version = "3.29.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/b5/fe/997687a931ab51049acce6fa1f23e8f01216374ea81374ddee763c493db5/filelock-3.29.0.tar.gz", hash = "sha256:69974355e960702e789734cb4871f884ea6fe50bd8404051a3530bc07809cf90", size = 57571, upload-time = "2026-04-19T15:39:10.068Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/81/47/dd9a212ef6e343a6857485ffe25bba537304f1913bdbed446a23f7f592e1/filelock-3.29.0-py3-none-any.whl", hash = "sha256:96f5f6344709aa1572bbf631c640e4ebeeb519e08da902c39a001882f30ac258", size = 39812, upload-time = "2026-04-19T15:39:08.752Z" }, @@ -397,6 +401,7 @@ wheels = [ name = "gumloop" source = { editable = "." } dependencies = [ + { name = "certifi" }, { name = "click" }, { name = "cryptography" }, { name = "httpx" }, @@ -407,6 +412,8 @@ dependencies = [ { name = "questionary" }, { name = "rich" }, { name = "typer" }, + { name = "websockets", version = "16.1.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "websockets", version = "17.4", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, ] [package.dev-dependencies] @@ -428,6 +435,7 @@ dev = [ [package.metadata] requires-dist = [ + { name = "certifi", specifier = ">=2024.2.2" }, { name = "click", specifier = ">=8.0" }, { name = "cryptography", specifier = ">=42.0.0" }, { name = "httpx", specifier = ">=0.24.1" }, @@ -438,6 +446,7 @@ requires-dist = [ { name = "questionary", specifier = ">=2.0" }, { name = "rich" }, { name = "typer", specifier = ">=0.25.1,<0.30" }, + { name = "websockets", specifier = ">=14" }, ] [package.metadata.requires-dev] @@ -460,7 +469,7 @@ dev = [ [[package]] name = "h11" version = "0.16.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz", hash = "sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1", size = 101250, upload-time = "2025-04-24T03:35:25.427Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl", hash = "sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86", size = 37515, upload-time = "2025-04-24T03:35:24.344Z" }, @@ -469,7 +478,7 @@ wheels = [ [[package]] name = "hatchling" version = "1.29.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "packaging" }, { name = "pathspec" }, @@ -485,7 +494,7 @@ wheels = [ [[package]] name = "httpcore" version = "1.0.9" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "certifi" }, { name = "h11" }, @@ -498,7 +507,7 @@ wheels = [ [[package]] name = "httpx" version = "0.28.1" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, { name = "certifi" }, @@ -513,7 +522,7 @@ wheels = [ [[package]] name = "httpx-sse" version = "0.4.3" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/0f/4c/751061ffa58615a32c31b2d82e8482be8dd4a89154f003147acee90f2be9/httpx_sse-0.4.3.tar.gz", hash = "sha256:9b1ed0127459a66014aec3c56bebd93da3c1bc8bb6618c8082039a44889a755d", size = 15943, upload-time = "2025-10-10T21:48:22.271Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/d2/fd/6668e5aec43ab844de6fc74927e155a3b37bf40d7c3790e49fc0406b6578/httpx_sse-0.4.3-py3-none-any.whl", hash = "sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc", size = 8960, upload-time = "2025-10-10T21:48:21.158Z" }, @@ -522,7 +531,7 @@ wheels = [ [[package]] name = "id" version = "1.6.1" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "urllib3" }, ] @@ -534,7 +543,7 @@ wheels = [ [[package]] name = "identify" version = "2.6.19" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/52/63/51723b5f116cc04b061cb6f5a561790abf249d25931d515cd375e063e0f4/identify-2.6.19.tar.gz", hash = "sha256:6be5020c38fcb07da56c53733538a3081ea5aa70d36a156f83044bfbf9173842", size = 99567, upload-time = "2026-04-17T18:39:50.265Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/94/84/d9273cd09688070a6523c4aee4663a8538721b2b755c4962aafae0011e72/identify-2.6.19-py2.py3-none-any.whl", hash = "sha256:20e6a87f786f768c092a721ad107fc9df0eb89347be9396cadf3f4abbd1fb78a", size = 99397, upload-time = "2026-04-17T18:39:49.221Z" }, @@ -543,7 +552,7 @@ wheels = [ [[package]] name = "idna" version = "3.13" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/ce/cc/762dfb036166873f0059f3b7de4565e1b5bc3d6f28a414c13da27e442f99/idna-3.13.tar.gz", hash = "sha256:585ea8fe5d69b9181ec1afba340451fba6ba764af97026f92a91d4eef164a242", size = 194210, upload-time = "2026-04-22T16:42:42.314Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/5d/13/ad7d7ca3808a898b4612b6fe93cde56b53f3034dcde235acb1f0e1df24c6/idna-3.13-py3-none-any.whl", hash = "sha256:892ea0cde124a99ce773decba204c5552b69c3c67ffd5f232eb7696135bc8bb3", size = 68629, upload-time = "2026-04-22T16:42:40.909Z" }, @@ -552,7 +561,7 @@ wheels = [ [[package]] name = "importlib-metadata" version = "9.0.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "zipp" }, ] @@ -564,7 +573,7 @@ wheels = [ [[package]] name = "iniconfig" version = "2.3.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, @@ -573,7 +582,7 @@ wheels = [ [[package]] name = "jaraco-classes" version = "3.4.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "more-itertools" }, ] @@ -585,7 +594,7 @@ wheels = [ [[package]] name = "jaraco-context" version = "6.1.2" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "backports-tarfile", marker = "python_full_version < '3.12'" }, ] @@ -597,7 +606,7 @@ wheels = [ [[package]] name = "jaraco-functools" version = "4.4.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "more-itertools" }, ] @@ -609,7 +618,7 @@ wheels = [ [[package]] name = "jeepney" version = "0.9.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/7b/6f/357efd7602486741aa73ffc0617fb310a29b588ed0fd69c2399acbb85b0c/jeepney-0.9.0.tar.gz", hash = "sha256:cf0e9e845622b81e4a28df94c40345400256ec608d0e55bb8a3feaa9163f5732", size = 106758, upload-time = "2025-02-27T18:51:01.684Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/b2/a3/e137168c9c44d18eff0376253da9f1e9234d0239e0ee230d2fee6cea8e55/jeepney-0.9.0-py3-none-any.whl", hash = "sha256:97e5714520c16fc0a45695e5365a2e11b81ea79bba796e26f9f1d178cb182683", size = 49010, upload-time = "2025-02-27T18:51:00.104Z" }, @@ -618,7 +627,7 @@ wheels = [ [[package]] name = "jsonpath-python" version = "1.1.6" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/98/18/4ca8742534a5993ff383f7602e325ce2d5d7cc93d72ac5e1cdedbea8a458/jsonpath_python-1.1.6.tar.gz", hash = "sha256:dded9932b4ec41fb8726e09c83afa4e6be618f938c2db287cc2a81723c639671", size = 88178, upload-time = "2026-05-07T01:26:34.482Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/55/8a/1270a6803bd821cbfcdda387eaa13cb41a7b1f7b9bd145979b3bfb9d6cb7/jsonpath_python-1.1.6-py3-none-any.whl", hash = "sha256:a1c50afd8d3fbbaf47a4873bc890dcb3c15da96f5c020327977d844d8731a2d4", size = 14453, upload-time = "2026-05-07T01:26:33.306Z" }, @@ -627,7 +636,7 @@ wheels = [ [[package]] name = "keyring" version = "25.7.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "importlib-metadata", marker = "python_full_version < '3.12'" }, { name = "jaraco-classes" }, @@ -645,7 +654,7 @@ wheels = [ [[package]] name = "markdown-it-py" version = "4.0.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "mdurl" }, ] @@ -657,7 +666,7 @@ wheels = [ [[package]] name = "mdurl" version = "0.1.2" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, @@ -666,7 +675,7 @@ wheels = [ [[package]] name = "more-itertools" version = "11.0.2" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/a2/f7/139d22fef48ac78127d18e01d80cf1be40236ae489769d17f35c3d425293/more_itertools-11.0.2.tar.gz", hash = "sha256:392a9e1e362cbc106a2457d37cabf9b36e5e12efd4ebff1654630e76597df804", size = 144659, upload-time = "2026-04-09T15:01:33.297Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/cb/98/6af411189d9413534c3eb691182bff1f5c6d44ed2f93f2edfe52a1bbceb8/more_itertools-11.0.2-py3-none-any.whl", hash = "sha256:6e35b35f818b01f691643c6c611bc0902f2e92b46c18fffa77ae1e7c46e912e4", size = 71939, upload-time = "2026-04-09T15:01:32.21Z" }, @@ -675,7 +684,7 @@ wheels = [ [[package]] name = "nh3" version = "0.3.5" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/9c/5f/1d19bdc7d27238e37f3672cdc02cb77c56a4a86d140cd4f4f23c90df6e16/nh3-0.3.5.tar.gz", hash = "sha256:45855e14ff056064fec77133bfcf7cd691838168e5e17bbef075394954dc9dc8", size = 20743, upload-time = "2026-04-25T10:44:16.066Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/63/b0/8587ac42a9627ab88e7e221601f1dfccbf4db80b2a29222ea63266dc9abc/nh3-0.3.5-cp314-cp314t-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl", hash = "sha256:23a312224875f72cd16bde417f49071451877e29ef646a60e50fcb69407cc18a", size = 1420126, upload-time = "2026-04-25T10:43:39.834Z" }, @@ -709,7 +718,7 @@ wheels = [ [[package]] name = "nodeenv" version = "1.10.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, @@ -718,7 +727,7 @@ wheels = [ [[package]] name = "openrouter" version = "0.9.1" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "httpcore" }, { name = "httpx" }, @@ -733,7 +742,7 @@ wheels = [ [[package]] name = "packaging" version = "26.2" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", size = 228134, upload-time = "2026-04-24T20:15:23.917Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" }, @@ -742,7 +751,7 @@ wheels = [ [[package]] name = "pathspec" version = "1.1.1" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/5a/82/42f767fc1c1143d6fd36efb827202a2d997a375e160a71eb2888a925aac1/pathspec-1.1.1.tar.gz", hash = "sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a", size = 135180, upload-time = "2026-04-27T01:46:08.907Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/f1/d9/7fb5aa316bc299258e68c73ba3bddbc499654a07f151cba08f6153988714/pathspec-1.1.1-py3-none-any.whl", hash = "sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189", size = 57328, upload-time = "2026-04-27T01:46:07.06Z" }, @@ -751,7 +760,7 @@ wheels = [ [[package]] name = "platformdirs" version = "4.9.6" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/9f/4a/0883b8e3802965322523f0b200ecf33d31f10991d0401162f4b23c698b42/platformdirs-4.9.6.tar.gz", hash = "sha256:3bfa75b0ad0db84096ae777218481852c0ebc6c727b3168c1b9e0118e458cf0a", size = 29400, upload-time = "2026-04-09T00:04:10.812Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/75/a6/a0a304dc33b49145b21f4808d763822111e67d1c3a32b524a1baf947b6e1/platformdirs-4.9.6-py3-none-any.whl", hash = "sha256:e61adb1d5e5cb3441b4b7710bea7e4c12250ca49439228cc1021c00dcfac0917", size = 21348, upload-time = "2026-04-09T00:04:09.463Z" }, @@ -760,7 +769,7 @@ wheels = [ [[package]] name = "pluggy" version = "1.6.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, @@ -769,7 +778,7 @@ wheels = [ [[package]] name = "pre-commit" version = "4.6.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cfgv" }, { name = "identify" }, @@ -785,7 +794,7 @@ wheels = [ [[package]] name = "prompt-toolkit" version = "3.0.52" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "wcwidth" }, ] @@ -797,7 +806,7 @@ wheels = [ [[package]] name = "pycparser" version = "3.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/1b/7d/92392ff7815c21062bea51aa7b87d45576f649f16458d78b7cf94b9ab2e6/pycparser-3.0.tar.gz", hash = "sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29", size = 103492, upload-time = "2026-01-21T14:26:51.89Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/0c/c3/44f3fbbfa403ea2a7c779186dc20772604442dde72947e7d01069cbe98e3/pycparser-3.0-py3-none-any.whl", hash = "sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992", size = 48172, upload-time = "2026-01-21T14:26:50.693Z" }, @@ -806,7 +815,7 @@ wheels = [ [[package]] name = "pydantic" version = "2.13.4" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "annotated-types" }, { name = "pydantic-core" }, @@ -821,7 +830,7 @@ wheels = [ [[package]] name = "pydantic-core" version = "2.46.4" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions" }, ] @@ -937,7 +946,7 @@ wheels = [ [[package]] name = "pygments" version = "2.20.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz", hash = "sha256:6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f", size = 4955991, upload-time = "2026-03-29T13:29:33.898Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/f4/7e/a72dd26f3b0f4f2bf1dd8923c85f7ceb43172af56d63c7383eb62b332364/pygments-2.20.0-py3-none-any.whl", hash = "sha256:81a9e26dd42fd28a23a2d169d86d7ac03b46e2f8b59ed4698fb4785f946d0176", size = 1231151, upload-time = "2026-03-29T13:29:30.038Z" }, @@ -946,7 +955,7 @@ wheels = [ [[package]] name = "pyproject-hooks" version = "1.2.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/e7/82/28175b2414effca1cdac8dc99f76d660e7a4fb0ceefa4b4ab8f5f6742925/pyproject_hooks-1.2.0.tar.gz", hash = "sha256:1e859bd5c40fae9448642dd871adf459e5e2084186e8d2c2a79a824c970da1f8", size = 19228, upload-time = "2024-09-29T09:24:13.293Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/bd/24/12818598c362d7f300f18e74db45963dbcb85150324092410c8b49405e42/pyproject_hooks-1.2.0-py3-none-any.whl", hash = "sha256:9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913", size = 10216, upload-time = "2024-09-29T09:24:11.978Z" }, @@ -955,7 +964,7 @@ wheels = [ [[package]] name = "pyright" version = "1.1.409" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "nodeenv" }, { name = "typing-extensions" }, @@ -968,7 +977,7 @@ wheels = [ [[package]] name = "pytest" version = "9.0.3" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "colorama", marker = "sys_platform == 'win32'" }, { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, @@ -986,7 +995,7 @@ wheels = [ [[package]] name = "pytest-timeout" version = "2.4.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "pytest" }, ] @@ -998,7 +1007,7 @@ wheels = [ [[package]] name = "pytest-xdist" version = "3.8.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "execnet" }, { name = "pytest" }, @@ -1011,7 +1020,7 @@ wheels = [ [[package]] name = "python-discovery" version = "1.2.2" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "filelock" }, { name = "platformdirs" }, @@ -1024,7 +1033,7 @@ wheels = [ [[package]] name = "python-dotenv" version = "1.2.2" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/82/ed/0301aeeac3e5353ef3d94b6ec08bbcabd04a72018415dcb29e588514bba8/python_dotenv-1.2.2.tar.gz", hash = "sha256:2c371a91fbd7ba082c2c1dc1f8bf89ca22564a087c2c287cd9b662adde799cf3", size = 50135, upload-time = "2026-03-01T16:00:26.196Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/0b/d7/1959b9648791274998a9c3526f6d0ec8fd2233e4d4acce81bbae76b44b2a/python_dotenv-1.2.2-py3-none-any.whl", hash = "sha256:1d8214789a24de455a8b8bd8ae6fe3c6b69a5e3d64aa8a8e5d68e694bbcb285a", size = 22101, upload-time = "2026-03-01T16:00:25.09Z" }, @@ -1033,7 +1042,7 @@ wheels = [ [[package]] name = "pywin32-ctypes" version = "0.2.3" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/85/9f/01a1a99704853cb63f253eea009390c88e7131c67e66a0a02099a8c917cb/pywin32-ctypes-0.2.3.tar.gz", hash = "sha256:d162dc04946d704503b2edc4d55f3dba5c1d539ead017afa00142c38b9885755", size = 29471, upload-time = "2024-08-14T10:15:34.626Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/de/3d/8161f7711c017e01ac9f008dfddd9410dff3674334c233bde66e7ba65bbf/pywin32_ctypes-0.2.3-py3-none-any.whl", hash = "sha256:8a1513379d709975552d202d942d9837758905c8d01eb82b8bcc30918929e7b8", size = 30756, upload-time = "2024-08-14T10:15:33.187Z" }, @@ -1042,7 +1051,7 @@ wheels = [ [[package]] name = "pyyaml" version = "6.0.3" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/f4/a0/39350dd17dd6d6c6507025c0e53aef67a9293a6d37d3511f23ea510d5800/pyyaml-6.0.3-cp310-cp310-macosx_10_13_x86_64.whl", hash = "sha256:214ed4befebe12df36bcc8bc2b64b396ca31be9304b8f59e25c11cf94a4c033b", size = 184227, upload-time = "2025-09-25T21:31:46.04Z" }, @@ -1106,7 +1115,7 @@ wheels = [ [[package]] name = "questionary" version = "2.1.1" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "prompt-toolkit" }, ] @@ -1118,7 +1127,7 @@ wheels = [ [[package]] name = "readme-renderer" version = "44.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "docutils" }, { name = "nh3" }, @@ -1132,7 +1141,7 @@ wheels = [ [[package]] name = "requests" version = "2.33.1" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "certifi" }, { name = "charset-normalizer" }, @@ -1147,7 +1156,7 @@ wheels = [ [[package]] name = "requests-toolbelt" version = "1.0.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "requests" }, ] @@ -1159,7 +1168,7 @@ wheels = [ [[package]] name = "respx" version = "0.23.1" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "httpx" }, ] @@ -1171,7 +1180,7 @@ wheels = [ [[package]] name = "rfc3986" version = "2.0.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/85/40/1520d68bfa07ab5a6f065a186815fb6610c86fe957bc065754e47f7b0840/rfc3986-2.0.0.tar.gz", hash = "sha256:97aacf9dbd4bfd829baad6e6309fa6573aaf1be3f6fa735c8ab05e46cecb261c", size = 49026, upload-time = "2022-01-10T00:52:30.832Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/ff/9a/9afaade874b2fa6c752c36f1548f718b5b83af81ed9b76628329dab81c1b/rfc3986-2.0.0-py2.py3-none-any.whl", hash = "sha256:50b1502b60e289cb37883f3dfd34532b8873c7de9f49bb546641ce9cbd256ebd", size = 31326, upload-time = "2022-01-10T00:52:29.594Z" }, @@ -1180,7 +1189,7 @@ wheels = [ [[package]] name = "rich" version = "15.0.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "markdown-it-py" }, { name = "pygments" }, @@ -1193,7 +1202,7 @@ wheels = [ [[package]] name = "ruff" version = "0.15.12" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/99/43/3291f1cc9106f4c63bdce7a8d0df5047fe8422a75b091c16b5e9355e0b11/ruff-0.15.12.tar.gz", hash = "sha256:ecea26adb26b4232c0c2ca19ccbc0083a68344180bba2a600605538ce51a40a6", size = 4643852, upload-time = "2026-04-24T18:17:14.305Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/c3/6e/e78ffb61d4686f3d96ba3df2c801161843746dcbcbb17a1e927d4829312b/ruff-0.15.12-py3-none-linux_armv6l.whl", hash = "sha256:f86f176e188e94d6bdbc09f09bfd9dc729059ad93d0e7390b5a73efe19f8861c", size = 10640713, upload-time = "2026-04-24T18:17:22.841Z" }, @@ -1218,7 +1227,7 @@ wheels = [ [[package]] name = "secretstorage" version = "3.5.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "cryptography" }, { name = "jeepney" }, @@ -1231,7 +1240,7 @@ wheels = [ [[package]] name = "shellingham" version = "1.5.4" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" }, @@ -1240,7 +1249,7 @@ wheels = [ [[package]] name = "tomli" version = "2.4.1" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/22/de/48c59722572767841493b26183a0d1cc411d54fd759c5607c4590b6563a6/tomli-2.4.1.tar.gz", hash = "sha256:7c7e1a961a0b2f2472c1ac5b69affa0ae1132c39adcb67aba98568702b9cc23f", size = 17543, upload-time = "2026-03-25T20:22:03.828Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/f4/11/db3d5885d8528263d8adc260bb2d28ebf1270b96e98f0e0268d32b8d9900/tomli-2.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:f8f0fc26ec2cc2b965b7a3b87cd19c5c6b8c5e5f436b984e85f486d652285c30", size = 154704, upload-time = "2026-03-25T20:21:10.473Z" }, @@ -1294,7 +1303,7 @@ wheels = [ [[package]] name = "trove-classifiers" version = "2026.4.28.13" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/04/af/88fdebf242bc7bc4957c96c5358a2b2b0f07e5001401906783a521ea9f54/trove_classifiers-2026.4.28.13.tar.gz", hash = "sha256:c85bb8a53c3de7330d1699b844ed9fb809a602a09ac15dc79ad6d1a509be0676", size = 17035, upload-time = "2026-04-28T13:45:41.495Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/d6/bb/fbdc4e57731efb86b4209ffdd2519520782bf27b3c961beac3e5c20d2b87/trove_classifiers-2026.4.28.13-py3-none-any.whl", hash = "sha256:8f4b1eb4e16296b57d612965444f87a83861cc989a0451ac97fe4265ddef03b8", size = 14216, upload-time = "2026-04-28T13:45:39.943Z" }, @@ -1303,7 +1312,7 @@ wheels = [ [[package]] name = "twine" version = "6.2.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "id" }, { name = "keyring", marker = "platform_machine != 'ppc64le' and platform_machine != 's390x'" }, @@ -1323,7 +1332,7 @@ wheels = [ [[package]] name = "typer" version = "0.29.1" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "annotated-doc" }, { name = "colorama", marker = "sys_platform == 'win32'" }, @@ -1339,7 +1348,7 @@ wheels = [ [[package]] name = "typing-extensions" version = "4.15.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz", hash = "sha256:0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466", size = 109391, upload-time = "2025-08-25T13:49:26.313Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" }, @@ -1348,7 +1357,7 @@ wheels = [ [[package]] name = "typing-inspection" version = "0.4.2" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "typing-extensions" }, ] @@ -1360,7 +1369,7 @@ wheels = [ [[package]] name = "urllib3" version = "2.6.3" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/c7/24/5f1b3bdffd70275f6661c76461e25f024d5a38a46f04aaca912426a2b1d3/urllib3-2.6.3.tar.gz", hash = "sha256:1b62b6884944a57dbe321509ab94fd4d3b307075e0c2eae991ac71ee15ad38ed", size = 435556, upload-time = "2026-01-07T16:24:43.925Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/39/08/aaaad47bc4e9dc8c725e68f9d04865dbcb2052843ff09c97b08904852d84/urllib3-2.6.3-py3-none-any.whl", hash = "sha256:bf272323e553dfb2e87d9bfd225ca7b0f467b919d7bbd355436d3fd37cb0acd4", size = 131584, upload-time = "2026-01-07T16:24:42.685Z" }, @@ -1369,7 +1378,7 @@ wheels = [ [[package]] name = "virtualenv" version = "21.3.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "distlib" }, { name = "filelock" }, @@ -1385,16 +1394,299 @@ wheels = [ [[package]] name = "wcwidth" version = "0.7.0" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/2c/ee/afaf0f85a9a18fe47a67f1e4422ed6cf1fe642f0ae0a2f81166231303c52/wcwidth-0.7.0.tar.gz", hash = "sha256:90e3a7ea092341c44b99562e75d09e4d5160fe7a3974c6fb842a101a95e7eed0", size = 182132, upload-time = "2026-05-02T16:04:12.653Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/41/52/e465037f5375f43533d1a80b6923955201596a99142ed524d77b571a1418/wcwidth-0.7.0-py3-none-any.whl", hash = "sha256:5d69154c429a82910e241c738cd0e2976fac8a2dd47a1a805f4afed1c0f136f2", size = 110825, upload-time = "2026-05-02T16:04:11.033Z" }, ] +[[package]] +name = "websockets" +version = "16.1.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.11'", +] +sdist = { url = "https://files.pythonhosted.org/packages/21/f7/bc3a25c5ec26ce62ce487690becc2f3710bbc7b33338f005ad390db0b986/websockets-16.1.1.tar.gz", hash = "sha256:db234eda965dcce15df96bb9709f587cd87d4d52aaf0e80e2f34ec04c7670c57", size = 182204, upload-time = "2026-07-17T22:51:05.858Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/08/e7/d1671fb984f9dd844e1da5288070c7c23c9eaba3082d3871aae19c3ab8b9/websockets-16.1.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:49ae99bdfcae803a885c926bf14f886196e84925395bb3f568fef5c0f0979d7d", size = 179570, upload-time = "2026-07-17T22:48:24.032Z" }, + { url = "https://files.pythonhosted.org/packages/99/f5/70df723bf571f5e0b1b845e0a4ff1c966eeb84f667599fc251caa37d15a3/websockets-16.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5bfd1ac19b1b9986a9c95a82d5e23a391ebb09e12c34d7be6094b86efcc35731", size = 177252, upload-time = "2026-07-17T22:48:25.775Z" }, + { url = "https://files.pythonhosted.org/packages/90/72/2f14b2e167170b8bf1c8bb7f9b0d78000f470d41a2085a91f33e3917b6c9/websockets-16.1.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:9246a0d063cfcbcc85f2359dd6876d681213f4790832272aa16641b4ed5d64d4", size = 177530, upload-time = "2026-07-17T22:48:27.337Z" }, + { url = "https://files.pythonhosted.org/packages/f3/18/a17e2f0cde02dc10154c808deed7e1d8528afff93612f70d3f0a5b19b011/websockets-16.1.1-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1214e673c404684b9bf7154f5cf43b45025b1a6160fac3a9e438e9c1a97e22cb", size = 186038, upload-time = "2026-07-17T22:48:28.756Z" }, + { url = "https://files.pythonhosted.org/packages/d5/b0/41de283899cf5929d637b72a508cdbc9aa40dc0f317c6b77613fd1000488/websockets-16.1.1-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:90001d893bc368e302ef168d82130b4e4fdd27b85fa094682df9b667c2d48838", size = 187278, upload-time = "2026-07-17T22:48:30.328Z" }, + { url = "https://files.pythonhosted.org/packages/50/61/874aab5257e027f9f61b5004cec65e592babca7942b1bc09f38e72b7f1fd/websockets-16.1.1-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:130937b167a52af203c8d58e78d67705874e82759862e3b9671a452fec4abc87", size = 189936, upload-time = "2026-07-17T22:48:31.896Z" }, + { url = "https://files.pythonhosted.org/packages/a6/1a/42173913ac5519607220849ed417c864d77384e4119f06dbba964a50f096/websockets-16.1.1-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9c9f23004a3d40e89c01a7955d186a6cc83418d93b749701944ce2de3e95a1f3", size = 187796, upload-time = "2026-07-17T22:48:33.344Z" }, + { url = "https://files.pythonhosted.org/packages/1b/f4/37c1840bd89b529479aec41470b97b7c683b107ca90b6399ac5afb99dedf/websockets-16.1.1-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f55f0b01956a094c8587146d9558c91937e78789c333860ffaf35931a6e5dbc4", size = 186481, upload-time = "2026-07-17T22:48:34.843Z" }, + { url = "https://files.pythonhosted.org/packages/9e/70/652d9b964adcfbeb056f42e0ca6bece34d108fe75534e74df20643cae199/websockets-16.1.1-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6aaface73b9c71974c6497366d8b9628357f6c9749e09c4ea3610176c63f2ae3", size = 184351, upload-time = "2026-07-17T22:48:36.307Z" }, + { url = "https://files.pythonhosted.org/packages/13/f1/af3850e5d48d482921985be72ebcb169c6180b3a77b57bd612deebcee23b/websockets-16.1.1-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:dc0fad4933f427acd5b1cec210f3ea6dce7089e1724e4b9ec6ef47c6c04d1b3b", size = 186791, upload-time = "2026-07-17T22:48:37.762Z" }, + { url = "https://files.pythonhosted.org/packages/1d/40/1a4e3ed4969ec378dcad337e5f1472c5e292cb3e733bc392f0dc2e230abd/websockets-16.1.1-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:f2769a0344a09e9ccf5b3cce538bc75a51b53eff3275d3896310c8552049195d", size = 185413, upload-time = "2026-07-17T22:48:39.127Z" }, + { url = "https://files.pythonhosted.org/packages/aa/3e/4e3fa1afe8f1a6a780434cd9ba8eb422632b044eff3dd73f6af67523c147/websockets-16.1.1-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:f70541f3104339f59f830522d94ebadb1bf47426287381623443d8bb1cdbf33d", size = 187178, upload-time = "2026-07-17T22:48:40.676Z" }, + { url = "https://files.pythonhosted.org/packages/71/ab/dd742766aa5dda7f349be0de49e4d565b84cf6f7f7fa02e07692f0f2bdd9/websockets-16.1.1-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:dc385593a42e31cd6fb60c19f0ecb015b386603818fc2c6c274fb42bd2bb4165", size = 185051, upload-time = "2026-07-17T22:48:42.098Z" }, + { url = "https://files.pythonhosted.org/packages/ae/f5/76438c6560f416f1c0a7f587679fb97cc6e99ed336011d43ce2002dd27c1/websockets-16.1.1-cp310-cp310-musllinux_1_2_s390x.whl", hash = "sha256:387e8e4aa5df2f90b198fa3cad3478822a89cf905b6a6d6c97dc3664689640cc", size = 185846, upload-time = "2026-07-17T22:48:43.472Z" }, + { url = "https://files.pythonhosted.org/packages/62/12/5c0320f2127823d27b2d56d611d31b0b284ad4edcb41364d66bf4c92b537/websockets-16.1.1-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:fd46fff7eb62c24804d234f0051c7a8ea81285ad63e0337d3dcf33ca82aee58a", size = 186066, upload-time = "2026-07-17T22:48:44.884Z" }, + { url = "https://files.pythonhosted.org/packages/a2/97/875986b857b955c3f9dd192cb8a1af81254dfb2ea22cc9590f0a1e020b8b/websockets-16.1.1-cp310-cp310-win32.whl", hash = "sha256:7883388947767080f094950b342b30d35a2a06b849cd967c422fa0db72b40ea9", size = 179940, upload-time = "2026-07-17T22:48:46.481Z" }, + { url = "https://files.pythonhosted.org/packages/54/82/1013a5fe7ddae8e102bc3b4b39db81d8d28fd02100a324ce6ede8cd832b1/websockets-16.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:d57685547e0060cc6fd90ee6a28405d6bd395e525545f13c8d7cd99c78afd79f", size = 180239, upload-time = "2026-07-17T22:48:48.043Z" }, + { url = "https://files.pythonhosted.org/packages/2b/03/47debfe28e9d6d354be5d777b67fd44c359b9eb299a5d103500bd7cc3e37/websockets-16.1.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:d0fcf657e9f13ff4b177960ab2200237b12994232dfb6df16f1cfe1d4339f93c", size = 179566, upload-time = "2026-07-17T22:48:49.596Z" }, + { url = "https://files.pythonhosted.org/packages/72/93/31efa1ed78c17e5cfc229fd449e3966e1b9cc15753204cd585cc8dd01f4a/websockets-16.1.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b852788aa51764e2d8e4cf5493d559326bcae5e38d16ba25ffa322b034df272a", size = 177250, upload-time = "2026-07-17T22:48:50.942Z" }, + { url = "https://files.pythonhosted.org/packages/01/4a/542378ab3972b0c1cf1df3df3eff9591cea0d30c58c3aa3c4ddbc244e787/websockets-16.1.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1427fb4cf0d72f66333e2cacc3ff5f575bf2d7008166ce991a4a470b21d51a22", size = 177528, upload-time = "2026-07-17T22:48:52.59Z" }, + { url = "https://files.pythonhosted.org/packages/33/d9/162321f63c7eed558e9e1798ed7a1e34a4f6dab51f35419e4ed7a4907979/websockets-16.1.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:da4ca1a9d72f9030b3146b8d7022719a9f3d478f61efe6f7dd51d243f61c51b2", size = 186859, upload-time = "2026-07-17T22:48:53.915Z" }, + { url = "https://files.pythonhosted.org/packages/de/09/87df740f7430ce564bd52402e9c9458d4d0459cc7d2ee29e530c8204851b/websockets-16.1.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:86d7f0f8bdb25d2c632b72527325e4776430fd5bc61b9118de4e2b8ddb5f5b01", size = 188095, upload-time = "2026-07-17T22:48:55.384Z" }, + { url = "https://files.pythonhosted.org/packages/d2/12/3d2703af7cc095f3c81904c92208cc1ae79affbc67376944b50ee9301f73/websockets-16.1.1-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:7dfcad78ea1492ee3a9ec765cb7f51bbc17d477107aaf6b22abf7b2558d1c5a0", size = 191385, upload-time = "2026-07-17T22:48:56.742Z" }, + { url = "https://files.pythonhosted.org/packages/1d/69/986aa0234a964a00f5149cfc46e136e96c8faad1c783474550f40d31aef4/websockets-16.1.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:fb9a0a6dc3d1b3986cb88091b6899f0396651e0f74e2c9766ab8d6ffc3842e29", size = 188653, upload-time = "2026-07-17T22:48:58.134Z" }, + { url = "https://files.pythonhosted.org/packages/35/6b/10f9d03e3970a69ba67bd3b46b87a929b586d0300fadbfe14f57c1f85490/websockets-16.1.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:29dfa8114c4a620c69591c5973860f768eac29d3fd6904f37f34266cb219c512", size = 187426, upload-time = "2026-07-17T22:48:59.515Z" }, + { url = "https://files.pythonhosted.org/packages/56/db/bb3aad62bf63d8bb3f0634b2eabffcfb3677a34bd19492110ff6869cf703/websockets-16.1.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6ff9417c0ada4d0f7d212f928303e5579bdf3ace4c802fa4afabb30995da58c3", size = 184882, upload-time = "2026-07-17T22:49:00.916Z" }, + { url = "https://files.pythonhosted.org/packages/6c/4c/c09a2ea9bfbeccce52fdc383e5f28af4bc8843338aabac28c81489af6120/websockets-16.1.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8fe0b50da2d84535fb4f7b4bfa951280f97ce3d558a0443b541166d609e67b57", size = 187584, upload-time = "2026-07-17T22:49:02.283Z" }, + { url = "https://files.pythonhosted.org/packages/c7/8b/31bb4eb4d9eaacf1fdd39d115772a8aeaedfc19b5dc262e57ffbc8a9d42c/websockets-16.1.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:34420aaa64440ebd51ac72ca8a45ef4626429438c9b02e633ae412ed43f925d3", size = 186174, upload-time = "2026-07-17T22:49:03.973Z" }, + { url = "https://files.pythonhosted.org/packages/2f/e4/dc02d725610a1ad49e193ef91a548194d71bdc6cdf27da83067dd1f73995/websockets-16.1.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:a6a61aff018180c9c50b7b0da33bfd29d378af3497429c95006c589a23a11648", size = 187986, upload-time = "2026-07-17T22:49:05.553Z" }, + { url = "https://files.pythonhosted.org/packages/e0/73/30ed84c8bfd14c73d4af29d5ed9323c3073b48e0b7b23b67070f4e7fd59b/websockets-16.1.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:04fd29a0e2fe9414a95b00e92c67ae51bf900c50c0f8a4b2dafdad621f49ea1d", size = 185565, upload-time = "2026-07-17T22:49:06.959Z" }, + { url = "https://files.pythonhosted.org/packages/7d/d3/4be8d4959f51e31b4f8fc0ece12b45bd3b6c0d15ea23b9990d9c11fc805f/websockets-16.1.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:5c31aa7e39ee3e8a358573257f1c0bb5c52430d1b637030dd9c8cc2c282926be", size = 186598, upload-time = "2026-07-17T22:49:08.293Z" }, + { url = "https://files.pythonhosted.org/packages/26/fa/abb38597a52d84ed9cfacadc7a0c6f2db282c0ab23cdf72b58a666a21227/websockets-16.1.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:d14bfb217eb4701e850f1525c9d29d79c44794cdf1c299ead25f39f8c78dea81", size = 186834, upload-time = "2026-07-17T22:49:09.766Z" }, + { url = "https://files.pythonhosted.org/packages/59/80/1119ad08a228b90c4eb77fbe48df7836731a605f5f881ba701ca826a4a65/websockets-16.1.1-cp311-cp311-win32.whl", hash = "sha256:2e28e602bb13da44fbe518c1781a88e3b9d4c3d48d02c9bad83e546164336f57", size = 179940, upload-time = "2026-07-17T22:49:11.196Z" }, + { url = "https://files.pythonhosted.org/packages/71/b2/e511c1c6f64a95c2f3fc54bffda0e14eaa7e9442be605c29270f7589b918/websockets-16.1.1-cp311-cp311-win_amd64.whl", hash = "sha256:7421fad442de870a8cbf2287d1cad7e706ece0dbfeba5e911df132cbdc1cb56a", size = 180239, upload-time = "2026-07-17T22:49:12.519Z" }, + { url = "https://files.pythonhosted.org/packages/17/9d/681cda21c9eee743203a6cb79b9d3d05adad9aa60ec660c6c9bf4dd619ca/websockets-16.1.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:cc97814dfb786a83b6e2dc2e79351e1b83e6d715647d6887fcabd83026417a00", size = 179600, upload-time = "2026-07-17T22:49:13.92Z" }, + { url = "https://files.pythonhosted.org/packages/fb/8d/6195a88b45e8d2a8f745fc2046e36f885a3c9763e6767d2c46229bf9510c/websockets-16.1.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:e047dc87ef7ca50f4d309bf775ad4a71711c58556d75d7bd0604b2317f43e94b", size = 177272, upload-time = "2026-07-17T22:49:15.453Z" }, + { url = "https://files.pythonhosted.org/packages/73/e3/fe2d498c64dea0095c9a9f9a351af4cd6eef31b618395582bc1f38ba45ff/websockets-16.1.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:01fbdcbac298efe19360b94bc0039c8f746f0220ba570f327577bfee81059175", size = 177542, upload-time = "2026-07-17T22:49:16.875Z" }, + { url = "https://files.pythonhosted.org/packages/fe/ed/f1831681fce0e3242346e5458486003c5f124ed69e5e0b847fd029db4973/websockets-16.1.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:0f62863e8a00a6d33c3d6566ec0b89f23787b747ffe0c3bc71ec0e76b82c94b1", size = 187137, upload-time = "2026-07-17T22:49:18.323Z" }, + { url = "https://files.pythonhosted.org/packages/6f/79/4ff9dcc1bb46f6b4c536936dde1fd60f9b564f3304307274db97f4c9496d/websockets-16.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8087e82f842609734c9b5a1330464f8e94e346ba0e18c832c08bafa4b0d63c15", size = 188374, upload-time = "2026-07-17T22:49:19.65Z" }, + { url = "https://files.pythonhosted.org/packages/62/c3/5c49b6efb36cab733d23773f6de575e1dba65736ead17d5d2b2a1daef779/websockets-16.1.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2bb5d041a8307d2e18782e7ce777f6fdb1e8c2f5d09291484b18c294b789d9aa", size = 191155, upload-time = "2026-07-17T22:49:21.331Z" }, + { url = "https://files.pythonhosted.org/packages/6e/f6/56ccceda3a4838d18f1d40821480da4775397e8b1eecf4031e20c50e2e90/websockets-16.1.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1db4de4a0e95673f7545d393c49eeb0c2f18ac1ef93073218c79d5cdb2ee75ab", size = 189011, upload-time = "2026-07-17T22:49:22.889Z" }, + { url = "https://files.pythonhosted.org/packages/86/d6/ad5286241a2bce1107e2798d3bfbd62cf79aee167bdb654f8cb1e9dbf949/websockets-16.1.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f17dbe07eb3ea7f99e4df9b7e0efefe80fbf30d37a8cc4d561a0aed310bc8847", size = 187766, upload-time = "2026-07-17T22:49:24.339Z" }, + { url = "https://files.pythonhosted.org/packages/bc/67/d65c970b7e347fdca69479beb7811c2060529956730a7a4e3ae7c66b0e31/websockets-16.1.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4b57693728576d84ede0a77987ab16881b783d2cd9f1dc180a8fbbc3f79c4428", size = 185173, upload-time = "2026-07-17T22:49:25.743Z" }, + { url = "https://files.pythonhosted.org/packages/1d/5b/14af3cd4ee69d8ea9baca58f3dc3cfb1ba78332a347fd478cb096549d60e/websockets-16.1.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2a636ff1e7a5c4edf71ef0e79adae7f25dba93b4fcbe3dc958733477ffeb0eaf", size = 187809, upload-time = "2026-07-17T22:49:27.147Z" }, + { url = "https://files.pythonhosted.org/packages/7b/11/be301710d70de97e3e7b3586e6d492c9c06d6a61bf1c2202c36cf0c75607/websockets-16.1.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:d6bec75c290fe484a8ba4cacdf838501e17c06ecfbbf31eede81a9e431bd7751", size = 186412, upload-time = "2026-07-17T22:49:28.611Z" }, + { url = "https://files.pythonhosted.org/packages/db/07/fe1435bf6fe738a3d3b54dbe0c18dabf12cba4d909ac8b58b539ce27c1f4/websockets-16.1.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:54509b8e92fee4453e152b7558ddef37ce9705a044922f2095a6105e3f80c96f", size = 188290, upload-time = "2026-07-17T22:49:29.965Z" }, + { url = "https://files.pythonhosted.org/packages/8a/0a/81f394aff8efcbb01208c1ced77df0a3c7fcce584a88c7273663697946c2/websockets-16.1.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:f0aa4aad3b1b69ad3fd85a0fd0952ec64331c762bd77ec51cc814170873890b2", size = 185844, upload-time = "2026-07-17T22:49:31.447Z" }, + { url = "https://files.pythonhosted.org/packages/39/5c/dd485b995473f415510251fe9bd708f2d24458f439fce958daf8d66dc7c6/websockets-16.1.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:42290eb6db4ccaca7012656738214f8514082fb6fa40cdeb61bb9a471b52e383", size = 186823, upload-time = "2026-07-17T22:49:33.104Z" }, + { url = "https://files.pythonhosted.org/packages/9d/0b/f78de76ff446f1e66af12b43c48a35f31744de93cfdec2f4ea67d5d7bbf1/websockets-16.1.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:53260c8930da5771cec89439bff99c20c8cb03ddb9588b980697355a83cd4bd3", size = 187102, upload-time = "2026-07-17T22:49:34.616Z" }, + { url = "https://files.pythonhosted.org/packages/37/a1/4cf892007778eaf84ad162bfc98046e0ed89b63ac55949e3236626b2a23f/websockets-16.1.1-cp312-cp312-win32.whl", hash = "sha256:1d27fa8462ad6a1cb36206a3d0640b2333340def181fae11ed7f9adeaa5c0747", size = 179943, upload-time = "2026-07-17T22:49:36.213Z" }, + { url = "https://files.pythonhosted.org/packages/d9/de/6abe251d28c3a3f217096575400b27750b18e0b1d2fff3a2a239960fea07/websockets-16.1.1-cp312-cp312-win_amd64.whl", hash = "sha256:b436f6ec4fc3a6b4237c84d3f83170ed2b40bb584222f0ac47a0c8a5921980c7", size = 180243, upload-time = "2026-07-17T22:49:37.626Z" }, + { url = "https://files.pythonhosted.org/packages/ce/fd/6ec6c6d2850aea25b1b2aa9901a016980bb87d01e89b3eb00470b1b5d471/websockets-16.1.1-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:ab59169ace05dcb49a1d4118f0bde139557adf45091bd85747e36bf5de984dd1", size = 179587, upload-time = "2026-07-17T22:49:38.959Z" }, + { url = "https://files.pythonhosted.org/packages/5f/d8/1d299d2dd34087db39831a34cc645ef8a6f89d78efada6983093513cd81c/websockets-16.1.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:5e3b7d601f6f84156b08cc4a5e541c2b50ad7b36cfc302b657a12477c904a5df", size = 177272, upload-time = "2026-07-17T22:49:40.293Z" }, + { url = "https://files.pythonhosted.org/packages/3d/86/0a70d3ae2f0f2256bb41302d9804dbca65d4360281e7feb3e1f94102ac46/websockets-16.1.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:cd2ca96a082a36964aca83e992f72abeb61b7306c1a6cba4c7d06a7b93750cac", size = 177530, upload-time = "2026-07-17T22:49:41.786Z" }, + { url = "https://files.pythonhosted.org/packages/b5/c2/c676c69444d9db448b3f0a55a98dcc534affce0bce961d9d2f0b8499b10a/websockets-16.1.1-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:f5d497865f05bb222cab7016c6034542e84e5f29f49c6fd3f4939cda7197b5b8", size = 187197, upload-time = "2026-07-17T22:49:43.658Z" }, + { url = "https://files.pythonhosted.org/packages/0b/13/88137fbaf726ebe29d62c1117fa11fa2bbb6209dc79d4ad738efbe36a2aa/websockets-16.1.1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bae954c382e013d5ea5b190d2830526bfa45ad121c326da0049b8c769f185db6", size = 188433, upload-time = "2026-07-17T22:49:45.147Z" }, + { url = "https://files.pythonhosted.org/packages/01/6d/46c2f2ce6751cb26f39293e1ecbf8544cb01321397cd476c2756b98c216d/websockets-16.1.1-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:e09f753a169951eb4f28c2c774f71069304f66e7277e0f5a2892423599cfa854", size = 189868, upload-time = "2026-07-17T22:49:46.581Z" }, + { url = "https://files.pythonhosted.org/packages/29/2b/170a9e8097636cfde4dc3c592b6e00b18a44a2f5407606d96ca542dd5838/websockets-16.1.1-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:024193f8551a2b0eafbdd160911012c4e6c228c28430c84433253299a9e42d6a", size = 189059, upload-time = "2026-07-17T22:49:47.972Z" }, + { url = "https://files.pythonhosted.org/packages/a7/48/f0d4ebc9ab4b473b8861b9e20fdb663d515d42f7befdf62cdb60fee7a1ec/websockets-16.1.1-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:aabe464bfd13bd25f4821faf111da6fefdc389f870265a53105580e45b0a2e49", size = 187814, upload-time = "2026-07-17T22:49:49.344Z" }, + { url = "https://files.pythonhosted.org/packages/d5/ba/39a41d3ae8e72696a9492581900611c5a91e2b07563b0bcd2523adea9854/websockets-16.1.1-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:a28fcbc9b6baf54a2e23f8655f308e4ccc6afdd7266f8fe7954f320dcda0f785", size = 185229, upload-time = "2026-07-17T22:49:50.787Z" }, + { url = "https://files.pythonhosted.org/packages/3c/36/ac15b604f850d1907f0a85ed721cefe47cd45034b3620069b829746cccbe/websockets-16.1.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:79eace538c6a97e96d0d03d4f9d314f9677f5ed85a8a984992ffd90b13cb8a56", size = 187874, upload-time = "2026-07-17T22:49:52.228Z" }, + { url = "https://files.pythonhosted.org/packages/a8/f3/3fbd5d71d59299c3770faa5884d4f45070236ca5a35ab3a61830812c409a/websockets-16.1.1-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:496af849a472b531f758dbd4d61338f5000538cb1a7b3d20d9d32a264517f509", size = 186469, upload-time = "2026-07-17T22:49:53.776Z" }, + { url = "https://files.pythonhosted.org/packages/b4/fc/dd90349bba58af2a53ef2ddd9c32716c81eb6d59a0687939fff561860878/websockets-16.1.1-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:5283810d2646741a0d8da2aa733d6aefa0545809afccb2a5d105a26bc45125f1", size = 188347, upload-time = "2026-07-17T22:49:55.202Z" }, + { url = "https://files.pythonhosted.org/packages/4c/f3/f73ba86427682da59b78c11d77ba56d5b801c32e84afe79b274bbd6a9bb2/websockets-16.1.1-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:4e3b680b1e0a27457e727a0d572fd81dffa87b6dbf8b228ab57da64f7d85aead", size = 185903, upload-time = "2026-07-17T22:49:56.75Z" }, + { url = "https://files.pythonhosted.org/packages/34/7c/f95eb20e80104173b3a0a092291f89ea4047ef6e608e0a57ca06eb14eecb/websockets-16.1.1-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:69159730a823dde3ea8d08783e8d47ef135a6d7e8d44eb127e32b321c9db8e3e", size = 186855, upload-time = "2026-07-17T22:49:58.467Z" }, + { url = "https://files.pythonhosted.org/packages/b0/35/dd875b3e050ff232d60fa377707f890e369f74d134f1be32e8f68879747c/websockets-16.1.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:ed5bb271084b46530ee2ddc0410537a9961152c5ccba2fc98c5276d992ccba87", size = 187140, upload-time = "2026-07-17T22:50:00.016Z" }, + { url = "https://files.pythonhosted.org/packages/e8/dc/5cbfcb41824502f6af93b8f3943a4d06c67c23c7d2e31eb18748c4a5b2a7/websockets-16.1.1-cp313-cp313-win32.whl", hash = "sha256:cfb70b4eb56cac4da0a83588f3ad50d46beb0690391082f3d4e2d488c70b68ea", size = 179928, upload-time = "2026-07-17T22:50:01.685Z" }, + { url = "https://files.pythonhosted.org/packages/b0/c1/71e5deb5b7f8f226997ab64908c184ac3105c0155ce2d486f318e5dd08a8/websockets-16.1.1-cp313-cp313-win_amd64.whl", hash = "sha256:d9531d9cbeac99af6f038fb1bc351403531f7d634a2c2e10e2f7c854c6ed5b68", size = 180242, upload-time = "2026-07-17T22:50:03.117Z" }, + { url = "https://files.pythonhosted.org/packages/73/a2/ba78a164eeea4620df4a4df4bd2ed6017438c4655cc0f36f2c0bc0432355/websockets-16.1.1-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:443aefe96b7fdb132e2a70806cca1f2af49bb3f28e47abcd7c2e9dcf4d8fa1b8", size = 179635, upload-time = "2026-07-17T22:50:05.001Z" }, + { url = "https://files.pythonhosted.org/packages/b9/08/d26d7a7628cd4ac34cbbdb63ac80914ca842ed8e42938c40a53567806df3/websockets-16.1.1-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:6456ff333092d509127d75a638cb411afae8ff17f092635015d1902efec8a293", size = 177320, upload-time = "2026-07-17T22:50:06.427Z" }, + { url = "https://files.pythonhosted.org/packages/0f/45/ebec83e6269536aa5932533c67b0af5c781f3e73fdbcd68672dcf43f4f44/websockets-16.1.1-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:fce6c48559c86d1ac3632ccb1bebc7d5442fbe79bd9bb0e40379ee54be2a4051", size = 177544, upload-time = "2026-07-17T22:50:07.834Z" }, + { url = "https://files.pythonhosted.org/packages/c9/d5/abc614d2297f6c1c3e01e61260364457a47c25cc1cf6a879038902bc6aa8/websockets-16.1.1-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:92b820d345f7a3fc7b8163949ee92df910f290c3fc517b3d5301c78065adafe1", size = 187270, upload-time = "2026-07-17T22:50:09.275Z" }, + { url = "https://files.pythonhosted.org/packages/52/71/4c99af3b87dff1b2927981f6876607d4acb45338c665242168d3982f7758/websockets-16.1.1-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:2a606d9c24035242a3e256e9d5b77ed9cd6bccfcb7cf993e5ca3c0f6f68fb6a7", size = 188509, upload-time = "2026-07-17T22:50:10.722Z" }, + { url = "https://files.pythonhosted.org/packages/9b/b4/5c8ca14b0df7eb84ed0524165c5359150210140817a3312aee57bf62a1cf/websockets-16.1.1-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:414e596c75f74e0994084694189d7dc9229fb278e33064d6784b73ffbba3ca31", size = 189882, upload-time = "2026-07-17T22:50:12.293Z" }, + { url = "https://files.pythonhosted.org/packages/25/c1/bedfba9e70557129cb8083748d167bdcc01483dedf0f0df143676df05cbe/websockets-16.1.1-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:536676848fc5961aca9d20389951f59169508f765637a172403dc5434d722fa0", size = 189114, upload-time = "2026-07-17T22:50:13.789Z" }, + { url = "https://files.pythonhosted.org/packages/df/09/aa835b2787835aebd839114be5de51b797cb480b63ba42b26d34dfe147cb/websockets-16.1.1-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:97fd3a0e8b53efa41970ac1dff3d8cf0d2884cadeb4caaf95db7ad1526926ee3", size = 187861, upload-time = "2026-07-17T22:50:15.179Z" }, + { url = "https://files.pythonhosted.org/packages/20/26/f6408330694dbc9830857d9d23bc14ac4f6875127a480cfdda8d5ca21198/websockets-16.1.1-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:7b1b19636af86a3c7995d4d028dbe376f39b4bf31541146f9c123582a6c94562", size = 185286, upload-time = "2026-07-17T22:50:16.741Z" }, + { url = "https://files.pythonhosted.org/packages/17/9a/e0675e70dd8a80762cf35bb18799d3f290a4890ffe6439bc51d222796083/websockets-16.1.1-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:41c8e77f17294c0ac18008a7309b99b34ee72247ef10b6dff4c3f8b5ac29896b", size = 187935, upload-time = "2026-07-17T22:50:18.213Z" }, + { url = "https://files.pythonhosted.org/packages/33/c1/3234cfb86afde01b81e9bddcc6e534c440975d60a13991259e833069ab3e/websockets-16.1.1-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:9f63bcef7f4b02b06b35fc01c93b96c43b5e88e1e8868676caacf493d5a31f3a", size = 186444, upload-time = "2026-07-17T22:50:19.67Z" }, + { url = "https://files.pythonhosted.org/packages/89/87/9c15206e1d778923d8daa9657de07aa62ea815e13448319c98458c37b281/websockets-16.1.1-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:dab9eb87869da2d6ed3af3f3adf28414baae6ec9d4df355ffc18889132f3436c", size = 188409, upload-time = "2026-07-17T22:50:21.28Z" }, + { url = "https://files.pythonhosted.org/packages/f2/00/cf5de5c67676de2d3eef8b2a518f168f6796595447a5b7161ba0d012915c/websockets-16.1.1-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:43e3a9fdd7cbf7ba6040c31fae0faf84ca1474fef777c4e37912f1540f854499", size = 185958, upload-time = "2026-07-17T22:50:22.719Z" }, + { url = "https://files.pythonhosted.org/packages/62/c0/731b6ddede2e4136912ec4cff2cffbda35af73546be4762c3d7bd3bd79af/websockets-16.1.1-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:056ae37939ed7e9974f364f5864e76e49182622d8f9751ac1903c0d09b013985", size = 186911, upload-time = "2026-07-17T22:50:24.108Z" }, + { url = "https://files.pythonhosted.org/packages/8c/7f/39c634472c4469a24a7c09cecddffb08fac6d0e74f73881a94ee8a40a196/websockets-16.1.1-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:a0eadbbf2c30f01efa58e1f110eb6fa293261f6b0b1aa38f7f48707107690af9", size = 187204, upload-time = "2026-07-17T22:50:25.548Z" }, + { url = "https://files.pythonhosted.org/packages/26/89/9667c256c256dafcc62d21328ce7a40067da857969b68ee9af375b0aaf72/websockets-16.1.1-cp314-cp314-win32.whl", hash = "sha256:195c978b065fa40910582464f99d6b15c8b314c68e0546549a55ed83f4735328", size = 179603, upload-time = "2026-07-17T22:50:27.086Z" }, + { url = "https://files.pythonhosted.org/packages/bd/dd/1c099d6c0fc5deb6b46ccdbb6981fdb4b12c917869cb3952408409dc18db/websockets-16.1.1-cp314-cp314-win_amd64.whl", hash = "sha256:4e8d01cc3bcae7bbf8167f944aeafefed590fae5693552bba9794a9df68371cc", size = 179948, upload-time = "2026-07-17T22:50:28.521Z" }, + { url = "https://files.pythonhosted.org/packages/35/25/9956b2d5e0529d5d23924f21bba1440d4c5c88a562e4f08550871ffa97a7/websockets-16.1.1-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:0ffd3031ea8bda8d61762e84220186105ba3b748b3c8da2ae4f7816fac03e573", size = 179963, upload-time = "2026-07-17T22:50:29.982Z" }, + { url = "https://files.pythonhosted.org/packages/17/06/55ffc976c488b6aee9ea05761ff7c4e88e7c1fd82818c8ca7b556ad2f90c/websockets-16.1.1-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:84a2cef8deffbd9ab8ee0ea546a2a6a7030c28f44e6cdd4547dbfeb489eb8999", size = 177497, upload-time = "2026-07-17T22:50:31.396Z" }, + { url = "https://files.pythonhosted.org/packages/0c/e8/f7dac2e980bacc92bdc26cebae4ae4d50cae5380732c50980598fc0bbae4/websockets-16.1.1-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:3df13f73af9b3b38ab1195eb299ecb67a4330c911c97ae04043ff74085728abe", size = 177698, upload-time = "2026-07-17T22:50:32.829Z" }, + { url = "https://files.pythonhosted.org/packages/b2/39/26762f734113e22da2b942c3aca85798e0c0405d64c256549540ff31e5a1/websockets-16.1.1-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:23253dd5bcae3f9aaee0a1d30967a8dbd52e5d3cff93a2e5b84df57b77d4750d", size = 187561, upload-time = "2026-07-17T22:50:34.24Z" }, + { url = "https://files.pythonhosted.org/packages/11/94/c3f330851806b9b02138b774d593478323e73c99238681b4b93efe64e02d/websockets-16.1.1-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9c1c5705e314449e3308872fe084b8571ce078ee4fc55a98a769bdefe5917392", size = 188732, upload-time = "2026-07-17T22:50:36.088Z" }, + { url = "https://files.pythonhosted.org/packages/d1/f2/eb2c450f052de334ae33cf200ece6e87b0e14d186807074e4eb1cd2cdea2/websockets-16.1.1-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:69e52d175a0a7d1e13b4b67ad41c560b7d98e8c6f6126eb0bda496c784faf8c7", size = 190872, upload-time = "2026-07-17T22:50:38.008Z" }, + { url = "https://files.pythonhosted.org/packages/70/31/2ac8cecf3a74f7fed9132129fc3d90b3998a1554570c11a69b2a8c20332d/websockets-16.1.1-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:1f79c89b5eb034d1722938a891916582f8f7f503f58ca22518a63c3f2cd18499", size = 189305, upload-time = "2026-07-17T22:50:39.53Z" }, + { url = "https://files.pythonhosted.org/packages/6a/cf/8ab19650d3c0d4562c92e70ab47c257c4aa5c6a713ed87fe63766b31fefc/websockets-16.1.1-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:39f2a024af5c345ffe8fcf1ee18c049c024c94df393bb09b044a6917c77bde43", size = 188033, upload-time = "2026-07-17T22:50:40.912Z" }, + { url = "https://files.pythonhosted.org/packages/66/d7/a49a38a6127a4acb134fb1912b215d900cc657605cff32445bf519f3acc4/websockets-16.1.1-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:952303a7318d4cbe1011400839bb2051c9f84fa0a35923267f5daba34b15d458", size = 185748, upload-time = "2026-07-17T22:50:42.559Z" }, + { url = "https://files.pythonhosted.org/packages/95/3e/ad1fa40388c7f2e0bb2c7930d0090b6c5498594bd1cdaec18864df3d9e97/websockets-16.1.1-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:249116b4a76063d930a46391ad56e135c286e4562a18309029fc2c73f4ed4c62", size = 188285, upload-time = "2026-07-17T22:50:43.974Z" }, + { url = "https://files.pythonhosted.org/packages/35/b8/d5db28ca264b9104f82196f92dc8843e35fd391f763d42e4ad358f5bc97e/websockets-16.1.1-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:61922544a0587a13fd3f53e4c0e5e606510c7b0d9d22c8444e5fae22a06b38cb", size = 186777, upload-time = "2026-07-17T22:50:45.474Z" }, + { url = "https://files.pythonhosted.org/packages/42/9c/726cb39d0cc43ae848dce4aa2acb04eecc6738b1264ec6d700bf6bcfb9f8/websockets-16.1.1-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:46dcaa042cd1de6c59e7d9269fa63ff7572b6df40510600b678f0826b3c7af51", size = 188682, upload-time = "2026-07-17T22:50:46.973Z" }, + { url = "https://files.pythonhosted.org/packages/be/c7/1168704de8c2dd483edabe4a22cbe4465dd8be8dd95561d214f9fe092871/websockets-16.1.1-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:38565aca3e01ea8734e578fb2118dade0ecb0250533f29e22b8d1a7a196cf4d0", size = 186377, upload-time = "2026-07-17T22:50:48.413Z" }, + { url = "https://files.pythonhosted.org/packages/ca/40/f9ff2d630ffce4e7dfea0b2288e1caf9ebbf9ff8a9ec9396136ce8b94935/websockets-16.1.1-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:42f599f4d48c7e1a3338fdaac3acd075be3b3cf02d4b274f3bf2767aedd3d217", size = 187148, upload-time = "2026-07-17T22:50:49.845Z" }, + { url = "https://files.pythonhosted.org/packages/b5/71/e177c8299f78d7cbe2d14df228643c10c70c0e86e108e092056bbcc16e46/websockets-16.1.1-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:dcc04fedf83effaeb9cce98abc9469bb1b42ef85f03e01c8c1f4438ef7555737", size = 187578, upload-time = "2026-07-17T22:50:51.619Z" }, + { url = "https://files.pythonhosted.org/packages/49/b2/b6987faf330f5af5c787a2610124c2e8403d51724f9001ec4fff6311fe7a/websockets-16.1.1-cp314-cp314t-win32.whl", hash = "sha256:8483c2096363120eea8b07c06ae7304d520f686665fffd4811fad423930a65d7", size = 179729, upload-time = "2026-07-17T22:50:53.269Z" }, + { url = "https://files.pythonhosted.org/packages/a2/6e/fbac6ed878dd362fbad7d415fa4f84d38e3e33fed8cde45c64e783acf826/websockets-16.1.1-cp314-cp314t-win_amd64.whl", hash = "sha256:bcce07e23e5769375158f5efdcdafa8d5cd014b93c6683865b840ed65b96f231", size = 180072, upload-time = "2026-07-17T22:50:54.969Z" }, + { url = "https://files.pythonhosted.org/packages/e1/ed/71fea6e141590cafc40b14dc5943b0845606bee87bdb52a21b6a73eb4311/websockets-16.1.1-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:820fb8450edddae3812fd58cbc08e2bf22812cb248ecb5f06dbb82119a56e869", size = 177185, upload-time = "2026-07-17T22:50:56.665Z" }, + { url = "https://files.pythonhosted.org/packages/01/ec/00e7eeca200facf9266a83e4cbbf1bed0e67fba1d4d45031d3e5b3d81b5c/websockets-16.1.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:125f22dbefaf1554fea66fc83851490edb284ce4f501d37ffed2752f418332d9", size = 177459, upload-time = "2026-07-17T22:50:58.197Z" }, + { url = "https://files.pythonhosted.org/packages/75/fd/5774c4b33f7c0d8f0c51809c8b3a93456c48e3543579262cfa64eb5f522e/websockets-16.1.1-pp311-pypy311_pp73-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:30bbe120437b5648a77d3519b7024ea09530e0b5b18d3698c5a0ae536fe0cc2e", size = 178294, upload-time = "2026-07-17T22:50:59.641Z" }, + { url = "https://files.pythonhosted.org/packages/37/c3/48e2c03d2bd79bb45948841c592d24156312dd5f58cdf8f549febe652fb6/websockets-16.1.1-pp311-pypy311_pp73-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b6b9dadbef0cccd9f4c4ee96b08898afa73e26803bbe0f6aeb5bb12b0074206d", size = 179190, upload-time = "2026-07-17T22:51:01.129Z" }, + { url = "https://files.pythonhosted.org/packages/2d/3f/73e511ecf2496ceac57dd4ed8388efe2bcf0769338a2dbf242c8366ae87e/websockets-16.1.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:56cd5fc4f10a9ea8aa0804bddb7b42506cf9e136046f3b4c27de8fec9e2ecba5", size = 180330, upload-time = "2026-07-17T22:51:02.603Z" }, + { url = "https://files.pythonhosted.org/packages/be/4d/2d0d67834092e354d2b0498f014a41249a89556bc406cf86f3e1557bb463/websockets-16.1.1-py3-none-any.whl", hash = "sha256:6abbd3e82c731c8e531714466acd5d87b5e88ac3243465337ba71d68e23ae7e3", size = 173814, upload-time = "2026-07-17T22:51:04.184Z" }, +] + +[[package]] +name = "websockets" +version = "17.4" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.11'", +] +sdist = { url = "https://files.pythonhosted.org/packages/75/79/590c5f0cc7d1661195aeefccb0e342b79f4c77d368d526d028821a390332/websockets-17.4.tar.gz", hash = "sha256:09d3939b70df0c8ad2da145ebd50978bccaee1d565e838b0e7921a34d38571eb", size = 191391, upload-time = "2026-10-30T15:10:35.873Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e7/d8/2d4ec550208432538d152a41f0c36dc6728cfae0050c6b1442605456d3bd/websockets-17.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:06ea46717553cdd10f2682126cf7a66e91c8ed17b6969f4a95e94b4e01d06188", size = 218746, upload-time = "2026-10-30T15:06:39.361Z" }, + { url = "https://files.pythonhosted.org/packages/56/99/3090fc0e2e343cc7ee60d532b67a2d413830c8fbb0be9ec3bcfbe3371f2e/websockets-17.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:75b32cf33ea40f945f226f97bc1d43151e1a5adff21f420b5e63c468b1a28114", size = 216437, upload-time = "2026-10-30T15:06:41.324Z" }, + { url = "https://files.pythonhosted.org/packages/3c/e9/3d4fb98e5d8aecc7bdbc59c4edf6380fdeddf935445e7f4a205466682991/websockets-17.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b8451f31ae24620cc9372acd2728d87922f2bb0cae3fa57aed68b152844cdf08", size = 216709, upload-time = "2026-10-30T15:06:42.995Z" }, + { url = "https://files.pythonhosted.org/packages/0c/4d/5c7d4f53cc0d7c6f268bbd93865b185e05f65f37f84712a41ab311118f8f/websockets-17.4-cp311-cp311-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:3b76837cd051d8875913f3934b27205f7a592f78b8a4f4a1f3abc36a2420c5bc", size = 225773, upload-time = "2026-10-30T15:06:44.607Z" }, + { url = "https://files.pythonhosted.org/packages/57/70/80f870701f8610e88649d3cd173a0e7ce66433913da3683035a4370063ad/websockets-17.4-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:cebad8f4796248b91fc2168515e507e5cb6b663a32befd09f3b1e7920acdcb1a", size = 226041, upload-time = "2026-10-30T15:06:46.224Z" }, + { url = "https://files.pythonhosted.org/packages/a2/bc/f2e84b5a933c86d52184814d38b0f9d51fc90fd3205cb7af0d9417ebbff2/websockets-17.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:954d43574f72be244b65f0fa61e2f814214b024f2ec849f487aa2f553f7c6e71", size = 227279, upload-time = "2026-10-30T15:06:47.619Z" }, + { url = "https://files.pythonhosted.org/packages/34/7e/4710475f46afbfe5390b4139556aa4fa0692d3d31878a25a1b26e8a6d78a/websockets-17.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b529ad6c81ad21db2f4e3d6e33db78ce3b9f272066b438b5d673361f9282898d", size = 230592, upload-time = "2026-10-30T15:06:49.357Z" }, + { url = "https://files.pythonhosted.org/packages/bd/10/cca6dc2316dd8c3b1a62fbf7f8986926ad8c4b2ae3d3be7888059a96b142/websockets-17.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:799c5a23126c9589cb10b6c6b54f9087246940dad20cd74bf3f06fc9ae3bbab5", size = 227837, upload-time = "2026-10-30T15:06:51.015Z" }, + { url = "https://files.pythonhosted.org/packages/68/21/ac1c3d7781d756bd40fbe501890b54a0205b1f0528a559fdcabcede0bd54/websockets-17.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f01a680d4b66fd15cc7513fae55c673cc8cc340d41340305b7f9a782abdbefed", size = 226613, upload-time = "2026-10-30T15:06:52.556Z" }, + { url = "https://files.pythonhosted.org/packages/b8/a0/bd122578f2765fb3714eeef80bd66074e355ff80e0a6de7fefa10de5f36a/websockets-17.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0e51546a3bedadd80dfa5c2efaed840ac51b8632d8db7f9f502175f5349382a9", size = 223893, upload-time = "2026-10-30T15:06:54.106Z" }, + { url = "https://files.pythonhosted.org/packages/51/50/a5214db6b778995b7fe1bfaab6228ba967cb6fd523d4b7af83154aa0ac66/websockets-17.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:6686d29eaafddeeab9e48af92103dc0d26161035faa4be083b8b488f1ab47219", size = 226768, upload-time = "2026-10-30T15:06:55.889Z" }, + { url = "https://files.pythonhosted.org/packages/fb/41/5d62d4889ff8a400cf32c8ad35e58b18e92b0e936db0bae785307cd1b105/websockets-17.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:7b23db4b469d9e051ac74d96db9bf61e27c9054de64f8263fefa32bf72867ba1", size = 225358, upload-time = "2026-10-30T15:06:57.706Z" }, + { url = "https://files.pythonhosted.org/packages/b4/94/c344744fad06ae721a6ec69f728a3dd4bd1b94beb7bb64400a8cd0efc644/websockets-17.4-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:0132e3cbd3f5cfc1ec77588961b302d72a02e2603b82c2c23fd5fb59dc4fa206", size = 226125, upload-time = "2026-10-30T15:06:59.125Z" }, + { url = "https://files.pythonhosted.org/packages/0d/00/90d66792bf1ce315fabe18f838eb2090ebad3425139047ed4c4ad354a90c/websockets-17.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:98f16db5e79f2605194c0f899d0532005bb12269e698bf96f62a5635bcf33010", size = 227169, upload-time = "2026-10-30T15:07:00.687Z" }, + { url = "https://files.pythonhosted.org/packages/24/7f/c069129b20504c35bd22abb276a6562e92dccb69c974ca93021a23fb00ce/websockets-17.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:ee48728a07566c32e097d267f4d4d01b85123c9ae748a42da02185b908cbedc4", size = 224750, upload-time = "2026-10-30T15:07:02.077Z" }, + { url = "https://files.pythonhosted.org/packages/4e/3a/0fcb37d6da690aa2512faadb0e9cb5e1043fff659fd415dc8b518883789e/websockets-17.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:2103982762460a764a7ef0021443bb471f46d45ecc6858276e4fe699ebac6b94", size = 225782, upload-time = "2026-10-30T15:07:03.783Z" }, + { url = "https://files.pythonhosted.org/packages/49/61/422745448862b18b8d373347bb73debcd440330f21dd899feac5f920d531/websockets-17.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:648adde345cfd13335342e23cfe94871c7f7f55a43fb254f3b95acb071072968", size = 226021, upload-time = "2026-10-30T15:07:05.237Z" }, + { url = "https://files.pythonhosted.org/packages/96/74/3ea38c6758b497a5d1b7bd953542e9e6446b84aa075a061e9a47e24ceb75/websockets-17.4-cp311-cp311-win32.whl", hash = "sha256:679eef0123861ca381dd8fd9bdc1920e87636ac55eae6cff875c53dcb05fbcf8", size = 219255, upload-time = "2026-10-30T15:07:06.871Z" }, + { url = "https://files.pythonhosted.org/packages/55/66/00ca8b75a634c9fcf70579f9a242b96a7f7a3abeb21a02e2380fff491d2c/websockets-17.4-cp311-cp311-win_amd64.whl", hash = "sha256:e4beaef2f4796558e738e15ca0b8802e35f419a9fa374a978e41706f43c48b26", size = 219556, upload-time = "2026-10-30T15:07:08.538Z" }, + { url = "https://files.pythonhosted.org/packages/4b/7b/c8ccb313439f4803779f186b8133563e6c49c023467a265ae52da7b7e25d/websockets-17.4-cp311-cp311-win_arm64.whl", hash = "sha256:ddab54dc0ec46ed09ef9ac131252cb5740ed21fbe6fc145f3c6fed0b575a8f15", size = 219487, upload-time = "2026-10-30T15:07:09.94Z" }, + { url = "https://files.pythonhosted.org/packages/af/71/b020221345ea6c012dcf7496827a48a744b58696470b2b07fef95a32905a/websockets-17.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:3d512e3a6c528c42ce220ed9c3caff83c6fdcd98a1b98249f08ccfc66ad111b1", size = 218779, upload-time = "2026-10-30T15:07:11.522Z" }, + { url = "https://files.pythonhosted.org/packages/8e/84/1c372ae7c032021a84e5c9e9b76b0dddefb354e9b4af783a97efd4d80ab3/websockets-17.4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7390e060f830b3d132f484b21ac2783a2d227b682ef62bb8146e1c1b4ca0e45a", size = 216457, upload-time = "2026-10-30T15:07:13Z" }, + { url = "https://files.pythonhosted.org/packages/74/b6/cff249107473f149c6c916a49cba967379fa63b0a7d2dce6896d6848f0a3/websockets-17.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:bcad49104711f88b2b7c3ba166de172857d837248205e541b044a552558fecc3", size = 216726, upload-time = "2026-10-30T15:07:14.468Z" }, + { url = "https://files.pythonhosted.org/packages/77/5d/aff8ecbf1c55c4d96f6dacc46a52102895f58b85bb284c8d325aaf31606a/websockets-17.4-cp312-cp312-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:cf99debb17227a50620aee16647bb33a0387f5fa5418d628666c0f05745e0d2a", size = 226043, upload-time = "2026-10-30T15:07:15.937Z" }, + { url = "https://files.pythonhosted.org/packages/cb/18/6229d6583031ca81d092a0cd887a13a57b402fb555acc323d39b45967eb7/websockets-17.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:9ae1429ee9e52b139167ed0169757806a27ed7307e942e8c62037a9184e9843b", size = 226321, upload-time = "2026-10-30T15:07:17.563Z" }, + { url = "https://files.pythonhosted.org/packages/b8/61/7aba018fd53873e792a25afe1f4c005518133477b727d7455f2f7550c425/websockets-17.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:51adfc30f467077293a6695d8149bcef501c0728386f3a491054f835dadb60b2", size = 227559, upload-time = "2026-10-30T15:07:18.998Z" }, + { url = "https://files.pythonhosted.org/packages/fb/66/37b207df9cdacaa017aa4487f3a9f2fcd668f6f7cfbafdac5b95ea258ee0/websockets-17.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c564d1e6531611bf87078c28780456ecc75459dcca189629fff2fe7c020d8e67", size = 230386, upload-time = "2026-10-30T15:07:20.431Z" }, + { url = "https://files.pythonhosted.org/packages/ad/f6/87507e11fbae53817a435945273953b5b020589e309fac4fd60527ee5999/websockets-17.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:4c792e6cce24d08f92199d907785c9e64f74c357deeed3dbaf7d699ed5930b64", size = 228193, upload-time = "2026-10-30T15:07:22.112Z" }, + { url = "https://files.pythonhosted.org/packages/2f/3d/90a04f0aa989b68fbd2efcd38237420afe2abe5a1cab0b5d7c2aa4f0dbb6/websockets-17.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:c44776f82b04e623eb9e1b81fcd17ac6e9808ae1ba5cdf8edce1f7c869a95a9b", size = 226952, upload-time = "2026-10-30T15:07:23.643Z" }, + { url = "https://files.pythonhosted.org/packages/ad/3e/50952af22b8e3e2d03f7e83f0e335851c6b484c3fd88586626fb1c2a34b3/websockets-17.4-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4d2636a5b61c69e32db0e74b57073dd4a66f1ad195e9398c5f01bba41090deea", size = 224183, upload-time = "2026-10-30T15:07:25.507Z" }, + { url = "https://files.pythonhosted.org/packages/c4/73/2a4a5d9c6bca1127f24af7bf08f406a69052d7f341bc81f08d9e8eb446b4/websockets-17.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:cfbbba4597f19ad717f79fd3f2a67ae7efae647bd6a61e14554e1b5ad242a5bf", size = 226991, upload-time = "2026-10-30T15:07:27.355Z" }, + { url = "https://files.pythonhosted.org/packages/68/de/90d96a579839bfe541ef214315df81d2bd519d952847c303328518ffdd02/websockets-17.4-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:c7b996c02de5e032cb63dc65482b73693b7ecaa586654126be2749ddea239c40", size = 225600, upload-time = "2026-10-30T15:07:28.973Z" }, + { url = "https://files.pythonhosted.org/packages/91/17/12c15ed446d842e40918cd16e79b56ee4422d6fbf210258cb8882f50bbd5/websockets-17.4-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:a920e99155d75d1b1c08172da8aaa7200e7b30871fb628d1631d7891a333e30e", size = 226366, upload-time = "2026-10-30T15:07:30.472Z" }, + { url = "https://files.pythonhosted.org/packages/9d/73/cb4c927e806a73a0377696e031ef3c0db409028cdb2373f96ee863e8df8e/websockets-17.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:8c00c5c49f80a588a2c4f99d519d2abed4ce26cdca11273041bc8b7e60af60de", size = 227470, upload-time = "2026-10-30T15:07:32.122Z" }, + { url = "https://files.pythonhosted.org/packages/33/b3/e682b3ea069933044f4bf4809eea0cd83e3a5bdbdff601d1777a9ae90795/websockets-17.4-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:52c31d123f5adf14dec694c2a4036bf42c523df7cefc641d31cd05653de56e49", size = 225026, upload-time = "2026-10-30T15:07:33.544Z" }, + { url = "https://files.pythonhosted.org/packages/2d/e9/d039757260705e5a265a31c9fff36b0d4567b842ce2b54e5d14369f200bd/websockets-17.4-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:d0acd8191c0e5a61d1c27bfa33b6ec8431982299f5d71c02129aa4f16f182ad0", size = 226007, upload-time = "2026-10-30T15:07:34.954Z" }, + { url = "https://files.pythonhosted.org/packages/db/e7/cb9907fac6f9b28f93beded6efda2953960cd02b633d432acf3451590859/websockets-17.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:2a9cb5bbfc33b4ebd3c8d3714d6e09805437f60a14977774e4bd11b5ace46c23", size = 226286, upload-time = "2026-10-30T15:07:36.292Z" }, + { url = "https://files.pythonhosted.org/packages/39/99/85f6f4dd104a5d9a33a1ef272f501d0f2e8527ddf66be1b383d51f90ce56/websockets-17.4-cp312-cp312-win32.whl", hash = "sha256:c63c0d7832956d5f3bb77888b93c854569d13f806289ff75c43926d25c6e5fd2", size = 219256, upload-time = "2026-10-30T15:07:37.686Z" }, + { url = "https://files.pythonhosted.org/packages/59/31/d1636ba67ee9232a60033d90483e48686aa3856014e59110f29015f97bd2/websockets-17.4-cp312-cp312-win_amd64.whl", hash = "sha256:dde9cd67f18803949ebf96de8aba12b8ec5ee3115e34c75a2db85a3b0a6c20d5", size = 219561, upload-time = "2026-10-30T15:07:39.19Z" }, + { url = "https://files.pythonhosted.org/packages/23/aa/e3859d52188f041a5a05c9f3ac005a9c829723f521f0fe60e2c5f9c93bb9/websockets-17.4-cp312-cp312-win_arm64.whl", hash = "sha256:c634053459278cf31fb404ddb5ecd38124e4609e8b609166da621edc2d5796db", size = 219487, upload-time = "2026-10-30T15:07:41.161Z" }, + { url = "https://files.pythonhosted.org/packages/cd/58/eaf27fce59e3f5b9997cd7c77749ef214e077daeffac95479be6ff9f5cfa/websockets-17.4-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:f24bed98595b9d854da8d6debaf82754abf3e8fe63ec90505ef560566814df7e", size = 218769, upload-time = "2026-10-30T15:07:42.558Z" }, + { url = "https://files.pythonhosted.org/packages/13/8e/287eca6d399a953253492189153976676994dfba1b7e82f0f992d14c1404/websockets-17.4-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:156221ad7638b5abccefd6f798916bf3f8ffd6ac51480eb4ba5b05df914ccbf3", size = 216454, upload-time = "2026-10-30T15:07:43.874Z" }, + { url = "https://files.pythonhosted.org/packages/b3/65/098fd4d221d691395492fcba88c895dde19a51d371b06b8d0be71d3f781b/websockets-17.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:74e46409666c358b93fce0d8c6f4cb107d8dd7cba1302a38d49adf6fa8193c7e", size = 216715, upload-time = "2026-10-30T15:07:45.409Z" }, + { url = "https://files.pythonhosted.org/packages/e9/29/9f9833bc83c1bf2e5597d1ef374d3ccd6467b9b45400cff399c85331ef6c/websockets-17.4-cp313-cp313-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:e3e80cad85ba68c07c1e8d4ccc9cf51e63bf6a73d6bf631640be947bd72b6b63", size = 226096, upload-time = "2026-10-30T15:07:46.929Z" }, + { url = "https://files.pythonhosted.org/packages/ef/75/6a95f93661bba2f1a4ec82eb26c6d30e6ba253569ecabb7a675139db6051/websockets-17.4-cp313-cp313-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:25eb661d8ba7e2b85ebb4e7a1bb9f6a3280910ed10b84330a7abfb5ed32d2764", size = 226382, upload-time = "2026-10-30T15:07:48.332Z" }, + { url = "https://files.pythonhosted.org/packages/80/b0/b0d9427dde0609e2727a9a966fb5fc5c6ef6aa7eba4cfc98791f8b7f1b75/websockets-17.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c74954409ea5789f7a60daa5f94580c00ad0b60b20751c47b35c4784877b5057", size = 227617, upload-time = "2026-10-30T15:07:49.799Z" }, + { url = "https://files.pythonhosted.org/packages/3b/00/fb1016d850d61676d1732434e2361d116c1de369078e59d21f4713115a19/websockets-17.4-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:47beedf07a706140b50786457e082497ee6b5970c41e49bcd1572ee3f4c73f80", size = 229054, upload-time = "2026-10-30T15:07:51.258Z" }, + { url = "https://files.pythonhosted.org/packages/77/c4/bb666e196541e42237fdb625303ad099005cc835c4e2e0a5d97bb9c4185c/websockets-17.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:9e282f35ece8895b9fa5af406fc6a4cb42f01e1009525cf46641de584781c83b", size = 228243, upload-time = "2026-10-30T15:07:52.975Z" }, + { url = "https://files.pythonhosted.org/packages/6d/f1/32ae0f45d8464e1606ef3f6a54318d8754b27889de18bb1b2176a19bea39/websockets-17.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:361f9a21a33191d5287e7a75f508fc3b9bf47aaffb0241198d6b7be3384f294e", size = 226995, upload-time = "2026-10-30T15:07:54.574Z" }, + { url = "https://files.pythonhosted.org/packages/f8/9f/5680151ef10e0bfb6f3bf09a992ce6c3e93bbb84fc8ec5d03ad570ac6532/websockets-17.4-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4073ab7cefe5a2e7dc368c1f01eb27716dc8ea8f1c69e9b7725ebce05aa53cf7", size = 224244, upload-time = "2026-10-30T15:07:56.158Z" }, + { url = "https://files.pythonhosted.org/packages/e2/66/409117b6882b91960598d62b95fac33d70a7aa2e1e1e854c6b64e76712f6/websockets-17.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a50bd9b44dd9b7b845802030b4d88610c01c7f95571b4cbd3a1aeec17a34c9fd", size = 227058, upload-time = "2026-10-30T15:07:57.539Z" }, + { url = "https://files.pythonhosted.org/packages/35/e6/34cab5913bea9d011ae2592a7672340179ff14fb98e889e5e41b071d8134/websockets-17.4-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:ad2e9e152bec6c4f7e4cdb4adcea6b708400090eec04bfe5ee5b30d368ffd721", size = 225654, upload-time = "2026-10-30T15:07:59.044Z" }, + { url = "https://files.pythonhosted.org/packages/a6/b0/6cfe18e12f23618a3d69723c828037c1282fee7ffce006ae7b5cc0e58ca4/websockets-17.4-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:5830f94a7190a33e55d06d89242ea951ee2009c3a27fc31538f3ac9386b27edd", size = 226425, upload-time = "2026-10-30T15:08:00.492Z" }, + { url = "https://files.pythonhosted.org/packages/c9/71/14d31ea34bafc07c6d96b362a44b301b9a0f2fb260490a8a6cb7db682bc4/websockets-17.4-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:c0cc2cb47face4dae64bd70a9268dbebddb3e48c1b48cf6d7b6ac1471609fd88", size = 227532, upload-time = "2026-10-30T15:08:01.932Z" }, + { url = "https://files.pythonhosted.org/packages/28/69/df3398ca1320a8b76e57ee41053d5c09955383cf60888ffa5771f51a4cc8/websockets-17.4-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:d0b6a9bd86f865ebc9d847a1eb0a655a0e2b447cbcde743dda97c4298415cc0b", size = 225090, upload-time = "2026-10-30T15:08:03.328Z" }, + { url = "https://files.pythonhosted.org/packages/d6/94/06afe778cf9893e9ac10209c0d4c70aaf0b72289245a8b7efb92cc80927c/websockets-17.4-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:7a7e9321822ca59ba56fa8744c3e3f01ef74d547aafe0d383d000d7a4d11eb79", size = 226041, upload-time = "2026-10-30T15:08:04.714Z" }, + { url = "https://files.pythonhosted.org/packages/c6/7a/28e9822dbf0bc63341dc45d8d5f1f1f7f375991fc8895bc731105fbde371/websockets-17.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:de29795f23833cdfb68ba45c8a5cc0ec49778ea5deb670188f4465bba5930d25", size = 226323, upload-time = "2026-10-30T15:08:06.103Z" }, + { url = "https://files.pythonhosted.org/packages/5a/d8/606c9c404e82731e4520f6397c8c16549e9cbd39ac583e7ea7d8972a6ae7/websockets-17.4-cp313-cp313-win32.whl", hash = "sha256:37ed7782972545e67d97ef9a172e9499d25459b1e32cb99d1c2a30c572f2441b", size = 219248, upload-time = "2026-10-30T15:08:07.617Z" }, + { url = "https://files.pythonhosted.org/packages/60/a1/17e507dadbfccb755758ba977b165fec92924dfc4a8d2573b4fc1561b0cd/websockets-17.4-cp313-cp313-win_amd64.whl", hash = "sha256:203e42eb77e06f85778a908b34c5ad032f34e98a68ef33920d6685c1e65a9420", size = 219560, upload-time = "2026-10-30T15:08:09.108Z" }, + { url = "https://files.pythonhosted.org/packages/01/ba/4f51fe8db73889ea3ecfdeee283d4ac3b7ad7a609c0e4c1fc6de04078021/websockets-17.4-cp313-cp313-win_arm64.whl", hash = "sha256:d8255971f6789cf0cb365e3e22b9b166eba978548a26241eaa5b7af0440d885a", size = 219496, upload-time = "2026-10-30T15:08:10.574Z" }, + { url = "https://files.pythonhosted.org/packages/1f/5b/085530961668661300de7248f9bf3ba84e98f47875f0fcc87637d024f82b/websockets-17.4-cp314-cp314-macosx_10_15_universal2.whl", hash = "sha256:d0f943b53bb1d7389d72a5380078670e5fcc34a1328142148b72d20fd82031c7", size = 218810, upload-time = "2026-10-30T15:08:12.14Z" }, + { url = "https://files.pythonhosted.org/packages/f2/fb/5a29e9569f74988822b7bc076287dd7f9f5b68a2070cf5eb4cfada5863d8/websockets-17.4-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:2fd562372d4afaf18d1c7f1c68e39bd32818bb16d5f57f778a4a4ed88eedcaae", size = 216506, upload-time = "2026-10-30T15:08:13.561Z" }, + { url = "https://files.pythonhosted.org/packages/df/73/eb8544367c13cd87df39d41b74853741fb7182e2a4bb659ad7d36f9066c8/websockets-17.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:a0457561e8a87a6a3b509e21c35084d7d207ced262139de3f738e9676a476bbd", size = 216719, upload-time = "2026-10-30T15:08:15.08Z" }, + { url = "https://files.pythonhosted.org/packages/24/fe/c3707e426d9bd779dfad9f319b2b431e5e60d563d7547d3780cbd1646028/websockets-17.4-cp314-cp314-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:7b4ee34acefa9ba1333f02b817982f1e4127f6f9b975017a707c4e738d7f9fb9", size = 226098, upload-time = "2026-10-30T15:08:16.581Z" }, + { url = "https://files.pythonhosted.org/packages/c1/24/d203439f909ffbf37260ca28a3432381412d2e79912ebf98be572e63055e/websockets-17.4-cp314-cp314-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:ef03fb4b3685df0ed9dc6a074a090f030345cad2c23c61818da3e08e693a9caa", size = 226449, upload-time = "2026-10-30T15:08:18.29Z" }, + { url = "https://files.pythonhosted.org/packages/4b/17/3ae5d9486a170a222dd0437b4f2bc02ecf324177498a942dcac200e65d05/websockets-17.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c5e970d3996c597186c9dbb6e77a8048737a834ac03cb13186a54999e0e1c31e", size = 227695, upload-time = "2026-10-30T15:08:19.692Z" }, + { url = "https://files.pythonhosted.org/packages/34/37/1307a8e30a961726f2350982fc01b0b3498db29b030c78c566e65ba64487/websockets-17.4-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6afc32a7a1a40b071070419537df3559d26907086556769683fa97b7b6e90fd5", size = 229069, upload-time = "2026-10-30T15:08:21.682Z" }, + { url = "https://files.pythonhosted.org/packages/9c/bd/4c6167744e202d20a3c770bcde8fae5d427317b1885712c2e02718cd8133/websockets-17.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5da7f7f1ecf866186f195f7ecc374c915e1838496b86f2f3b41da27c798a25c3", size = 228296, upload-time = "2026-10-30T15:08:23.371Z" }, + { url = "https://files.pythonhosted.org/packages/14/b3/3438eee41b39afb44c3c6e45dd686b88a7f8d742b96877b77de4fe0e0255/websockets-17.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:043945a43873c7c11a3f75238d475c95f902e967de329eb8763704546cfaa6b6", size = 227045, upload-time = "2026-10-30T15:08:24.749Z" }, + { url = "https://files.pythonhosted.org/packages/46/39/0bac9052d402efaad1b202ff2f1a57b6334aa624d20f509312765601b507/websockets-17.4-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:927d602fb8fb595a69e6b1ae998a6ec19851d0fb9391759456e6425090996647", size = 224297, upload-time = "2026-10-30T15:08:26.275Z" }, + { url = "https://files.pythonhosted.org/packages/a1/7f/5809f6ba5a7d1065301800daf605bdb661a9db5ef868ed189dbf691122ac/websockets-17.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:769e4f7b090e10cae4c082e3e39b9458ec2444505df84953c16c0468b16539c4", size = 227169, upload-time = "2026-10-30T15:08:27.703Z" }, + { url = "https://files.pythonhosted.org/packages/fc/f7/c8f6771e7cc2a038cf78bb12d04d29dbbbabf2a84d76999bcc94532f3020/websockets-17.4-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:03ddf4eb76ced8725dcbb000ff60b0fb8d7330ed011f6dc725a1925c5fe02051", size = 225632, upload-time = "2026-10-30T15:08:29.441Z" }, + { url = "https://files.pythonhosted.org/packages/2c/2f/9104786d952978ca2d011321109e35c05be24c3937ef2a62b4d6e25f7515/websockets-17.4-cp314-cp314-musllinux_1_2_i686.whl", hash = "sha256:94622cf24e80d03054ceb69a06a86c950e12fe993ed06b933f7895232cacbc3e", size = 226415, upload-time = "2026-10-30T15:08:30.962Z" }, + { url = "https://files.pythonhosted.org/packages/ae/a7/2e1606b3d616b86bb6c70a62d5f87fc9a3dbd81f0bbe24c4706ace76751d/websockets-17.4-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:bc581579885728bb54ef15000295c20e6a64a200b1b73d5cfca71879a3eb3e1f", size = 227594, upload-time = "2026-10-30T15:08:32.443Z" }, + { url = "https://files.pythonhosted.org/packages/67/2d/78ca44e2be6d397aee63a4e68d3a99a33bb14bb3405e94688bc5a2160db5/websockets-17.4-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:f42671900e0b602d05a074c52fd3d757c2f8e5c4f73f771794dae1aa4aea5f0e", size = 225146, upload-time = "2026-10-30T15:08:33.888Z" }, + { url = "https://files.pythonhosted.org/packages/d9/b6/6dad684e54fc8e09d70c9a095506db5c836207d8e846e3cb1e79424e3492/websockets-17.4-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:2b23dacf7a8a88afe92f77bcdbf4cf043a84692bac2f2da02f4011c687e19b48", size = 226095, upload-time = "2026-10-30T15:08:35.285Z" }, + { url = "https://files.pythonhosted.org/packages/d9/e5/7b04bad7c11c1f92238429352defbac1406743338049afe1328c7a7f95c0/websockets-17.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:d48795c7d64ca1c42e3d61fcc6478cb15a19b6ad3f9c882bc8d8dee49d4a420f", size = 226395, upload-time = "2026-10-30T15:08:36.8Z" }, + { url = "https://files.pythonhosted.org/packages/b1/16/4eb29c4b12f77b3139470063308ae1e6a0860b9073b1d27d56e8ce19c512/websockets-17.4-cp314-cp314-win32.whl", hash = "sha256:8588edf317fbe4f16a949bc5a6ccdd22b6e6fd5b4745d128bc40bccf31024ce5", size = 218784, upload-time = "2026-10-30T15:08:38.263Z" }, + { url = "https://files.pythonhosted.org/packages/6d/85/2496a24de80c215b55a15f037bc368a2ed0ce7ecb1e909039ff4e76395de/websockets-17.4-cp314-cp314-win_amd64.whl", hash = "sha256:70293c25d79d1f084fdd665894481547575e429d2a75e8d72caec2f6b6b07af8", size = 219137, upload-time = "2026-10-30T15:08:40.112Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a3/cfe95d4eb569035e5a1d2e5cbeb4ccf0eb15a19e1ef2ad819a85960bf375/websockets-17.4-cp314-cp314-win_arm64.whl", hash = "sha256:adc30e5d064c9e33049e825408fa4e952f4e8a0cf4c329dc2ded72e1bb5bae08", size = 219017, upload-time = "2026-10-30T15:08:41.778Z" }, + { url = "https://files.pythonhosted.org/packages/2b/dd/4143048a2b27303e7de8ef53d7d0ee3987734fbf93e09491d5a1b0a55187/websockets-17.4-cp314-cp314t-macosx_10_15_universal2.whl", hash = "sha256:bbb6bed49f083e2ec8ae0bb21c00c7c5171ab8e08a8b008c61a43fc6c944fdac", size = 219141, upload-time = "2026-10-30T15:08:43.184Z" }, + { url = "https://files.pythonhosted.org/packages/a8/3e/a63b5f3a5c24be2898eb22a3093a56d4ac4cd24ae79e7ab7a1b971ed4611/websockets-17.4-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:c7a56140fcbf4662cb263754a754c651a16fe2196cae1fd232d18f89acd30c83", size = 216675, upload-time = "2026-10-30T15:08:44.682Z" }, + { url = "https://files.pythonhosted.org/packages/d6/80/f238a10f0b23853c665c602a42784023995ac26674e480252c21af39f4f8/websockets-17.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:18d3710becc612ec6f0229425bd6495133dfcbf30f7b6569585acc8ed2f1b452", size = 216880, upload-time = "2026-10-30T15:08:46.304Z" }, + { url = "https://files.pythonhosted.org/packages/d1/b1/899b69aba1e8d65ac5bfe90b97ada22a815f1dcd3840bf188104738aac33/websockets-17.4-cp314-cp314t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:00ad98e4bb0df7a6711c645eec16d5a9fdf99f0692bd4f5b6cb85a68677ba8df", size = 226462, upload-time = "2026-10-30T15:08:47.723Z" }, + { url = "https://files.pythonhosted.org/packages/28/a8/598c2b2a22dfe14d352400df804db8b78a68c1498b3f775a658f07f21618/websockets-17.4-cp314-cp314t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:7849a096d6fdba3f2bdf849eb89f2d233a24400c92faa3efb25fa8dc615b706c", size = 226741, upload-time = "2026-10-30T15:08:49.314Z" }, + { url = "https://files.pythonhosted.org/packages/6e/ad/84a6de3cc3dd4ee336428c31f89a82e002299f83e10d967f0e9a5cbaf591/websockets-17.4-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e30550965c78223439815dbdf40c93eb8931dfbf12427110dcfcaeebef76feb6", size = 227914, upload-time = "2026-10-30T15:08:50.746Z" }, + { url = "https://files.pythonhosted.org/packages/69/ab/1e191b97d60a934c071b7b73c39c5db39721a925cc53acd929c615f85550/websockets-17.4-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:725be1aff55f1c873a79cea0f612df9dff21a9d2c2e05783665b824b8aa7c24e", size = 230059, upload-time = "2026-10-30T15:08:52.596Z" }, + { url = "https://files.pythonhosted.org/packages/f2/57/ef8a64732ef4367091ab05f9b22c1ee4c28657d4a0d088a644198eb5ded6/websockets-17.4-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:b6c7f91520c29420639925fd1cecceac9ca07366b50c09ea24eac1cd116b4866", size = 228486, upload-time = "2026-10-30T15:08:53.967Z" }, + { url = "https://files.pythonhosted.org/packages/48/1f/dbad3afcacf2c52d1fdf83b611d849598f0a047d7333ff476266532877b8/websockets-17.4-cp314-cp314t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:6531540aa63e6864cb0615a3a5da70ae03191334507852a5385320bb7916df3f", size = 227216, upload-time = "2026-10-30T15:08:55.687Z" }, + { url = "https://files.pythonhosted.org/packages/5b/47/59e325d6ca3e04ba5cc7a139d891ef83cad3fb460a183c8f359f378b69a9/websockets-17.4-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0a57b99f2e28922b5a2434317580fd23fdf118caff4c5b752f5452836426205a", size = 224755, upload-time = "2026-10-30T15:08:57.203Z" }, + { url = "https://files.pythonhosted.org/packages/b8/b6/28a471318dfb0060b58c47d0a252cb5078528a1aa1fdf5e6e88e2a61cf18/websockets-17.4-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8fd30d217a4275107667fe1d4f601e2d50c797d0727148cfbb384536d65f04d3", size = 227508, upload-time = "2026-10-30T15:08:58.597Z" }, + { url = "https://files.pythonhosted.org/packages/ee/29/7485ac6fc4b342b43964811381f56276fec967cae6a851ae4b815613b10c/websockets-17.4-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:cc0cd4065a65ac98f3e2742ee9f314da9d224db49b07dc17d3a20cef0d79658d", size = 225961, upload-time = "2026-10-30T15:09:00.414Z" }, + { url = "https://files.pythonhosted.org/packages/95/a6/520e1f7aa9644ddf58f5a51fc37f46e15293a68cd35b70d5b81b7331ca1e/websockets-17.4-cp314-cp314t-musllinux_1_2_i686.whl", hash = "sha256:71f76bb8e59be847330b8a8d3753f85397677e128f9f9692c215f8cf721cefc7", size = 226851, upload-time = "2026-10-30T15:09:01.979Z" }, + { url = "https://files.pythonhosted.org/packages/e5/0d/444799abe7418f361da8c201c6858b64b4e8d47265f90851e5cb68b4d90f/websockets-17.4-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:c2db7b9e2d726f7e051bedb67abcf460b84b11437b2f9fdacda7e6931dace85b", size = 227869, upload-time = "2026-10-30T15:09:03.405Z" }, + { url = "https://files.pythonhosted.org/packages/cb/86/6da20322a07364a0ab0787a2b0d4367770f59404fdab6e35122413a7f63e/websockets-17.4-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:332b88022d0acd47c44158bcd43f47f14eaddcd979247f242b1a33291c45cdd1", size = 225562, upload-time = "2026-10-30T15:09:04.891Z" }, + { url = "https://files.pythonhosted.org/packages/2a/da/53e44d96238dc207011ad5d93b0540c58e1c680a86f48dc3fa8e5138b343/websockets-17.4-cp314-cp314t-musllinux_1_2_s390x.whl", hash = "sha256:5cec3e7fbc911ff4fcf43b24aaf1b96906381ad36030f42897def3ff4b78729e", size = 226334, upload-time = "2026-10-30T15:09:06.42Z" }, + { url = "https://files.pythonhosted.org/packages/18/08/82cea972a87f229ee1903e9adf74c17d1e6c4371d581ebb11ccbed4e3a7b/websockets-17.4-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:cbdf4b42f4514422051889424fd03bc269be8c5d751bf39ec29ad761590bd10d", size = 226767, upload-time = "2026-10-30T15:09:07.837Z" }, + { url = "https://files.pythonhosted.org/packages/96/f3/ee6afff802e39e8d6ef29ee4bdc30f8272aaa38295c19a911fad91fe95fc/websockets-17.4-cp314-cp314t-win32.whl", hash = "sha256:16550e24ac22c27e0a728100d8de196b5f054bab6748ef9f0b168fb8b3c32e35", size = 218918, upload-time = "2026-10-30T15:09:09.31Z" }, + { url = "https://files.pythonhosted.org/packages/11/56/b0b07917f9c85a4d24a37300f4ae888bfa7c20f08902dd6a5c61a0d1b26f/websockets-17.4-cp314-cp314t-win_amd64.whl", hash = "sha256:5ec906bb21b35e66cfdcc2ea0133f249f52b7d89e3e45ec8d2bd2d84a0255d7d", size = 219260, upload-time = "2026-10-30T15:09:10.832Z" }, + { url = "https://files.pythonhosted.org/packages/19/a6/a63113909ea602d3d22b0f32a7a9950d8d18b725cfdce735eab9b5f5d198/websockets-17.4-cp314-cp314t-win_arm64.whl", hash = "sha256:c00f0c45851a2c61efffd03dde8fb4d594026b5cc18196c94e15460f1225f2ed", size = 219176, upload-time = "2026-10-30T15:09:12.444Z" }, + { url = "https://files.pythonhosted.org/packages/ee/be/4032fde05e62d1c52edd250fda475e910cac0cd180e377690bff24147b5e/websockets-17.4-cp315-cp315-macosx_10_15_universal2.whl", hash = "sha256:8c51ac7b31578a7275650f580aac985940985b6d2e57247ac6d5e07f2c936cd6", size = 218740, upload-time = "2026-10-30T15:09:13.833Z" }, + { url = "https://files.pythonhosted.org/packages/74/1c/b47f5786eb45599072411571651606fb22f6e825d522d627daad974ea636/websockets-17.4-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:023dc13bdc42a55e152acc81c39c90ec6cc4159ed17d23c6d73460fa2a73ab16", size = 216470, upload-time = "2026-10-30T15:09:15.394Z" }, + { url = "https://files.pythonhosted.org/packages/70/98/0021f55de633617b4a8390cca17e700c9ba5d99323103128412dc2c15aca/websockets-17.4-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:6fd8cac4907fec8302726d49e6969acfffaf720bc39b1cee23f473b81f4dce01", size = 216695, upload-time = "2026-10-30T15:09:17.185Z" }, + { url = "https://files.pythonhosted.org/packages/28/56/2c67389b47c4b9e9e9318d9b3e4bb52a2fef3749ff00b0b151a342c4d42d/websockets-17.4-cp315-cp315-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:4441d655a53185ef1b01b1d42ad9b3a96b905110a9219043e3fdaec855ba3b6e", size = 226134, upload-time = "2026-10-30T15:09:19.156Z" }, + { url = "https://files.pythonhosted.org/packages/75/bd/ee3a679a10741a0cdd7aa8bdd6d03999069672826aa7a6495fdf589ed961/websockets-17.4-cp315-cp315-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:3acc45494c08a4d27375a2c28474537f68910219f42624a08011221b04623d04", size = 226569, upload-time = "2026-10-30T15:09:20.587Z" }, + { url = "https://files.pythonhosted.org/packages/c4/42/b293a5d07099549797138d09fda5bf878d302b4980e61678981c8dfdc98f/websockets-17.4-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3b78b39377630a70aa2198e5f03be416e690364a046b1d8af80a9263733083d0", size = 227726, upload-time = "2026-10-30T15:09:22.015Z" }, + { url = "https://files.pythonhosted.org/packages/2d/81/d048ff83c4d0fc386f6008529d12690d0dcb410f73570430f13fe4d543f0/websockets-17.4-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:6cf4c002268da5c11cae9083aec71ac943bce9d95e0f83c8bf9a95a3ce421fbb", size = 229426, upload-time = "2026-10-30T15:09:23.444Z" }, + { url = "https://files.pythonhosted.org/packages/e6/21/1df51f94047dfb76c32fd7508036e4b55352d0f04fd0e3bee525a2122225/websockets-17.4-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ed7fe197b8bb66eef4f62c052e33752d456d2fdda74805469d4bd954950ab339", size = 228211, upload-time = "2026-10-30T15:09:24.902Z" }, + { url = "https://files.pythonhosted.org/packages/cf/13/33d6a28471da4c30a98a2313c76f984be2056a703c5c532225dc28f5dba3/websockets-17.4-cp315-cp315-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:f0494d3d97502e270282cc6a1f8648cd7335b4fe8d5c452006e5b7f9d62b8892", size = 227106, upload-time = "2026-10-30T15:09:26.315Z" }, + { url = "https://files.pythonhosted.org/packages/4a/86/ff8441e56ca677e51f9c826868fccde2a82bafe0ffa337fd38823b64253a/websockets-17.4-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ab9e4bd60796866c578e3afa0a17c98636887827a39c2e238a61989c18fd8e7b", size = 224499, upload-time = "2026-10-30T15:09:28.116Z" }, + { url = "https://files.pythonhosted.org/packages/da/91/470d7a619ce4aa837ff5b6a5836227c43bdfdc42ef837cce48f508992438/websockets-17.4-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:8d148b4b295224d3a19e7bd9f02ebe7344de254b3b2c4d0628ce42ade0bca119", size = 227213, upload-time = "2026-10-30T15:09:29.847Z" }, + { url = "https://files.pythonhosted.org/packages/a4/ba/55ed1422d6c73b5b81996ca195f2a256a339b26c553f5686afc2a926bc2b/websockets-17.4-cp315-cp315-musllinux_1_2_armv7l.whl", hash = "sha256:6597a1f7413189b4bc58437babcdf39b79da416e5c477ae98323a88ecc108188", size = 225876, upload-time = "2026-10-30T15:09:31.249Z" }, + { url = "https://files.pythonhosted.org/packages/e9/59/f133d260e7a48d3e231c3a495eeb6114b880c1e96bfc781a949c1f73991c/websockets-17.4-cp315-cp315-musllinux_1_2_i686.whl", hash = "sha256:a9b0026538719f7a532998d84640ab2e91ca1a051ce4b8d924fdcb607307e921", size = 226403, upload-time = "2026-10-30T15:09:33.199Z" }, + { url = "https://files.pythonhosted.org/packages/45/16/bb3355453ffdc31d3a14ddc0b50e058f13a97d2ed019ba6c380e03456169/websockets-17.4-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:a703f23ca15a51251fc94f1774683f5aa511588a7ad6bbb83960cdb2a4dcd978", size = 227558, upload-time = "2026-10-30T15:09:34.703Z" }, + { url = "https://files.pythonhosted.org/packages/0c/ab/f3d55a83c2a4daa8bf62594b00a721dc8767518ccb833f932b0178eb6c19/websockets-17.4-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:6b061ea7ca94966af7cd7a87cb189ff15972c103244611a2b1e8408c04f1dbe6", size = 225369, upload-time = "2026-10-30T15:09:36.204Z" }, + { url = "https://files.pythonhosted.org/packages/88/66/3a320bfb718d9ae1eff15ba7790979c0e6fdec74e388430f426e6647d7f4/websockets-17.4-cp315-cp315-musllinux_1_2_s390x.whl", hash = "sha256:e6d2a185ec4ff0478089305abd833da3a9fda8803eb77325b89ebeae5585a3b7", size = 226268, upload-time = "2026-10-30T15:09:37.565Z" }, + { url = "https://files.pythonhosted.org/packages/da/ee/1f9cdeeaaa2d5e158b7a40f971e74b641b35f977674b46229a5bb14e270a/websockets-17.4-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:9a4e95d56994a45ac76541853796720436ffe462957d0b1b89e87ff3d3b1627e", size = 226530, upload-time = "2026-10-30T15:09:39.171Z" }, + { url = "https://files.pythonhosted.org/packages/da/28/506406ef09e6e168796f0187bdac0767f38a560e6785c4ee26e583aaaf76/websockets-17.4-cp315-cp315-win32.whl", hash = "sha256:b7ea61af293a153f2d67430038cf0efc10140caa623f2bdf5a9f5a457ff20f57", size = 218751, upload-time = "2026-10-30T15:09:40.748Z" }, + { url = "https://files.pythonhosted.org/packages/25/a6/818647a9a9b3ee8bf131e9ab4fa1f2db9c6539f08e7084dd57549e0bd49d/websockets-17.4-cp315-cp315-win_amd64.whl", hash = "sha256:8b45d40f07081b377f0b837ddbfba4a9ab4a89a7b569d3c095436564e767a27b", size = 219045, upload-time = "2026-10-30T15:09:42.251Z" }, + { url = "https://files.pythonhosted.org/packages/3d/b2/0338a9abec3df8556627af987352657ce1c8456f2060b54741570b174122/websockets-17.4-cp315-cp315-win_arm64.whl", hash = "sha256:29b615c2d5dd883f89c107a782681b73a7aa8b2bd894130310e45eb09b143913", size = 218957, upload-time = "2026-10-30T15:09:43.866Z" }, + { url = "https://files.pythonhosted.org/packages/68/92/22e83d003cdbd22be5d35e28c260203e9fbb6c73b17a8e1509f4ad49e74d/websockets-17.4-cp315-cp315t-macosx_10_15_universal2.whl", hash = "sha256:c568e72f5425a74616daeb824afe28da460cbeea036432f41c6af5380b83300d", size = 219056, upload-time = "2026-10-30T15:09:45.528Z" }, + { url = "https://files.pythonhosted.org/packages/2f/ca/071d38e7237f6ada4f577b74f7cbf5bc2ff7e1f9360ebd2837e74a22dfd4/websockets-17.4-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:bfc86dff091104eec770c29ea1831dbe191968a70aa2d8ae8eda3240d863970a", size = 216630, upload-time = "2026-10-30T15:09:46.951Z" }, + { url = "https://files.pythonhosted.org/packages/fa/76/22d4523f92d88b8f5ebfd3df7ab5e825146af100f7e2caeae7d359ae51ea/websockets-17.4-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:f5f06f59e19aa0770aaf651ce91c196fa620b35aed49a7e6c36e7335f3f83db7", size = 216841, upload-time = "2026-10-30T15:09:48.285Z" }, + { url = "https://files.pythonhosted.org/packages/87/29/bc94be4a8bc19ef518e9efecd90a992f2991b7cfc6eb8a7430c4e2dc097c/websockets-17.4-cp315-cp315t-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:8f32a6cb0b101170abc2d8053af1473a2a29ef2a06d7130994ee8455a50f5dbf", size = 226992, upload-time = "2026-10-30T15:09:49.776Z" }, + { url = "https://files.pythonhosted.org/packages/fa/25/58f69b5fec064764ddf5b88045397433cdb028f5b17c82fbe047fd31fff7/websockets-17.4-cp315-cp315t-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:72d0a731eccf482d5661c6711abfcd5921f3dbfbbb0789061e1918ef4bc89c70", size = 227258, upload-time = "2026-10-30T15:09:51.172Z" }, + { url = "https://files.pythonhosted.org/packages/21/7c/bc932a54c5f1bd78461574aea539fc562fd2de494738a2c0675c4de860be/websockets-17.4-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:48c83103f82fce36191a9e3a8a80731d4340e2da544eae8c5aaaf6a45280e7d0", size = 228589, upload-time = "2026-10-30T15:09:52.628Z" }, + { url = "https://files.pythonhosted.org/packages/c4/92/57ec83066d0bfa8a9b9f594bc61951073c4a86e34c562a5292604118dab6/websockets-17.4-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c8052c3058c402d53602583da5ddcf1a15a63ab1efe0222f47c7be59944e6463", size = 230217, upload-time = "2026-10-30T15:09:54.058Z" }, + { url = "https://files.pythonhosted.org/packages/6e/fc/0f2fe533b5b4dc22ac704b3357f5c99fa60a3837218b3c6c6ad63a60120e/websockets-17.4-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:0c22a9c6b2349204f56123dd0ca7779e989d68e336d0dc02ad823485d44925de", size = 229026, upload-time = "2026-10-30T15:09:55.727Z" }, + { url = "https://files.pythonhosted.org/packages/7c/cc/ed28307835106a9a2dbd1a5efc597e8befa3d0a5f2b46a4c1e466b2f4759/websockets-17.4-cp315-cp315t-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:0dcce83837328e6795225ead920d3aa8d867cc9d6922aa558b0e9111599fdbb9", size = 227904, upload-time = "2026-10-30T15:09:57.221Z" }, + { url = "https://files.pythonhosted.org/packages/39/4d/24ad7deddc7b31c3e430acc1c00c7b384ae42f1f973e9cc01aa42d19628f/websockets-17.4-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:4b79ea31cf277c72d2307c6cb8bd32a2c151959e80a2f24fa85df620c5f2860c", size = 225253, upload-time = "2026-10-30T15:09:58.624Z" }, + { url = "https://files.pythonhosted.org/packages/93/f6/9c92230ebfab42fee482b236c45c32ed34b24f7360080b400cce6cfcac11/websockets-17.4-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:3d27153a0413696767b98b5d96173a2a7e27cbfca02000a6069cea7b977765a7", size = 228089, upload-time = "2026-10-30T15:10:00.308Z" }, + { url = "https://files.pythonhosted.org/packages/fe/7a/f523830e562da9b1d7a610174752753720c5e47e84b59b5fc47721d416bd/websockets-17.4-cp315-cp315t-musllinux_1_2_armv7l.whl", hash = "sha256:e0feb03a338f8f5e819ae23a73aabb7b46fd3b73f15f7df782dd12d99e2b02ad", size = 226743, upload-time = "2026-10-30T15:10:01.744Z" }, + { url = "https://files.pythonhosted.org/packages/2c/e6/d1a56495cb7b1a0a4688145131be38cfd0c1342bde8125e136a6e6ee494e/websockets-17.4-cp315-cp315t-musllinux_1_2_i686.whl", hash = "sha256:9ff89e36451a19775e7556d95ebfa4a0b24b84cc87565d6b5d0ec8ea82bf3f2c", size = 227237, upload-time = "2026-10-30T15:10:03.417Z" }, + { url = "https://files.pythonhosted.org/packages/44/41/c4e53f7ad63838d7eba6e82c5d743827e91dafe5e48c88a58f7e90043945/websockets-17.4-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:ee6c4e0085bff5f6621bf9c53452584dcb91ebd993ce841e1f4061ac12b6b556", size = 228348, upload-time = "2026-10-30T15:10:05.149Z" }, + { url = "https://files.pythonhosted.org/packages/ca/01/f6f78c3edeb8ad2b3c35a8c4117ec2cf9346215afaed8155af1e7933818b/websockets-17.4-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:1962f3bfde085af18878f1bb1aafb300c9a6ac33da886d0b0d97e33c9ce7a222", size = 226099, upload-time = "2026-10-30T15:10:06.588Z" }, + { url = "https://files.pythonhosted.org/packages/8d/01/d8c11740231b63d1aba6bad6b1d4e72e8384b26c5448801da238ebe82c92/websockets-17.4-cp315-cp315t-musllinux_1_2_s390x.whl", hash = "sha256:42d7a6e818214336cf7af9a3aae5c6923f94f09fa07ac5aab98268ba2a98a6d5", size = 226956, upload-time = "2026-10-30T15:10:08.141Z" }, + { url = "https://files.pythonhosted.org/packages/99/87/dbfd43ae01ea8fdb7478a1b3d58b32aca83bb9c4aa61ebe187d1e188ac8e/websockets-17.4-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:c9f8fdb7bbefc4907c2bb3593f810f2b67a2d5329e1d38724a1aa3d763cf63eb", size = 227253, upload-time = "2026-10-30T15:10:09.533Z" }, + { url = "https://files.pythonhosted.org/packages/bf/8e/fbd968a75428063560ada02d564de8d6c49ca34ec29dfb78e5d900f4b0ef/websockets-17.4-cp315-cp315t-win32.whl", hash = "sha256:506623128d7a55b726a5a46e4c9a8eae4c9dd0f04ff60b041fe7df85b9d034fe", size = 218877, upload-time = "2026-10-30T15:10:10.925Z" }, + { url = "https://files.pythonhosted.org/packages/f9/53/8f37a3943517bba77fc86f7c4162c455018c5b6d760c5e9c9a11de9e37f7/websockets-17.4-cp315-cp315t-win_amd64.whl", hash = "sha256:6e6558efbb256b532c9f06a21ba42bcac729718e365c505819f181f25e5c0eca", size = 219195, upload-time = "2026-10-30T15:10:12.336Z" }, + { url = "https://files.pythonhosted.org/packages/69/35/cf33cba7248fcd80cfe5911ffe67aa2637f50c2bfaada123b1e9d2aeca90/websockets-17.4-cp315-cp315t-win_arm64.whl", hash = "sha256:fcac44d917672ad6257ad64b80b5168306f168a78cab5c0612e4c699caed18cf", size = 219117, upload-time = "2026-10-30T15:10:13.771Z" }, + { url = "https://files.pythonhosted.org/packages/a0/80/78c580302991d229ac5ad0a00c361916f7f84deaf6dd76370034dd8e7383/websockets-17.4-pp311-pypy311_pp80-macosx_10_15_x86_64.whl", hash = "sha256:73b00645316121105274fd266ed54a20e6514650126d399cdea39876ab1e7b04", size = 216364, upload-time = "2026-10-30T15:10:15.472Z" }, + { url = "https://files.pythonhosted.org/packages/d9/27/7d18d381994c7c27a855131ae064ff43ec00ded636b7c6ead4abb4cec841/websockets-17.4-pp311-pypy311_pp80-macosx_11_0_arm64.whl", hash = "sha256:02f380df26de14999ecace203fe1396ac14d1c6132afc7924eb6f8c8b646c69d", size = 216642, upload-time = "2026-10-30T15:10:17.153Z" }, + { url = "https://files.pythonhosted.org/packages/fc/91/43e73997fbdc7ef3cb434148888329113a07b66d97a8ea6aa2f93e574028/websockets-17.4-pp311-pypy311_pp80-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:f5b1d315a615cec81a79e2ce3a94221dc5c23e7fd4012897085d3b5e5a5638d0", size = 217587, upload-time = "2026-10-30T15:10:19.123Z" }, + { url = "https://files.pythonhosted.org/packages/a8/17/5e3e6be945512aff7351c9f60134803902ccb07cd7d6c9becdfa349a32d5/websockets-17.4-pp311-pypy311_pp80-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:046ed16d3d83d64594e4a40655fef061ccf36059d8c30a01feca8a9481fe13b8", size = 217478, upload-time = "2026-10-30T15:10:20.665Z" }, + { url = "https://files.pythonhosted.org/packages/7d/5f/0a1ee98aeff04c200492a479a386ff106d1ef6d5c9d6613959b3e3d79469/websockets-17.4-pp311-pypy311_pp80-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f772007dfba8941873dbd276b6a6845428cc740888b5c6c37bf483b1ea34b42", size = 218371, upload-time = "2026-10-30T15:10:22.35Z" }, + { url = "https://files.pythonhosted.org/packages/17/97/acb333fa9a54bb1ad616c1add65185f9ab580c3c76366a3d1abc1090979b/websockets-17.4-pp311-pypy311_pp80-win_amd64.whl", hash = "sha256:accb5e9492b9bc9c9aeec5b72ea8f2ddcbefc6143d1c626fba960ecbdc89807e", size = 306811, upload-time = "2026-10-30T15:10:23.76Z" }, + { url = "https://files.pythonhosted.org/packages/e9/a3/d8fbc72c5c0e78905caf2d6dcf806e532451e3f48e2a09a8ebe1de9ad412/websockets-17.4-pp312-pypy312_pp80-macosx_10_15_x86_64.whl", hash = "sha256:c7f66a53e9b7ec831abb15e3d9b6cee8f52d6a24cd0a374786bf46c3ec218bc6", size = 216397, upload-time = "2026-10-30T15:10:25.255Z" }, + { url = "https://files.pythonhosted.org/packages/d3/de/1bf313cd0f4662df4884a7602932cd13347090e59dd6047865eee2bb5aa5/websockets-17.4-pp312-pypy312_pp80-macosx_11_0_arm64.whl", hash = "sha256:4fb2db1f649b6464711846b5bb9c1611bd906ce939d9460cbd1fa419552cd6c3", size = 216664, upload-time = "2026-10-30T15:10:27.016Z" }, + { url = "https://files.pythonhosted.org/packages/30/e2/7912bd417511b54907853bd495aef2daee111062dbafd43d133a3f7253a7/websockets-17.4-pp312-pypy312_pp80-manylinux1_i686.manylinux_2_28_i686.manylinux_2_5_i686.whl", hash = "sha256:32110d954d9d0e51f36edb0396673bf4d35193a0a80ba7013bf7f7d58a33ca07", size = 217603, upload-time = "2026-10-30T15:10:28.475Z" }, + { url = "https://files.pythonhosted.org/packages/56/6f/2e8d5610f6184a2e1720bf8ce256402ed99ad30ea87c461fba5bc4d651d9/websockets-17.4-pp312-pypy312_pp80-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:88ba8a439b2bad97bb69c38db5bf0ec16a061ee834cf0f244089186ee803e899", size = 217489, upload-time = "2026-10-30T15:10:29.999Z" }, + { url = "https://files.pythonhosted.org/packages/29/3a/a05bc57eadcd7e8e072d917888128e6d22e1203984afb21a8da3198982fe/websockets-17.4-pp312-pypy312_pp80-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:868744c68e9342768888c7326604da2228c19bb6946aa46b5f9e1ac32ea8d40b", size = 218356, upload-time = "2026-10-30T15:10:31.432Z" }, + { url = "https://files.pythonhosted.org/packages/b2/49/eed86bfb8863093a82cbaa52c9159be1ce2374d5ace6fe1f8e8031567e7d/websockets-17.4-pp312-pypy312_pp80-win_amd64.whl", hash = "sha256:829bcaa90be8737c132d9515d6a466e8528e3b3d050d3f3466f36ea94d3beb48", size = 306838, upload-time = "2026-10-30T15:10:32.954Z" }, + { url = "https://files.pythonhosted.org/packages/eb/27/9db924cb0dbf22eade78d98fbae77790f9bf6bc729e6ab29aef9d68e4156/websockets-17.4-py3-none-any.whl", hash = "sha256:c6bd2c9781915592b209160d0f017d4c7c82ad53075e6b0c24d2a89299e7f9e9", size = 212900, upload-time = "2026-10-30T15:10:34.482Z" }, +] + [[package]] name = "zipp" version = "3.23.1" -source = { registry = "https://socket-firewall-vm.tail791009.ts.net:8443/pypi/simple/" } +source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/30/21/093488dfc7cc8964ded15ab726fad40f25fd3d788fd741cc1c5a17d78ee8/zipp-3.23.1.tar.gz", hash = "sha256:32120e378d32cd9714ad503c1d024619063ec28aad2248dc6672ad13edfa5110", size = 25965, upload-time = "2026-04-13T23:21:46.6Z" } wheels = [ { url = "https://files.pythonhosted.org/packages/08/8a/0861bec20485572fbddf3dfba2910e38fe249796cb73ecdeb74e07eeb8d3/zipp-3.23.1-py3-none-any.whl", hash = "sha256:0b3596c50a5c700c9cb40ba8d86d9f2cc4807e9bedb06bcdf7fac85633e444dc", size = 10378, upload-time = "2026-04-13T23:21:45.386Z" }, From 7b7ecaeefb69eadf63a04c33fd98d6930cabb37e Mon Sep 17 00:00:00 2001 From: daniel-panhead Date: Mon, 23 Nov 2026 23:58:49 +0000 Subject: [PATCH 3/7] [PROD-871] gumloop browser proxy link keeps this computer connected in the background Co-authored-by: Cursor --- README.md | 12 + docs/client-capabilities.md | 1 + src/gumloop/cli/commands/auth.py | 27 +- src/gumloop/cli/commands/browser.py | 4 +- src/gumloop/cli/commands/linked_proxy.py | 321 ++++++++++++++++++ src/gumloop/cli/linked_proxy_key.py | 68 +++- src/gumloop/cli/linked_proxy_lock.py | 43 +++ src/gumloop/cli/linked_proxy_service.py | 191 +++++++++++ .../skills/gumloop-cli/references/commands.md | 12 +- src/gumloop/linked_proxy/connection.py | 81 ++++- src/gumloop/linked_proxy/tls_check.py | 38 +++ src/gumloop/types.py | 2 + tests/cli/test_linked_proxy_command.py | 233 +++++++++++++ tests/cli/test_linked_proxy_key.py | 10 +- tests/cli/test_linked_proxy_service.py | 80 +++++ tests/linked_proxy/test_connection.py | 140 +++++++- tests/linked_proxy/test_tls_check.py | 68 ++++ tests/sdk/test_linked_proxies.py | 2 +- 18 files changed, 1298 insertions(+), 35 deletions(-) create mode 100644 src/gumloop/cli/commands/linked_proxy.py create mode 100644 src/gumloop/cli/linked_proxy_lock.py create mode 100644 src/gumloop/cli/linked_proxy_service.py create mode 100644 src/gumloop/linked_proxy/tls_check.py create mode 100644 tests/cli/test_linked_proxy_command.py create mode 100644 tests/cli/test_linked_proxy_service.py create mode 100644 tests/linked_proxy/test_tls_check.py diff --git a/README.md b/README.md index bc40b26..5edfe19 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,18 @@ curl -fsSL https://gumloop.com/cli/import-logins.sh | sh Cookies only: local storage and IndexedDB stay on your machine, so sites that keep the session there ask the agent to sign in once, after which the agent's browser keeps it. Imported cookies are encrypted with the profile's own key before storage and are never shown back in the UI or API; sign-ins the agent picks up while running are saved back to the same profile. Rename, remove sites from, or delete profiles on the Secrets page in Gumloop. +### Let your agents' browser go out through this computer + +Sites that only accept sign-ins from your network or your IP can be reached by linking this computer: your agents' browser connects to them from here. On macOS or Linux, after `gumloop login`: + +```bash +gumloop browser proxy link # automatically runs in the background on startup +gumloop browser proxy status +gumloop browser proxy unlink +``` + +The computer only opens connections to public addresses on ports 80 and 443. Its key stays in the OS keychain. `gumloop logout` unlinks it. A network that inspects TLS traffic can't be used, since sites would show the agent's browser certificate errors. + ### Sync a folder into your Brain Mirror a local directory into a file-upload Brain source. Files are compared by name and sha256, so a re-run uploads only what changed; indexing starts on its own after each upload. diff --git a/docs/client-capabilities.md b/docs/client-capabilities.md index 872c2e5..ac4c2a6 100644 --- a/docs/client-capabilities.md +++ b/docs/client-capabilities.md @@ -22,6 +22,7 @@ The feature parity audit adds client adapters over existing APIs and selected ba | Company Brain search and uploaded-file sources | `client.brain` | `gumloop brain` | | Generated file metadata, downloads, rename, delete, versions, and sharing | `client.artifacts` | `gumloop artifacts` | | Personal browser profile CRUD and existing listing/cookie import | `client.browser_profiles` | `gumloop browser` | +| Linking this computer for agents' browser traffic | `client.linked_proxies` (register and delete only) | `gumloop browser proxy` | | Connected Brain source inspection, sync history, issues, indexed children, and sync requests | `client.brain` | `gumloop brain sources` | | Integration trigger catalog, account selection/configuration, and run history | `client.agents` trigger methods | `gumloop agents triggers` | | Team and organization membership discovery | `client.teams.list`, `client.organizations.list` | `gumloop teams list`, `gumloop organizations list` | diff --git a/src/gumloop/cli/commands/auth.py b/src/gumloop/cli/commands/auth.py index d217d52..6d83988 100644 --- a/src/gumloop/cli/commands/auth.py +++ b/src/gumloop/cli/commands/auth.py @@ -4,12 +4,15 @@ from typing import Annotated from typing import Literal +import httpx import questionary import typer +from rich.markup import escape as escape_markup from rich.prompt import Prompt from gumloop import Gumloop from gumloop import GumloopError +from gumloop.cli.commands.linked_proxy import remove_linked_proxy from gumloop.cli.console import console from gumloop.cli.console import print_json from gumloop.cli.context import CliContext @@ -18,6 +21,7 @@ from gumloop.cli.credentials import keyring_backend_name from gumloop.cli.credentials import save_credentials from gumloop.cli.errors import exit_with_error +from gumloop.cli.linked_proxy_key import backend_host from gumloop.cli.oauth import DEFAULT_REDIRECT_PORT from gumloop.cli.oauth import perform_oauth_login from gumloop.cli.oauth import revoke_oauth_token @@ -202,9 +206,17 @@ def logout( typer.Option("--json", help="Print the result as JSON."), ] = False, ) -> None: - """Clear stored Gumloop credentials.""" + """Clear stored Gumloop credentials, and unlink this computer.""" cli: CliContext = ctx.obj + # Before the revoke, which would leave no login to delete the linked proxy with. + linked_proxy_removed = False + linked_proxy_error: str | None = None + try: + linked_proxy_removed = remove_linked_proxy(cli, backend_host(cli.effective_base_url)) + except (GumloopError, httpx.HTTPError) as error: + linked_proxy_error = str(error) + # Server-side revoke first so the refresh token can't outlive the # local logout. Revoke failures never block the local clear. oauth_revoked = False @@ -220,9 +232,15 @@ def logout( clear_credentials() - payload: dict[str, object] = {"status": "ok", "oauth_revoked": oauth_revoked} + payload: dict[str, object] = { + "status": "ok", + "oauth_revoked": oauth_revoked, + "linked_proxy_removed": linked_proxy_removed, + } if revoke_failed: payload["oauth_revoke_failed"] = True + if linked_proxy_error is not None: + payload["linked_proxy_remove_failed"] = True if json_output: print_json(payload) @@ -234,3 +252,8 @@ def logout( "[yellow]Note:[/yellow] could not reach the server to revoke the refresh token; " "it will remain valid until it expires." ) + if linked_proxy_error is not None: + console.print( + "[yellow]Note:[/yellow] could not unlink this computer " + f"({escape_markup(linked_proxy_error)}). Log in again and run `gumloop browser proxy unlink`." + ) diff --git a/src/gumloop/cli/commands/browser.py b/src/gumloop/cli/commands/browser.py index 63628f5..db661d1 100644 --- a/src/gumloop/cli/commands/browser.py +++ b/src/gumloop/cli/commands/browser.py @@ -18,6 +18,7 @@ from gumloop.browser_logins import extract_site_cookies from gumloop.browser_logins import site_of_url from gumloop.browser_logins.chromium_cookies import KeychainAccessError +from gumloop.cli.commands.linked_proxy import proxy_app from gumloop.cli.console import console from gumloop.cli.console import print_json from gumloop.cli.context import CliContext @@ -28,12 +29,13 @@ from gumloop.types import BrowserProfileImportSummary browser_app = typer.Typer( - help="Bring your browser sign-ins to Gumloop agents.", + help="Bring your browser sign-ins, and this computer's network, to Gumloop agents.", no_args_is_help=True, rich_markup_mode="rich", ) profiles_app = typer.Typer(help="Manage browser profiles.", no_args_is_help=True, rich_markup_mode="rich") browser_app.add_typer(profiles_app, name="profiles") +browser_app.add_typer(proxy_app, name="proxy") def _pick_local_profile(browser: str | None, browser_profile: str | None, *, non_interactive: bool) -> LocalProfile: diff --git a/src/gumloop/cli/commands/linked_proxy.py b/src/gumloop/cli/commands/linked_proxy.py new file mode 100644 index 0000000..310a171 --- /dev/null +++ b/src/gumloop/cli/commands/linked_proxy.py @@ -0,0 +1,321 @@ +from __future__ import annotations + +import asyncio +import os +import socket +import sys +from datetime import datetime +from datetime import timezone +from typing import Annotated + +import httpx +import keyring.errors +import typer +from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey +from pydantic import ValidationError +from rich.markup import escape as escape_markup + +from gumloop import APIStatusError +from gumloop import GumloopError +from gumloop._client import DEFAULT_BASE_URL +from gumloop._version import __version__ +from gumloop.cli.console import console +from gumloop.cli.console import error_console +from gumloop.cli.console import print_json +from gumloop.cli.context import CliContext +from gumloop.cli.credentials import Credentials +from gumloop.cli.credentials import load_credentials +from gumloop.cli.errors import exit_with_error +from gumloop.cli.linked_proxy_key import LinkedProxyConnectionStatus +from gumloop.cli.linked_proxy_key import LinkedProxyRegistration +from gumloop.cli.linked_proxy_key import backend_host +from gumloop.cli.linked_proxy_key import forget +from gumloop.cli.linked_proxy_key import forget_connection_status +from gumloop.cli.linked_proxy_key import forget_registration +from gumloop.cli.linked_proxy_key import load_connection_status +from gumloop.cli.linked_proxy_key import load_or_create_key +from gumloop.cli.linked_proxy_key import load_registration +from gumloop.cli.linked_proxy_key import save_connection_status +from gumloop.cli.linked_proxy_key import save_registration +from gumloop.cli.linked_proxy_lock import is_running +from gumloop.cli.linked_proxy_lock import linked_proxy_lock +from gumloop.cli.linked_proxy_service import LinkedProxyService +from gumloop.cli.linked_proxy_service import gumloop_executable +from gumloop.cli.linked_proxy_service import service_for_current_platform +from gumloop.linked_proxy.connection import GatewayConnection +from gumloop.linked_proxy.connection import GatewayTokenUnavailable +from gumloop.linked_proxy.connection import SignedOut +from gumloop.linked_proxy.connection import SignInRefused +from gumloop.linked_proxy.destinations import Target +from gumloop.linked_proxy.sign_in import public_key_text +from gumloop.linked_proxy.tls_check import TlsInspected +from gumloop.linked_proxy.tls_check import check_tls_not_inspected + +proxy_app = typer.Typer( + help="Let your agents' browser go out to the internet through this computer.", + no_args_is_help=True, + rich_markup_mode="rich", +) + +_NAME_MAX_LENGTH = 100 +_CREDENTIAL_OVERRIDES = ("GUMLOOP_ACCESS_TOKEN", "GUMLOOP_API_KEY", "GUMLOOP_USER_ID") + + +@proxy_app.command( + "link", + epilog="Examples:\n gumloop browser proxy link\n gumloop browser proxy link --name 'Office desktop'", +) +def link( + ctx: typer.Context, + name: Annotated[ + str | None, + typer.Option( + "--name", help="Name for this computer in Gumloop when it is first linked. Default: its hostname." + ), + ] = None, +) -> None: + """Link this computer and keep it connected in the background, also after a restart.""" + cli: CliContext = ctx.obj + host = backend_host(cli.effective_base_url) + try: + if not _signed_in(host): + raise GumloopError(f"Run `gumloop login` first. Linking this computer needs a stored login for {host}.") + # The background service runs as the stored login, so it couldn't connect a computer added as anyone else. + overrides = [variable for variable in _CREDENTIAL_OVERRIDES if os.environ.get(variable)] + if overrides: + raise GumloopError( + f"Linking this computer can't use {', '.join(overrides)}. " + "Save the login with `gumloop login`, then retry." + ) + service = service_for_current_platform() + executable = gumloop_executable() + check_tls_not_inspected() + key = load_or_create_key(host) + if load_registration(host) is None: + _register(cli, host, key, name) + service.install(executable) + except TlsInspected as error: + exit_with_error(_tls_inspected_error(error)) + except (GumloopError, ValidationError) as error: + exit_with_error(error) + + console.print("Connected. Your agents' browser now goes out through this computer.") + if sys.platform.startswith("linux"): + console.print("[dim]It connects when you log in, once your keyring is unlocked.[/dim]") + + +@proxy_app.command("status") +def status( + ctx: typer.Context, + json_output: Annotated[bool, typer.Option("--json", help="Print the status as JSON.")] = False, +) -> None: + """Show whether this computer is linked and whether it is connected.""" + cli: CliContext = ctx.obj + host = backend_host(cli.effective_base_url) + registration = load_registration(host) + service = _service_or_none() + service_installed = service is not None and service.is_installed() + running = registration is not None and is_running(host) + connection = load_connection_status(host) if running else None + if registration is None: + state = None + elif not running: + state = "not_running" + else: + state = "connected" if connection and connection.connected else "connecting" + if json_output: + print_json( + { + "backend": host, + "linked_proxy_id": registration.linked_proxy_id if registration else None, + "name": registration.name if registration else None, + "service_installed": service_installed, + "state": state, + "since": connection.since.isoformat() if connection else None, + "last_error": connection.last_error if connection else None, + } + ) + return + + if registration is None: + console.print("This computer is not linked. Run `gumloop browser proxy link`.") + return + prefix = f'"{escape_markup(registration.name)}"' + if not running: + console.print(f"{prefix}: not running. Run `gumloop browser proxy link` to start.") + elif connection and connection.connected: + console.print(f"{prefix}: connected since {_clock_time(connection.since)}.") + elif connection and connection.last_error: + console.print(f"{prefix}: connecting. Last attempt failed: {escape_markup(connection.last_error)}.") + else: + console.print(f"{prefix}: connecting.") + + +@proxy_app.command("unlink") +def unlink(ctx: typer.Context) -> None: + """Unlink this computer from Gumloop, and delete its key from this computer.""" + cli: CliContext = ctx.obj + host = backend_host(cli.effective_base_url) + try: + removed = remove_linked_proxy(cli, host) + except (GumloopError, httpx.HTTPError) as error: + exit_with_error(error) + if removed: + console.print("Unlinked this computer and deleted its key.") + else: + console.print("This computer is not linked.") + + +def remove_linked_proxy(cli: CliContext, host: str) -> bool: + """Returns whether there was a linked proxy to unlink. When Gumloop can't + delete it, the key and registration stay so the removal can be retried.""" + login_host = _login_host(_stored_credentials()) + service_still_needed = login_host != host and load_registration(login_host) is not None + service = None if service_still_needed else _service_or_none() + registration = load_registration(host) + service_installed = service is not None and service.is_installed() + if service is not None and service_installed: + service.remove() + if registration is not None: + linked_proxy_id = registration.linked_proxy_id + try: + cli.call_with_refresh(lambda client: client.linked_proxies.delete(linked_proxy_id)) + except APIStatusError as error: + if error.status_code != 404: + raise + forget(host) + return service_installed or registration is not None + + +@proxy_app.command("run", hidden=True) +def run(ctx: typer.Context) -> None: + """What the background service runs. A clean exit means the service should stay down.""" + cli: CliContext = ctx.obj + host = backend_host(cli.effective_base_url) + try: + with linked_proxy_lock(host): + registration = load_registration(host) + if registration is None: + error_console.print("This computer is not linked. Run `gumloop browser proxy link`.") + return + check_tls_not_inspected() + linked_proxy_id = registration.linked_proxy_id + connection = GatewayConnection( + gateway_url=registration.gateway_url, + linked_proxy_id=linked_proxy_id, + key=load_or_create_key(host), + signed_in=lambda: _signed_in(host), + gateway_token=lambda: _gateway_token(host, linked_proxy_id), + on_open=_print_destination, + on_connected=lambda: _record_connection(host, connected=True), + on_failed=lambda error: _record_connection(host, connected=False, last_error=error), + ) + _record_connection(host, connected=False) + try: + asyncio.run(connection.run()) + finally: + forget_connection_status(host) + except TlsInspected as error: + exit_with_error(_tls_inspected_error(error)) + except SignInRefused: + forget_registration(host) + error_console.print( + "Gumloop refused this computer: it was removed, or you can no longer use personal proxies. " + "Run `gumloop browser proxy link` to link it again." + ) + except SignedOut: + error_console.print("You logged out of Gumloop, so this computer disconnected.") + except KeyboardInterrupt: + console.print("Stopped.") + except GumloopError as error: + exit_with_error(error) + + +def _signed_in(host: str) -> bool: + """A stored login for this backend. Logging out, or in to another backend, stops the linked proxy.""" + credentials = _stored_credentials() + return credentials.has_any and _login_host(credentials) == host + + +def _stored_credentials() -> Credentials: + try: + return load_credentials() + except keyring.errors.KeyringError as error: + raise GumloopError(f"Could not read your Gumloop login from the OS keychain: {error}") from error + + +def _login_host(credentials: Credentials) -> str: + """The backend the background service serves, whatever overrides the current command has.""" + return backend_host(credentials.base_url or DEFAULT_BASE_URL) + + +def _gateway_token(host: str, linked_proxy_id: str) -> str: + """A 403 or 404 means the linked proxy was unlinked or its owner can't use it anymore.""" + # The service outlives logins, so each request uses the login stored now, not the one it started with. + credentials = _stored_credentials() + if not credentials.has_any or _login_host(credentials) != host: + raise SignedOut() + try: + response = CliContext(credentials=credentials).call_with_refresh( + lambda client: client.linked_proxies.create_gateway_token(linked_proxy_id) + ) + except APIStatusError as error: + if error.status_code in (403, 404): + raise SignInRefused(str(error)) from error + raise GatewayTokenUnavailable(f"Gumloop didn't give a gateway token (HTTP {error.status_code})") from error + except (GumloopError, httpx.HTTPError) as error: + raise GatewayTokenUnavailable(f"Gumloop didn't give a gateway token ({error})") from error + return response.gateway_token + + +def _register(cli: CliContext, host: str, key: Ed25519PrivateKey, name: str | None) -> LinkedProxyRegistration: + machine_name = socket.gethostname() + response = cli.call_with_refresh( + lambda client: client.linked_proxies.register_cli( + name=name or machine_name[:_NAME_MAX_LENGTH], + public_key=public_key_text(key), + machine_name=machine_name, + cli_version=__version__, + ) + ) + registration = LinkedProxyRegistration( + linked_proxy_id=response.linked_proxy.id, + name=response.linked_proxy.name, + gateway_url=response.gateway_url, + ) + save_registration(host, registration) + added_name = escape_markup(response.linked_proxy.name) + console.print(f"Linked this computer to Gumloop as '{added_name}'.") + return registration + + +def _service_or_none() -> LinkedProxyService | None: + try: + return service_for_current_platform() + except GumloopError: + return None + + +def _tls_inspected_error(error: TlsInspected) -> GumloopError: + return GumloopError( + f"This network inspects TLS traffic ({error}), so sites would show your agents' browser " + "certificate errors. Use this computer on a network without TLS inspection." + ) + + +def _record_connection(host: str, *, connected: bool, last_error: str | None = None) -> None: + save_connection_status( + host, + LinkedProxyConnectionStatus(connected=connected, since=datetime.now(timezone.utc), last_error=last_error), + ) + + +def _clock_time(moment: datetime) -> str: + local = moment.astimezone() + if local.date() == datetime.now().astimezone().date(): + return local.strftime("%-I:%M %p") + return local.strftime("%b %-d, %-I:%M %p") + + +def _print_destination(target: Target) -> None: + console.print(f"[dim]{escape_markup(target.host)}:{target.port}[/dim]") diff --git a/src/gumloop/cli/linked_proxy_key.py b/src/gumloop/cli/linked_proxy_key.py index c5912bd..3ffc004 100644 --- a/src/gumloop/cli/linked_proxy_key.py +++ b/src/gumloop/cli/linked_proxy_key.py @@ -1,11 +1,12 @@ """This machine's linked proxy on one backend: the Ed25519 key it signs in to the -linked proxy gateway with, kept in the OS keychain, and the linked proxy that key -registered as.""" +linked proxy gateway with, kept in the OS keychain, the linked proxy that key +registered as, and whether its tunnel is connected.""" from __future__ import annotations import base64 import os +from datetime import datetime from pathlib import Path from urllib.parse import urlsplit @@ -32,6 +33,7 @@ class LinkedProxyRegistration(BaseModel): model_config = ConfigDict(extra="forbid") linked_proxy_id: str = Field(min_length=1) + name: str = Field(min_length=1) gateway_url: str = Field(min_length=1) @field_validator("gateway_url") @@ -44,6 +46,17 @@ def _require_encrypted_gateway(cls, gateway_url: str) -> str: raise ValueError("the linked proxy gateway must use wss:// unless it runs on this computer") +class LinkedProxyConnectionStatus(BaseModel): + """Written by the running linked proxy; stale once it no longer holds the lock.""" + + model_config = ConfigDict(extra="forbid") + + connected: bool + # When this status was recorded: the connect, or the start of the current attempt or failure. + since: datetime + last_error: str | None = None + + def backend_host(base_url: str) -> str: """Each backend gets its own key and registration, so staging and production never share one.""" return urlsplit(base_url).netloc @@ -75,18 +88,57 @@ def load_registration(host: str, home: Path | None = None) -> LinkedProxyRegistr def save_registration(host: str, registration: LinkedProxyRegistration, home: Path | None = None) -> None: - destination = _registration_path(host, home) + _write_private(_registration_path(host, home), registration.model_dump_json()) + + +def forget_registration(host: str, home: Path | None = None) -> None: + _registration_path(host, home).unlink(missing_ok=True) + + +def load_connection_status(host: str, home: Path | None = None) -> LinkedProxyConnectionStatus | None: + try: + return LinkedProxyConnectionStatus.model_validate_json(_status_path(host, home).read_text(encoding="utf-8")) + except (OSError, ValidationError): + return None + + +def save_connection_status(host: str, status: LinkedProxyConnectionStatus, home: Path | None = None) -> None: + _write_private(_status_path(host, home), status.model_dump_json()) + + +def forget_connection_status(host: str, home: Path | None = None) -> None: + _status_path(host, home).unlink(missing_ok=True) + + +def forget(host: str, home: Path | None = None) -> None: + """Deletes the key, the registration and the connection status. The linked proxy + stays in Gumloop until it is deleted there.""" + try: + keyring.delete_password(KEYRING_SERVICE, _key_account(host)) + except keyring.errors.PasswordDeleteError: + pass + except keyring.errors.KeyringError as error: + raise GumloopError(f"Could not delete the linked proxy key from the OS keychain: {error}") from error + forget_registration(host, home) + forget_connection_status(host, home) + + +def _key_account(host: str) -> str: + return f"linked-proxy:{host}" + + +def _write_private(destination: Path, text: str) -> None: destination.parent.mkdir(mode=0o700, parents=True, exist_ok=True) staging = destination.with_name(f".{destination.name}.tmp") descriptor = os.open(staging, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600) with os.fdopen(descriptor, "w", encoding="utf-8") as file: - file.write(registration.model_dump_json()) + file.write(text) os.replace(staging, destination) -def _key_account(host: str) -> str: - return f"linked-proxy:{host}" - - def _registration_path(host: str, home: Path | None) -> Path: return (home or Path.home()) / ".gumloop" / "linked-proxy" / f"{host}.json" + + +def _status_path(host: str, home: Path | None) -> Path: + return (home or Path.home()) / ".gumloop" / "linked-proxy" / f"{host}.status.json" diff --git a/src/gumloop/cli/linked_proxy_lock.py b/src/gumloop/cli/linked_proxy_lock.py new file mode 100644 index 0000000..86a9a55 --- /dev/null +++ b/src/gumloop/cli/linked_proxy_lock.py @@ -0,0 +1,43 @@ +from __future__ import annotations + +import fcntl +from collections.abc import Iterator +from contextlib import contextmanager +from pathlib import Path + +from gumloop import GumloopError + + +@contextmanager +def linked_proxy_lock(host: str, home: Path | None = None) -> Iterator[None]: + """Held while the linked proxy runs, so a second one on this machine stops + instead of competing for the gateway's one connection per linked proxy.""" + path = _lock_path(host, home) + try: + path.parent.mkdir(mode=0o700, parents=True, exist_ok=True) + handle = path.open("a+", encoding="utf-8") + except OSError as error: + raise GumloopError(f"Could not create the lock file {path}: {error}") from error + try: + fcntl.flock(handle.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB) + except BlockingIOError as error: + handle.close() + raise GumloopError("This computer is already connected as a linked proxy.") from error + try: + yield + finally: + handle.close() + + +def is_running(host: str, home: Path | None = None) -> bool: + if not _lock_path(host, home).exists(): + return False + try: + with linked_proxy_lock(host, home): + return False + except GumloopError: + return True + + +def _lock_path(host: str, home: Path | None) -> Path: + return (home or Path.home()) / ".gumloop" / "linked-proxy" / f"{host}.lock" diff --git a/src/gumloop/cli/linked_proxy_service.py b/src/gumloop/cli/linked_proxy_service.py new file mode 100644 index 0000000..adabb01 --- /dev/null +++ b/src/gumloop/cli/linked_proxy_service.py @@ -0,0 +1,191 @@ +"""Runs ``gumloop browser proxy run`` in the background: a LaunchAgent on +macOS, a systemd user unit on Linux. Both start it at login and restart it +after a failure, but not after a clean exit, which is how it stops once the +user logs out or Gumloop refuses the linked proxy.""" + +from __future__ import annotations + +import os +import plistlib +import shutil +import subprocess +import sys +import tempfile +from collections.abc import Callable +from collections.abc import Sequence +from pathlib import Path +from typing import Protocol + +from gumloop import GumloopError + +LAUNCH_AGENT_LABEL = "com.gumloop.linked-proxy" +SYSTEMD_UNIT = "gumloop-linked-proxy.service" +_RUN_ARGUMENTS = ("browser", "proxy", "run") +_RESTART_SECONDS = 30 +_SAFE_PATH = "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" +# Credentials come from the keychain, never from the shell that ran `add`. +_CLEARED_ENVIRONMENT = ( + "GUMLOOP_ACCESS_TOKEN", + "GUMLOOP_API_KEY", + "GUMLOOP_BASE_URL", + "GUMLOOP_TEAM_ID", + "GUMLOOP_USER_ID", +) + +CommandRunner = Callable[[Sequence[str]], subprocess.CompletedProcess[str]] + + +class LinkedProxyService(Protocol): + def install(self, executable_path: Path) -> None: + """Writes the service and (re)starts it.""" + ... + + def remove(self) -> None: ... + + def is_installed(self) -> bool: ... + + +class LaunchAgentService: + def __init__( + self, + *, + home: Path, + run_command: CommandRunner | None = None, + get_uid: Callable[[], int] | None = None, + ) -> None: + self._home = home + self._run_command = run_command or _run_command + self._get_uid = get_uid or os.getuid + + @property + def plist_path(self) -> Path: + return self._home / "Library" / "LaunchAgents" / f"{LAUNCH_AGENT_LABEL}.plist" + + def install(self, executable_path: Path) -> None: + log_path = self._home / ".gumloop" / "linked-proxy" / "service.log" + try: + log_path.parent.mkdir(mode=0o700, parents=True, exist_ok=True) + except OSError as error: + raise GumloopError(f"Could not create {log_path.parent}: {error}") from error + payload = { + "EnvironmentVariables": { + **dict.fromkeys(_CLEARED_ENVIRONMENT, ""), + "HOME": str(self._home), + "PATH": _SAFE_PATH, + }, + "KeepAlive": {"SuccessfulExit": False}, + "Label": LAUNCH_AGENT_LABEL, + "ProgramArguments": [str(executable_path), *_RUN_ARGUMENTS], + "RunAtLoad": True, + "StandardErrorPath": str(log_path), + "ThrottleInterval": _RESTART_SECONDS, + } + _write_private(self.plist_path, plistlib.dumps(payload, fmt=plistlib.FMT_XML, sort_keys=True)) + self._run_command(["launchctl", "bootout", self._job_target()]) + _check(self._run_command(["launchctl", "bootstrap", f"gui/{self._get_uid()}", str(self.plist_path)])) + + def remove(self) -> None: + self._run_command(["launchctl", "bootout", self._job_target()]) + _unlink(self.plist_path) + + def is_installed(self) -> bool: + return self.plist_path.is_file() + + def _job_target(self) -> str: + return f"gui/{self._get_uid()}/{LAUNCH_AGENT_LABEL}" + + +class SystemdUserService: + def __init__(self, *, config_home: Path, run_command: CommandRunner | None = None) -> None: + self._config_home = config_home + self._run_command = run_command or _run_command + + @property + def unit_path(self) -> Path: + return self._config_home / "systemd" / "user" / SYSTEMD_UNIT + + def install(self, executable_path: Path) -> None: + command = " ".join(_systemd_quote(part) for part in [str(executable_path), *_RUN_ARGUMENTS]) + unit = ( + "[Unit]\n" + "Description=Gumloop linked proxy\n" + "After=network-online.target\n" + "\n" + "[Service]\n" + f"ExecStart={command}\n" + f"UnsetEnvironment={' '.join(_CLEARED_ENVIRONMENT)}\n" + "Restart=on-failure\n" + f"RestartSec={_RESTART_SECONDS}\n" + "\n" + "[Install]\n" + "WantedBy=default.target\n" + ) + _write_private(self.unit_path, unit.encode()) + _check(self._systemctl("daemon-reload")) + _check(self._systemctl("enable", SYSTEMD_UNIT)) + _check(self._systemctl("restart", SYSTEMD_UNIT)) + + def remove(self) -> None: + self._systemctl("disable", "--now", SYSTEMD_UNIT) + _unlink(self.unit_path) + self._systemctl("daemon-reload") + + def is_installed(self) -> bool: + return self.unit_path.is_file() + + def _systemctl(self, *args: str) -> subprocess.CompletedProcess[str]: + return self._run_command(["systemctl", "--user", *args]) + + +def service_for_current_platform(*, home: Path | None = None) -> LinkedProxyService: + home = home or Path.home() + if sys.platform == "darwin": + return LaunchAgentService(home=home) + if sys.platform.startswith("linux"): + return SystemdUserService(config_home=Path(os.environ.get("XDG_CONFIG_HOME") or home / ".config")) + raise GumloopError("`gumloop browser proxy` runs on macOS and Linux only.") + + +def gumloop_executable() -> Path: + found = shutil.which("gumloop") + if found is None: + raise GumloopError( + "Could not find the `gumloop` command on PATH, so this computer can't stay connected in the background." + ) + return Path(found).absolute() + + +def _systemd_quote(value: str) -> str: + escaped = value.replace("\\", "\\\\").replace('"', '\\"').replace("%", "%%").replace("$", "$$") + return f'"{escaped}"' + + +def _write_private(destination: Path, content: bytes) -> None: + try: + destination.parent.mkdir(parents=True, exist_ok=True) + with tempfile.NamedTemporaryFile(dir=destination.parent, prefix=f".{destination.name}.", delete=False) as file: + os.chmod(file.name, 0o600) + file.write(content) + os.replace(file.name, destination) + except OSError as error: + raise GumloopError(f"Could not write {destination}: {error}") from error + + +def _unlink(path: Path) -> None: + try: + path.unlink(missing_ok=True) + except OSError as error: + raise GumloopError(f"Could not remove {path}: {error}") from error + + +def _check(result: subprocess.CompletedProcess[str]) -> None: + if result.returncode != 0: + command = " ".join(str(part) for part in result.args) + raise GumloopError(f"`{command}` failed: {result.stderr.strip() or result.returncode}") + + +def _run_command(args: Sequence[str]) -> subprocess.CompletedProcess[str]: + try: + return subprocess.run(list(args), check=False, capture_output=True, text=True, timeout=10) + except (OSError, subprocess.SubprocessError) as error: + raise GumloopError(f"Could not run `{args[0]}`: {error}") from error diff --git a/src/gumloop/cli/plugin_assets/gumloop/skills/gumloop-cli/references/commands.md b/src/gumloop/cli/plugin_assets/gumloop/skills/gumloop-cli/references/commands.md index 9ba88e5..182d694 100644 --- a/src/gumloop/cli/plugin_assets/gumloop/skills/gumloop-cli/references/commands.md +++ b/src/gumloop/cli/plugin_assets/gumloop/skills/gumloop-cli/references/commands.md @@ -9,7 +9,7 @@ gumloop login # interactive: pick OAuth (browser) or AP gumloop login --method oauth # OAuth; add --no-browser to print the URL instead gumloop login --api-key gum_xxx --user-id user_abc echo "$GUMLOOP_API_KEY" | gumloop login --api-key - --user-id user_abc # keep key out of history -gumloop logout # clears keychain entries, revokes OAuth refresh token +gumloop logout # clears keychain entries, revokes OAuth refresh token, unlinks this computer ``` Environment variables (override stored credentials for one invocation; ideal for CI): @@ -148,6 +148,16 @@ gumloop sync # enroll persistent sync (macOS) of org-ma gumloop sync --once --non-interactive # one-shot sync; requires GUMLOOP_API_KEY + GUMLOOP_USER_ID ``` +## Linked proxy + +```bash +gumloop browser proxy link # automatically runs in the background on startup +gumloop browser proxy status +gumloop browser proxy unlink +``` + +macOS and Linux only. Needs a stored `gumloop login`; logging out unlinks this computer. + ## Maintenance ```bash diff --git a/src/gumloop/linked_proxy/connection.py b/src/gumloop/linked_proxy/connection.py index 096d71c..0c57b8d 100644 --- a/src/gumloop/linked_proxy/connection.py +++ b/src/gumloop/linked_proxy/connection.py @@ -5,15 +5,14 @@ from __future__ import annotations import asyncio -import functools import random -import ssl import time from collections.abc import Awaitable from collections.abc import Callable from contextlib import AbstractAsyncContextManager +from datetime import datetime +from datetime import timezone -import certifi from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey from websockets.asyncio.client import connect as websocket_connect from websockets.exceptions import ConnectionClosed @@ -25,8 +24,10 @@ from gumloop.linked_proxy.frames import MAX_FRAME_LENGTH from gumloop.linked_proxy.frames import ProtocolError from gumloop.linked_proxy.sign_in import sign_in_token +from gumloop.linked_proxy.tls_check import tls_context from gumloop.linked_proxy.tunnel import Connection from gumloop.linked_proxy.tunnel import Tunnel +from gumloop.types import LinkedProxyGatewayToken # The gateway's close code and refusal header for a sign-in it won't accept. CLOSE_SIGN_IN_REFUSED = 4001 @@ -39,6 +40,11 @@ STABLE_SECONDS = 60.0 _OPEN_TIMEOUT_SECONDS = 10.0 +# An open tunnel sends a fresh gateway token this long before its current one expires. +REFRESH_BEFORE_EXPIRY_SECONDS = 15 * 60.0 +# The least time between refreshes, which is also the wait before retrying a failed one. +MIN_REFRESH_SECONDS = 60.0 + Open = Callable[[str, dict[str, str]], AbstractAsyncContextManager[Connection]] @@ -66,10 +72,13 @@ def __init__( linked_proxy_id: str, key: Ed25519PrivateKey, signed_in: Callable[[], bool], - gateway_token: Callable[[], str], + gateway_token: Callable[[], LinkedProxyGatewayToken], on_open: Callable[[Target], None] | None = None, + on_connected: Callable[[], None] | None = None, + on_failed: Callable[[str], None] | None = None, open_websocket: Open | None = None, sleep: Callable[[float], Awaitable[None]] = asyncio.sleep, + refresh_sleep: Callable[[float], Awaitable[None]] = asyncio.sleep, ) -> None: self._gateway_url = gateway_url self._linked_proxy_id = linked_proxy_id @@ -77,13 +86,16 @@ def __init__( self._signed_in = signed_in self._gateway_token = gateway_token self._on_open = on_open + self._on_connected = on_connected + self._on_failed = on_failed self._open = open_websocket or _open_websocket self._sleep = sleep + self._refresh_sleep = refresh_sleep async def run(self) -> None: """Runs until it raises ``SignInRefused`` or ``SignedOut``. Every other failure reconnects after a random wait whose cap doubles up to ``MAX_RETRY_SECONDS``. - ``gateway_token`` runs in a thread before each connect, and raises + ``gateway_token`` runs in a thread before each connect and each refresh, and raises ``SignInRefused`` or ``GatewayTokenUnavailable`` when it has no token.""" retry_cap = FIRST_RETRY_SECONDS while True: @@ -96,6 +108,8 @@ async def run(self) -> None: reason = _sign_in_refusal(error) if reason is not None: raise SignInRefused(reason) from error + if self._on_failed is not None: + self._on_failed(describe_failure(error)) if time.monotonic() - started >= STABLE_SECONDS: retry_cap = FIRST_RETRY_SECONDS await self._sleep(random.uniform(FIRST_RETRY_SECONDS, retry_cap)) @@ -107,10 +121,56 @@ async def _serve(self) -> None: self._key, linked_proxy_id=self._linked_proxy_id, audience=self._gateway_url, - gateway_token=gateway_token, + gateway_token=gateway_token.gateway_token, ) async with self._open(self._gateway_url, {"Authorization": f"Bearer {token}"}) as websocket: - await Tunnel(websocket, on_open=self._on_open).run() + if self._on_connected is not None: + self._on_connected() + tunnel = Tunnel(websocket, on_open=self._on_open) + refresh = asyncio.ensure_future(self._refresh(tunnel, gateway_token)) + try: + await tunnel.run() + finally: + refresh.cancel() + await asyncio.gather(refresh, return_exceptions=True) + + async def _refresh(self, tunnel: Tunnel, gateway_token: LinkedProxyGatewayToken) -> None: + """Sends a fresh gateway token before each one expires. When Gumloop refuses one, the + gateway's own recheck closes the tunnel. A gateway token without ``expires_at`` comes + from a backend older than refreshes, whose gateway would reject one.""" + while gateway_token.expires_at is not None: + await self._refresh_sleep(_seconds_until_refresh(gateway_token.expires_at)) + try: + gateway_token = await asyncio.to_thread(self._gateway_token) + except GatewayTokenUnavailable: + continue + except (SignInRefused, SignedOut): + return + await tunnel.send_gateway_token(gateway_token.gateway_token) + + +def _seconds_until_refresh(expires_at: str) -> float: + # Python 3.10's fromisoformat rejects a trailing Z. + expiry = datetime.fromisoformat(expires_at.replace("Z", "+00:00")) + remaining = (expiry - datetime.now(timezone.utc)).total_seconds() + return max(remaining - REFRESH_BEFORE_EXPIRY_SECONDS, MIN_REFRESH_SECONDS) + + +def describe_failure(error: BaseException) -> str: + """Why a connection attempt or an open tunnel ended, in words for ``gumloop browser proxy status``.""" + if isinstance(error, ConnectionClosed): + if error.rcvd is None: + return "the connection dropped" + return f"the gateway closed the connection ({error.rcvd.reason or error.rcvd.code})" + if isinstance(error, InvalidStatus): + return f"the gateway answered HTTP {error.response.status_code}" + if isinstance(error, asyncio.TimeoutError): + return "the gateway didn't answer in time" + if isinstance(error, ProtocolError): + return f"the gateway sent an invalid message ({error})" + if isinstance(error, OSError): + return f"can't reach the gateway ({(error.strerror or str(error) or type(error).__name__).lower()})" + return str(error) or type(error).__name__ def _sign_in_refusal(error: BaseException) -> str | None: @@ -130,13 +190,8 @@ def _open_websocket(url: str, headers: dict[str, str]) -> AbstractAsyncContextMa url, additional_headers=headers, user_agent_header=user_agent(), - ssl=_tls_context() if url.startswith("wss://") else None, + ssl=tls_context() if url.startswith("wss://") else None, compression=None, max_size=MAX_FRAME_LENGTH, open_timeout=_OPEN_TIMEOUT_SECONDS, ) - - -@functools.cache -def _tls_context() -> ssl.SSLContext: - return ssl.create_default_context(cafile=certifi.where()) diff --git a/src/gumloop/linked_proxy/tls_check.py b/src/gumloop/linked_proxy/tls_check.py new file mode 100644 index 0000000..5b85555 --- /dev/null +++ b/src/gumloop/linked_proxy/tls_check.py @@ -0,0 +1,38 @@ +"""Whether this network inspects TLS. A proxy that re-signs traffic with its own +CA would show the agent's browser a certificate error on every site.""" + +from __future__ import annotations + +import functools +import socket +import ssl + +import certifi + +CHECK_HOST = "example.com" +_TIMEOUT_SECONDS = 5.0 + + +class TlsInspected(Exception): + """A public site's certificate did not chain to a public CA.""" + + +@functools.cache +def tls_context() -> ssl.SSLContext: + """Trusts certifi's roots only: a CA that inspection software adds to the OS store must not pass.""" + context = ssl.create_default_context(cafile=certifi.where()) + context.minimum_version = ssl.TLSVersion.TLSv1_2 + return context + + +def check_tls_not_inspected(host: str = CHECK_HOST, port: int = 443) -> None: + """Raises ``TlsInspected`` on a certificate error. Any other failure passes, + since the tunnel keeps retrying until the network is back.""" + try: + with socket.create_connection((host, port), timeout=_TIMEOUT_SECONDS) as raw: + with tls_context().wrap_socket(raw, server_hostname=host): + pass + except ssl.SSLCertVerificationError as error: + raise TlsInspected(error.verify_message) from error + except OSError: + return diff --git a/src/gumloop/types.py b/src/gumloop/types.py index f7174ed..0a4d99d 100644 --- a/src/gumloop/types.py +++ b/src/gumloop/types.py @@ -822,6 +822,8 @@ class CliLinkedProxyRegistration(_Model): class LinkedProxyGatewayToken(_Model): # Opaque to the CLI, which puts it in its sign-in tokens. It expires after an hour. gateway_token: str + # ISO 8601. Older backends leave it out. + expires_at: str | None = None MAX_SDP_OFFER_BYTES = 1024 * 1024 diff --git a/tests/cli/test_linked_proxy_command.py b/tests/cli/test_linked_proxy_command.py new file mode 100644 index 0000000..65071d3 --- /dev/null +++ b/tests/cli/test_linked_proxy_command.py @@ -0,0 +1,233 @@ +from __future__ import annotations + +import json +from collections.abc import Callable +from datetime import datetime +from datetime import timezone +from pathlib import Path + +import keyring +import pytest +import respx + +from gumloop.cli.credentials import KEYRING_SERVICE +from gumloop.cli.credentials import Credentials +from gumloop.cli.credentials import save_credentials +from gumloop.cli.linked_proxy_key import LinkedProxyConnectionStatus +from gumloop.cli.linked_proxy_key import LinkedProxyRegistration +from gumloop.cli.linked_proxy_key import load_or_create_key +from gumloop.cli.linked_proxy_key import load_registration +from gumloop.cli.linked_proxy_key import save_connection_status +from gumloop.cli.linked_proxy_key import save_registration +from gumloop.cli.main import app +from gumloop.linked_proxy.connection import GatewayTokenUnavailable +from gumloop.linked_proxy.connection import SignInRefused +from gumloop.linked_proxy.sign_in import public_key_text +from tests.sdk.helpers import API_BASE + +HOST = "api.gumloop.com" +GATEWAY_URL = "wss://linked-proxy-gateway.gumloop.com/v1/cli/connect" +REGISTRATION = LinkedProxyRegistration(linked_proxy_id="dp-1", name="Ada's laptop", gateway_url=GATEWAY_URL) + + +class FakeService: + def __init__(self, *, installed: bool = False) -> None: + self.installed = installed + self.executable: Path | None = None + + def install(self, executable_path: Path) -> None: + self.installed = True + self.executable = executable_path + + def remove(self) -> None: + self.installed = False + + def is_installed(self) -> bool: + return self.installed + + +@pytest.fixture +def service(monkeypatch) -> FakeService: + fake = FakeService() + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.service_for_current_platform", lambda: fake) + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.check_tls_not_inspected", lambda: None) + save_credentials(Credentials(api_key="key", user_id="actor")) + return fake + + +@respx.mock +def test_add_registers_and_turns_on_the_service(cli_runner, service, fake_executable_path): + route = respx.post(f"{API_BASE}/linked-proxies/cli").respond( + 201, + json={ + "linked_proxy": {"id": "dp-1", "name": "Ada's laptop", "kind": "cli", "is_default": True}, + "gateway_url": GATEWAY_URL, + }, + ) + + result = cli_runner.invoke(app, ["browser", "proxy", "link"]) + + assert result.exit_code == 0, result.output + assert json.loads(route.calls[0].request.content)["public_key"] == public_key_text(load_or_create_key(HOST)) + assert load_registration(HOST) == REGISTRATION + assert service.executable == fake_executable_path / "gumloop" + + +@respx.mock +def test_add_refuses_a_temporary_credential_override(cli_runner, service): + route = respx.post(f"{API_BASE}/linked-proxies/cli") + + result = cli_runner.invoke(app, ["browser", "proxy", "link"], env={"GUMLOOP_ACCESS_TOKEN": "other-account"}) + + assert result.exit_code == 1 + assert not route.called + assert not service.installed + + +@respx.mock +def test_a_refused_linked_proxy_stays_down_after_a_restart(cli_runner, service, monkeypatch): + save_registration(HOST, REGISTRATION) + + class RefusedConnection: + def __init__(self, **kwargs: object) -> None: + assert kwargs["linked_proxy_id"] == "dp-1" + + async def run(self) -> None: + raise SignInRefused("sign_in_refused") + + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.GatewayConnection", RefusedConnection) + + refused = cli_runner.invoke(app, ["browser", "proxy", "run"]) + restarted = cli_runner.invoke(app, ["browser", "proxy", "run"]) + + assert (refused.exit_code, restarted.exit_code) == (0, 0) + assert load_registration(HOST) is None + assert not respx.calls + + +@pytest.mark.parametrize( + ("status", "payload", "expected_token", "kept"), + [ + (200, {"gateway_token": "token-1"}, "token-1", True), + (503, {"error": "unavailable"}, GatewayTokenUnavailable, True), + (404, {"error": {"code": "linked_proxy_not_found"}}, None, False), + (403, {"error": {"code": "permission_denied"}}, None, False), + ], +) +@respx.mock +def test_run_signs_in_with_a_gateway_token_and_stops_when_gumloop_refuses_one( + cli_runner, service, monkeypatch, status, payload, expected_token, kept +): + save_registration(HOST, REGISTRATION) + respx.post(f"{API_BASE}/linked-proxies/dp-1/gateway-token").respond(status, json=payload) + fetched: list[object] = [] + + class TokenFetchingConnection: + def __init__(self, **kwargs: object) -> None: + self._gateway_token = kwargs["gateway_token"] + + async def run(self) -> None: + try: + fetched.append(self._gateway_token()) + except GatewayTokenUnavailable as error: + fetched.append(type(error)) + + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.GatewayConnection", TokenFetchingConnection) + + result = cli_runner.invoke(app, ["browser", "proxy", "run"]) + + assert result.exit_code == 0, result.output + assert fetched == ([expected_token] if expected_token is not None else []) + assert (load_registration(HOST) == REGISTRATION) is kept + + +@respx.mock +def test_run_signs_in_with_the_login_stored_after_it_started(cli_runner, service, monkeypatch): + save_registration(HOST, REGISTRATION) + route = respx.post(f"{API_BASE}/linked-proxies/dp-1/gateway-token").respond(200, json={"gateway_token": "t"}) + + class ReconnectingConnection: + def __init__(self, *, gateway_token: Callable[[], str], **kwargs: object) -> None: + self._gateway_token = gateway_token + + async def run(self) -> None: + self._gateway_token() + save_credentials(Credentials(access_token="fresh")) + self._gateway_token() + + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.GatewayConnection", ReconnectingConnection) + + result = cli_runner.invoke(app, ["browser", "proxy", "run"]) + + assert result.exit_code == 0, result.output + assert [call.request.headers["authorization"] for call in route.calls] == ["Bearer key", "Bearer fresh"] + + +@pytest.mark.parametrize( + ("running", "connected", "last_error", "expected"), + [ + (False, True, None, "not running. Run `gumloop browser proxy link` to start."), + (True, False, "can't reach the gateway (connection refused)", "connecting. Last attempt failed: can't reach"), + (True, True, None, "connected since"), + ], +) +def test_status_reads_the_running_linked_proxy_connection( + cli_runner, service, monkeypatch, running, connected, last_error, expected +): + save_registration(HOST, REGISTRATION) + save_connection_status( + HOST, + LinkedProxyConnectionStatus(connected=connected, since=datetime.now(timezone.utc), last_error=last_error), + ) + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.is_running", lambda host: running) + + result = cli_runner.invoke(app, ["browser", "proxy", "status"]) + + assert result.exit_code == 0, result.output + assert f'"Ada\'s laptop": {expected}' in " ".join(result.output.split()) + + +@pytest.mark.parametrize("command", [["browser", "proxy", "unlink"], ["logout"]]) +@respx.mock +def test_removing_deletes_the_linked_proxy_then_the_key(cli_runner, service, command): + service.installed = True + save_registration(HOST, REGISTRATION) + load_or_create_key(HOST) + route = respx.delete(f"{API_BASE}/linked-proxies/dp-1").respond(204) + + result = cli_runner.invoke(app, command) + + assert result.exit_code == 0, result.output + assert route.called + assert not service.installed + assert keyring.get_password(KEYRING_SERVICE, f"linked-proxy:{HOST}") is None + assert load_registration(HOST) is None + + +@pytest.mark.parametrize(("login_has_linked_proxy", "kept"), [(True, True), (False, False)]) +def test_removing_another_backends_linked_proxy_keeps_the_service_only_while_the_login_needs_it( + cli_runner, service, login_has_linked_proxy, kept +): + service.installed = True + if login_has_linked_proxy: + save_registration(HOST, REGISTRATION) + + result = cli_runner.invoke( + app, ["browser", "proxy", "unlink"], env={"GUMLOOP_BASE_URL": "https://staging.api.gumloop.com"} + ) + + assert result.exit_code == 0, result.output + assert service.installed is kept + + +@respx.mock +def test_remove_keeps_the_key_when_gumloop_cannot_delete_the_linked_proxy(cli_runner, service): + save_registration(HOST, REGISTRATION) + key = public_key_text(load_or_create_key(HOST)) + respx.delete(f"{API_BASE}/linked-proxies/dp-1").respond(503, json={"error": "unavailable"}) + + result = cli_runner.invoke(app, ["browser", "proxy", "unlink"]) + + assert result.exit_code == 1 + assert public_key_text(load_or_create_key(HOST)) == key + assert load_registration(HOST) == REGISTRATION diff --git a/tests/cli/test_linked_proxy_key.py b/tests/cli/test_linked_proxy_key.py index b15bd41..432ab87 100644 --- a/tests/cli/test_linked_proxy_key.py +++ b/tests/cli/test_linked_proxy_key.py @@ -13,7 +13,9 @@ def test_key_and_registration_persist(temporary_home): host = "api.gumloop.com" registration = LinkedProxyRegistration( - linked_proxy_id="dp-1", gateway_url="wss://linked-proxy-gateway.gumloop.com/v1/cli/connect" + linked_proxy_id="dp-1", + name="Ada's laptop", + gateway_url="wss://linked-proxy-gateway.gumloop.com/v1/cli/connect", ) first = public_key_text(load_or_create_key(host)) @@ -28,7 +30,7 @@ def test_key_and_registration_persist(temporary_home): ["wss://linked-proxy-gateway.gumloop.com/v1/cli/connect", "ws://localhost:8443/v1/cli/connect"], ) def test_registration_accepts_an_encrypted_or_local_gateway(gateway_url): - registration = LinkedProxyRegistration(linked_proxy_id="dp-1", gateway_url=gateway_url) + registration = LinkedProxyRegistration(linked_proxy_id="dp-1", name="Ada's laptop", gateway_url=gateway_url) assert registration.gateway_url == gateway_url @@ -36,5 +38,7 @@ def test_registration_accepts_an_encrypted_or_local_gateway(gateway_url): def test_registration_refuses_an_unencrypted_remote_gateway(): with pytest.raises(ValidationError): LinkedProxyRegistration( - linked_proxy_id="dp-1", gateway_url="ws://linked-proxy-gateway.gumloop.com/v1/cli/connect" + linked_proxy_id="dp-1", + name="Ada's laptop", + gateway_url="ws://linked-proxy-gateway.gumloop.com/v1/cli/connect", ) diff --git a/tests/cli/test_linked_proxy_service.py b/tests/cli/test_linked_proxy_service.py new file mode 100644 index 0000000..a81b8f9 --- /dev/null +++ b/tests/cli/test_linked_proxy_service.py @@ -0,0 +1,80 @@ +from __future__ import annotations + +import plistlib +import subprocess +import sys +from collections.abc import Sequence +from pathlib import Path + +from gumloop.cli.linked_proxy_service import LaunchAgentService +from gumloop.cli.linked_proxy_service import SystemdUserService +from gumloop.cli.linked_proxy_service import service_for_current_platform + +EXECUTABLE = Path("/opt/gumloop bin/gumloop") + + +class RecordingRunner: + def __init__(self) -> None: + self.calls: list[list[str]] = [] + + def __call__(self, args: Sequence[str]) -> subprocess.CompletedProcess[str]: + self.calls.append(list(args)) + return subprocess.CompletedProcess(list(args), 0, stdout="", stderr="") + + +def test_launch_agent_runs_the_linked_proxy_at_login_and_after_failures(tmp_path): + runner = RecordingRunner() + service = LaunchAgentService(home=tmp_path, run_command=runner, get_uid=lambda: 501) + + service.install(EXECUTABLE) + + plist = plistlib.loads(service.plist_path.read_bytes()) + assert plist["ProgramArguments"] == [str(EXECUTABLE), "browser", "proxy", "run"] + assert plist["RunAtLoad"] is True + assert plist["KeepAlive"] == {"SuccessfulExit": False} + assert ["launchctl", "bootstrap", "gui/501", str(service.plist_path)] in runner.calls + + service.remove() + + assert not service.is_installed() + assert runner.calls[-1] == ["launchctl", "bootout", "gui/501/com.gumloop.linked-proxy"] + + +def test_systemd_unit_runs_the_linked_proxy_at_login_and_after_failures(tmp_path): + runner = RecordingRunner() + service = SystemdUserService(config_home=tmp_path, run_command=runner) + + service.install(EXECUTABLE) + + unit = service.unit_path.read_text() + assert 'ExecStart="/opt/gumloop bin/gumloop" "browser" "proxy" "run"\n' in unit + assert "Restart=on-failure\n" in unit + assert "WantedBy=default.target\n" in unit + assert runner.calls[-2:] == [ + ["systemctl", "--user", "enable", "gumloop-linked-proxy.service"], + ["systemctl", "--user", "restart", "gumloop-linked-proxy.service"], + ] + + service.remove() + + assert not service.is_installed() + assert ["systemctl", "--user", "disable", "--now", "gumloop-linked-proxy.service"] in runner.calls + + +def test_systemd_unit_runs_an_executable_path_with_special_characters_as_written(tmp_path): + service = SystemdUserService(config_home=tmp_path, run_command=RecordingRunner()) + + service.install(Path('/home/a$b/100%/"q"\\gumloop')) + + unit = service.unit_path.read_text() + assert 'ExecStart="/home/a$$b/100%%/\\"q\\"\\\\gumloop" "browser" "proxy" "connect"\n' in unit + + +def test_systemd_unit_goes_where_systemd_looks_for_user_units(tmp_path, monkeypatch): + monkeypatch.setattr(sys, "platform", "linux") + monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path / "config")) + + service = service_for_current_platform(home=tmp_path) + + assert isinstance(service, SystemdUserService) + assert service.unit_path == tmp_path / "config" / "systemd" / "user" / "gumloop-linked-proxy.service" diff --git a/tests/linked_proxy/test_connection.py b/tests/linked_proxy/test_connection.py index cf8e332..a0e0c1d 100644 --- a/tests/linked_proxy/test_connection.py +++ b/tests/linked_proxy/test_connection.py @@ -5,8 +5,12 @@ import contextlib import json from collections.abc import AsyncIterator +from collections.abc import Awaitable from collections.abc import Callable from dataclasses import dataclass +from datetime import datetime +from datetime import timedelta +from datetime import timezone import pytest from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey @@ -18,10 +22,14 @@ from gumloop.linked_proxy.connection import ERROR_HEADER from gumloop.linked_proxy.connection import FIRST_RETRY_SECONDS +from gumloop.linked_proxy.connection import MIN_REFRESH_SECONDS +from gumloop.linked_proxy.connection import REFRESH_BEFORE_EXPIRY_SECONDS from gumloop.linked_proxy.connection import GatewayConnection from gumloop.linked_proxy.connection import GatewayTokenUnavailable from gumloop.linked_proxy.connection import SignedOut from gumloop.linked_proxy.connection import SignInRefused +from gumloop.linked_proxy.frames import Frame +from gumloop.types import LinkedProxyGatewayToken GATEWAY_URL = "wss://linked-proxy-gateway.gumloop.com/v1/cli/connect" @@ -43,6 +51,8 @@ async def send(self, message: bytes) -> None: pass async def recv(self) -> bytes: + # Lets the refresh task start before the tunnel ends. + await asyncio.sleep(0) raise self._error @@ -64,6 +74,66 @@ async def sleep(self, seconds: float) -> None: self.waits.append(seconds) +class OpenConnection: + """Stays open until the CLI has sent ``closes_after`` frames, then its ``recv`` fails.""" + + def __init__(self, closes_after: int) -> None: + self.sent: list[Frame] = [] + self._closes_after = closes_after + self._closed = asyncio.Event() + + async def send(self, message: bytes) -> None: + self.sent.append(Frame.decode(message)) + if len(self.sent) >= self._closes_after: + self._closed.set() + + async def recv(self) -> bytes: + await self._closed.wait() + raise OSError("closed") + + +class OpenGateway: + def __init__(self, connection: OpenConnection) -> None: + self.connection = connection + self.waits: list[float] = [] + + @contextlib.asynccontextmanager + async def open(self, url: str, headers: dict[str, str]) -> AsyncIterator[OpenConnection]: + yield self.connection + + async def sleep(self, seconds: float) -> None: + self.waits.append(seconds) + + +class RefreshSleep: + """Records each wait before a refresh; the waits after the first ``returns`` never end.""" + + def __init__(self, returns: int) -> None: + self.waits: list[float] = [] + self._returns = returns + + async def __call__(self, seconds: float) -> None: + self.waits.append(seconds) + if len(self.waits) > self._returns: + await asyncio.Event().wait() + + +def _tokens(*results: str | LinkedProxyGatewayToken | Exception) -> Callable[[], str | LinkedProxyGatewayToken]: + remaining = list(results) + + def fetch() -> str | LinkedProxyGatewayToken: + result = remaining.pop(0) + if isinstance(result, Exception): + raise result + return result + + return fetch + + +def _expiring_in(minutes: float, utc_suffix: str = "+00:00") -> str: + return (datetime.now(timezone.utc) + timedelta(minutes=minutes)).isoformat().replace("+00:00", utc_suffix) + + def _refused_handshake(status: int, outcome: str) -> InvalidStatus: return InvalidStatus(Response(status, "", Headers({ERROR_HEADER: outcome}))) @@ -74,18 +144,29 @@ def _gateway_token_claim(authorization: str) -> str: def _run( - gateway: ScriptedGateway, + gateway: ScriptedGateway | OpenGateway, signed_in_checks: list[bool], - gateway_token: Callable[[], str] = lambda: "token-1", + events: list[str] | None = None, + gateway_token: Callable[[], str | LinkedProxyGatewayToken] = lambda: "token-1", + refresh_sleep: Callable[[float], Awaitable[None]] = asyncio.sleep, ) -> None: + recorded = events if events is not None else [] + + def fetch() -> LinkedProxyGatewayToken: + token = gateway_token() + return token if isinstance(token, LinkedProxyGatewayToken) else LinkedProxyGatewayToken(gateway_token=token) + connection = GatewayConnection( gateway_url=GATEWAY_URL, linked_proxy_id="dp-1", key=Ed25519PrivateKey.generate(), signed_in=lambda: signed_in_checks.pop(0), - gateway_token=gateway_token, + gateway_token=fetch, + on_connected=lambda: recorded.append("connected"), + on_failed=recorded.append, open_websocket=gateway.open, sleep=gateway.sleep, + refresh_sleep=refresh_sleep, ) asyncio.run(connection.run()) @@ -114,10 +195,16 @@ def test_other_failures_reconnect_with_a_growing_wait_until_signed_out(): Outcome(OSError("unreachable")), ] ) + events: list[str] = [] with pytest.raises(SignedOut): - _run(gateway, [True, True, False]) + _run(gateway, [True, True, False], events) + assert events == [ + "connected", + "the gateway closed the connection (already_connected)", + "can't reach the gateway (unreachable)", + ] assert len(gateway.waits) == 2 for wait, cap in zip(gateway.waits, [1.0, 2.0]): assert FIRST_RETRY_SECONDS <= wait <= cap @@ -147,6 +234,7 @@ def test_a_gateway_token_gumloop_did_not_give_is_retried_before_connecting(): GatewayTokenUnavailable("Gumloop didn't give a gateway token (HTTP 503)"), "token-1", ] + events: list[str] = [] def gateway_token() -> str: result = tokens.pop(0) @@ -155,9 +243,9 @@ def gateway_token() -> str: return result with pytest.raises(SignedOut): - _run(gateway, [True, True, False], gateway_token=gateway_token) + _run(gateway, [True, True, False], events, gateway_token=gateway_token) - assert len(gateway.waits) == 2 + assert events == ["Gumloop didn't give a gateway token (HTTP 503)", "can't reach the gateway (unreachable)"] assert [_gateway_token_claim(authorization) for authorization in gateway.authorizations] == ["token-1"] @@ -172,3 +260,43 @@ def gateway_token() -> str: assert gateway.authorizations == [] assert gateway.waits == [] + + +@pytest.mark.parametrize("utc_suffix", ["+00:00", "Z"]) +def test_an_open_tunnel_sends_a_fresh_gateway_token_before_its_current_one_expires(utc_suffix): + gateway = OpenGateway(OpenConnection(closes_after=1)) + refresh_sleep = RefreshSleep(returns=1) + expiring = LinkedProxyGatewayToken(gateway_token="token-1", expires_at=_expiring_in(20, utc_suffix)) + + with pytest.raises(SignedOut): + _run(gateway, [True, False], gateway_token=_tokens(expiring, "token-2"), refresh_sleep=refresh_sleep) + + assert refresh_sleep.waits == [pytest.approx(20 * 60 - REFRESH_BEFORE_EXPIRY_SECONDS, abs=5)] + assert gateway.connection.sent == [Frame.gateway_token("token-2")] + + +def test_a_gateway_token_without_an_expiry_is_never_refreshed(): + gateway = ScriptedGateway([Outcome(OSError("closed"), opened=True)]) + refresh_sleep = RefreshSleep(returns=0) + + with pytest.raises(SignedOut): + _run(gateway, [True, False], refresh_sleep=refresh_sleep) + + assert refresh_sleep.waits == [] + + +def test_a_gateway_token_refresh_gumloop_did_not_give_is_retried(): + gateway = OpenGateway(OpenConnection(closes_after=1)) + refresh_sleep = RefreshSleep(returns=2) + expiring = LinkedProxyGatewayToken(gateway_token="token-1", expires_at=_expiring_in(10)) + + with pytest.raises(SignedOut): + _run( + gateway, + [True, False], + gateway_token=_tokens(expiring, GatewayTokenUnavailable("HTTP 503"), "token-2"), + refresh_sleep=refresh_sleep, + ) + + assert refresh_sleep.waits == [MIN_REFRESH_SECONDS, MIN_REFRESH_SECONDS] + assert gateway.connection.sent == [Frame.gateway_token("token-2")] diff --git a/tests/linked_proxy/test_tls_check.py b/tests/linked_proxy/test_tls_check.py new file mode 100644 index 0000000..339362c --- /dev/null +++ b/tests/linked_proxy/test_tls_check.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +import contextlib +import socket +import ssl +import threading +from datetime import datetime +from datetime import timedelta +from datetime import timezone + +import pytest +from cryptography import x509 +from cryptography.hazmat.primitives import hashes +from cryptography.hazmat.primitives.asymmetric import ec +from cryptography.hazmat.primitives.serialization import Encoding +from cryptography.hazmat.primitives.serialization import NoEncryption +from cryptography.hazmat.primitives.serialization import PrivateFormat +from cryptography.x509.oid import NameOID + +from gumloop.linked_proxy.tls_check import TlsInspected +from gumloop.linked_proxy.tls_check import check_tls_not_inspected + + +def _privately_signed_server(tmp_path) -> ssl.SSLContext: + """What a TLS-inspecting proxy presents: a valid certificate for the host from a CA no public root trusts.""" + key = ec.generate_private_key(ec.SECP256R1()) + name = x509.Name([x509.NameAttribute(NameOID.COMMON_NAME, "localhost")]) + now = datetime.now(timezone.utc) + certificate = ( + x509.CertificateBuilder() + .subject_name(name) + .issuer_name(name) + .public_key(key.public_key()) + .serial_number(x509.random_serial_number()) + .not_valid_before(now - timedelta(minutes=1)) + .not_valid_after(now + timedelta(days=1)) + .add_extension(x509.SubjectAlternativeName([x509.DNSName("localhost")]), critical=False) + .sign(key, hashes.SHA256()) + ) + certificate_path, key_path = tmp_path / "server.pem", tmp_path / "server.key" + certificate_path.write_bytes(certificate.public_bytes(Encoding.PEM)) + key_path.write_bytes(key.private_bytes(Encoding.PEM, PrivateFormat.PKCS8, NoEncryption())) + context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + context.load_cert_chain(certificate_path, key_path) + return context + + +def test_a_certificate_from_a_private_ca_means_inspection(tmp_path): + context = _privately_signed_server(tmp_path) + listener = socket.create_server(("127.0.0.1", 0)) + + def serve() -> None: + connection, _ = listener.accept() + with connection, contextlib.suppress(OSError): + context.wrap_socket(connection, server_side=True).close() + + server = threading.Thread(target=serve, daemon=True) + server.start() + with listener, pytest.raises(TlsInspected): + check_tls_not_inspected("localhost", listener.getsockname()[1]) + server.join(timeout=5) + + +def test_an_unreachable_site_is_not_inspection(): + with socket.create_server(("127.0.0.1", 0)) as closed: + port = closed.getsockname()[1] + + check_tls_not_inspected("127.0.0.1", port) diff --git a/tests/sdk/test_linked_proxies.py b/tests/sdk/test_linked_proxies.py index 935a1c8..d6658ca 100644 --- a/tests/sdk/test_linked_proxies.py +++ b/tests/sdk/test_linked_proxies.py @@ -29,7 +29,7 @@ "POST", "linked-proxies/dp-1/gateway-token", 200, - {"gateway_token": "t"}, + {"gateway_token": "t", "expires_at": "2026-01-01T00:00:00+00:00"}, ), ("delete", ("dp-1",), {}, "DELETE", "linked-proxies/dp-1", 204, None), ] From d779abdc235166475199ec6de7a97c65796b90b3 Mon Sep 17 00:00:00 2001 From: daniel-panhead Date: Tue, 24 Nov 2026 17:41:48 +0000 Subject: [PATCH 4/7] [PROD-871] Bump gumloop-py to 0.5.16 Co-authored-by: Cursor --- src/gumloop/_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gumloop/_version.py b/src/gumloop/_version.py index 5a06b37..e4db625 100644 --- a/src/gumloop/_version.py +++ b/src/gumloop/_version.py @@ -1,3 +1,3 @@ from __future__ import annotations -__version__ = "0.5.15" +__version__ = "0.5.16" From a4e3e1e77aa7b7722806225615e4707cda6521b2 Mon Sep 17 00:00:00 2001 From: daniel-panhead Date: Wed, 25 Nov 2026 06:20:37 +0000 Subject: [PATCH 5/7] [PROD-871] gumloop browser proxy connect keeps this computer connected where Linux has no systemd user session Co-authored-by: Cursor --- README.md | 2 + src/gumloop/cli/commands/linked_proxy.py | 27 +++++++++---- src/gumloop/cli/linked_proxy_service.py | 17 +++++++-- tests/cli/test_linked_proxy_command.py | 48 +++++++++++++++++++++--- tests/cli/test_linked_proxy_service.py | 25 +++++++++++- 5 files changed, 100 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 5edfe19..1adfe7d 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,8 @@ gumloop browser proxy status gumloop browser proxy unlink ``` +On Linux without a systemd user session, such as a container, `link` can't run it in the background. Run `gumloop browser proxy connect` and keep it open instead. + The computer only opens connections to public addresses on ports 80 and 443. Its key stays in the OS keychain. `gumloop logout` unlinks it. A network that inspects TLS traffic can't be used, since sites would show the agent's browser certificate errors. ### Sync a folder into your Brain diff --git a/src/gumloop/cli/commands/linked_proxy.py b/src/gumloop/cli/commands/linked_proxy.py index 310a171..21b0596 100644 --- a/src/gumloop/cli/commands/linked_proxy.py +++ b/src/gumloop/cli/commands/linked_proxy.py @@ -40,6 +40,7 @@ from gumloop.cli.linked_proxy_lock import is_running from gumloop.cli.linked_proxy_lock import linked_proxy_lock from gumloop.cli.linked_proxy_service import LinkedProxyService +from gumloop.cli.linked_proxy_service import NoBackgroundService from gumloop.cli.linked_proxy_service import gumloop_executable from gumloop.cli.linked_proxy_service import service_for_current_platform from gumloop.linked_proxy.connection import GatewayConnection @@ -87,18 +88,28 @@ def link( f"Linking this computer can't use {', '.join(overrides)}. " "Save the login with `gumloop login`, then retry." ) - service = service_for_current_platform() - executable = gumloop_executable() + try: + service: LinkedProxyService | None = service_for_current_platform() + except NoBackgroundService: + service = None + executable = gumloop_executable() if service is not None else None check_tls_not_inspected() key = load_or_create_key(host) if load_registration(host) is None: _register(cli, host, key, name) - service.install(executable) + if service is not None and executable is not None: + service.install(executable) except TlsInspected as error: exit_with_error(_tls_inspected_error(error)) except (GumloopError, ValidationError) as error: exit_with_error(error) + if service is None: + console.print( + "It can't stay connected in the background: this computer has no systemd user session. " + "Run `gumloop browser proxy connect` and keep it open, for example in tmux." + ) + return console.print("Connected. Your agents' browser now goes out through this computer.") if sys.platform.startswith("linux"): console.print("[dim]It connects when you log in, once your keyring is unlocked.[/dim]") @@ -142,7 +153,8 @@ def status( return prefix = f'"{escape_markup(registration.name)}"' if not running: - console.print(f"{prefix}: not running. Run `gumloop browser proxy link` to start.") + start = "link" if service is not None else "connect" + console.print(f"{prefix}: not running. Run `gumloop browser proxy {start}` to start.") elif connection and connection.connected: console.print(f"{prefix}: connected since {_clock_time(connection.since)}.") elif connection and connection.last_error: @@ -187,9 +199,10 @@ def remove_linked_proxy(cli: CliContext, host: str) -> bool: return service_installed or registration is not None -@proxy_app.command("run", hidden=True) -def run(ctx: typer.Context) -> None: - """What the background service runs. A clean exit means the service should stay down.""" +@proxy_app.command("connect") +def connect(ctx: typer.Context) -> None: + """Keep this computer connected from this terminal until you stop it with Ctrl-C.""" + # The background service runs this too. A clean exit means the service should stay down. cli: CliContext = ctx.obj host = backend_host(cli.effective_base_url) try: diff --git a/src/gumloop/cli/linked_proxy_service.py b/src/gumloop/cli/linked_proxy_service.py index adabb01..f99dffc 100644 --- a/src/gumloop/cli/linked_proxy_service.py +++ b/src/gumloop/cli/linked_proxy_service.py @@ -1,4 +1,4 @@ -"""Runs ``gumloop browser proxy run`` in the background: a LaunchAgent on +"""Runs ``gumloop browser proxy connect`` in the background: a LaunchAgent on macOS, a systemd user unit on Linux. Both start it at login and restart it after a failure, but not after a clean exit, which is how it stops once the user logs out or Gumloop refuses the linked proxy.""" @@ -20,8 +20,10 @@ LAUNCH_AGENT_LABEL = "com.gumloop.linked-proxy" SYSTEMD_UNIT = "gumloop-linked-proxy.service" -_RUN_ARGUMENTS = ("browser", "proxy", "run") +_CONNECT_ARGUMENTS = ("browser", "proxy", "connect") _RESTART_SECONDS = 30 +# Present only when systemd is the running init system. +_SYSTEMD_BOOTED_DIR = Path("/run/systemd/system") _SAFE_PATH = "/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" # Credentials come from the keychain, never from the shell that ran `add`. _CLEARED_ENVIRONMENT = ( @@ -35,6 +37,11 @@ CommandRunner = Callable[[Sequence[str]], subprocess.CompletedProcess[str]] +class NoBackgroundService(GumloopError): + """This computer can't keep the linked proxy running in the background, such + as a Linux container or SSH session without a systemd user session.""" + + class LinkedProxyService(Protocol): def install(self, executable_path: Path) -> None: """Writes the service and (re)starts it.""" @@ -75,7 +82,7 @@ def install(self, executable_path: Path) -> None: }, "KeepAlive": {"SuccessfulExit": False}, "Label": LAUNCH_AGENT_LABEL, - "ProgramArguments": [str(executable_path), *_RUN_ARGUMENTS], + "ProgramArguments": [str(executable_path), *_CONNECT_ARGUMENTS], "RunAtLoad": True, "StandardErrorPath": str(log_path), "ThrottleInterval": _RESTART_SECONDS, @@ -105,7 +112,7 @@ def unit_path(self) -> Path: return self._config_home / "systemd" / "user" / SYSTEMD_UNIT def install(self, executable_path: Path) -> None: - command = " ".join(_systemd_quote(part) for part in [str(executable_path), *_RUN_ARGUMENTS]) + command = " ".join(_systemd_quote(part) for part in [str(executable_path), *_CONNECT_ARGUMENTS]) unit = ( "[Unit]\n" "Description=Gumloop linked proxy\n" @@ -142,6 +149,8 @@ def service_for_current_platform(*, home: Path | None = None) -> LinkedProxyServ if sys.platform == "darwin": return LaunchAgentService(home=home) if sys.platform.startswith("linux"): + if not _SYSTEMD_BOOTED_DIR.is_dir() or not os.environ.get("XDG_RUNTIME_DIR"): + raise NoBackgroundService("This computer has no systemd user session to run the linked proxy in.") return SystemdUserService(config_home=Path(os.environ.get("XDG_CONFIG_HOME") or home / ".config")) raise GumloopError("`gumloop browser proxy` runs on macOS and Linux only.") diff --git a/tests/cli/test_linked_proxy_command.py b/tests/cli/test_linked_proxy_command.py index 65071d3..77d7db0 100644 --- a/tests/cli/test_linked_proxy_command.py +++ b/tests/cli/test_linked_proxy_command.py @@ -19,6 +19,7 @@ from gumloop.cli.linked_proxy_key import load_registration from gumloop.cli.linked_proxy_key import save_connection_status from gumloop.cli.linked_proxy_key import save_registration +from gumloop.cli.linked_proxy_service import NoBackgroundService from gumloop.cli.main import app from gumloop.linked_proxy.connection import GatewayTokenUnavailable from gumloop.linked_proxy.connection import SignInRefused @@ -73,6 +74,28 @@ def test_add_registers_and_turns_on_the_service(cli_runner, service, fake_execut assert service.executable == fake_executable_path / "gumloop" +@respx.mock +def test_link_without_a_background_service_registers_and_points_to_connect(cli_runner, service, monkeypatch): + def no_background_service() -> FakeService: + raise NoBackgroundService("no systemd user session") + + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.service_for_current_platform", no_background_service) + respx.post(f"{API_BASE}/linked-proxies/cli").respond( + 201, + json={ + "linked_proxy": {"id": "dp-1", "name": "Ada's laptop", "kind": "cli", "is_default": True}, + "gateway_url": GATEWAY_URL, + }, + ) + + result = cli_runner.invoke(app, ["browser", "proxy", "link"]) + + assert result.exit_code == 0, result.output + assert load_registration(HOST) == REGISTRATION + assert not service.installed + assert "Run `gumloop browser proxy connect`" in " ".join(result.output.split()) + + @respx.mock def test_add_refuses_a_temporary_credential_override(cli_runner, service): route = respx.post(f"{API_BASE}/linked-proxies/cli") @@ -97,8 +120,8 @@ async def run(self) -> None: monkeypatch.setattr("gumloop.cli.commands.linked_proxy.GatewayConnection", RefusedConnection) - refused = cli_runner.invoke(app, ["browser", "proxy", "run"]) - restarted = cli_runner.invoke(app, ["browser", "proxy", "run"]) + refused = cli_runner.invoke(app, ["browser", "proxy", "connect"]) + restarted = cli_runner.invoke(app, ["browser", "proxy", "connect"]) assert (refused.exit_code, restarted.exit_code) == (0, 0) assert load_registration(HOST) is None @@ -115,7 +138,7 @@ async def run(self) -> None: ], ) @respx.mock -def test_run_signs_in_with_a_gateway_token_and_stops_when_gumloop_refuses_one( +def test_connect_signs_in_with_a_gateway_token_and_stops_when_gumloop_refuses_one( cli_runner, service, monkeypatch, status, payload, expected_token, kept ): save_registration(HOST, REGISTRATION) @@ -134,7 +157,7 @@ async def run(self) -> None: monkeypatch.setattr("gumloop.cli.commands.linked_proxy.GatewayConnection", TokenFetchingConnection) - result = cli_runner.invoke(app, ["browser", "proxy", "run"]) + result = cli_runner.invoke(app, ["browser", "proxy", "connect"]) assert result.exit_code == 0, result.output assert fetched == ([expected_token] if expected_token is not None else []) @@ -142,7 +165,7 @@ async def run(self) -> None: @respx.mock -def test_run_signs_in_with_the_login_stored_after_it_started(cli_runner, service, monkeypatch): +def test_connect_signs_in_with_the_login_stored_after_it_started(cli_runner, service, monkeypatch): save_registration(HOST, REGISTRATION) route = respx.post(f"{API_BASE}/linked-proxies/dp-1/gateway-token").respond(200, json={"gateway_token": "t"}) @@ -157,7 +180,7 @@ async def run(self) -> None: monkeypatch.setattr("gumloop.cli.commands.linked_proxy.GatewayConnection", ReconnectingConnection) - result = cli_runner.invoke(app, ["browser", "proxy", "run"]) + result = cli_runner.invoke(app, ["browser", "proxy", "connect"]) assert result.exit_code == 0, result.output assert [call.request.headers["authorization"] for call in route.calls] == ["Bearer key", "Bearer fresh"] @@ -187,6 +210,19 @@ def test_status_reads_the_running_linked_proxy_connection( assert f'"Ada\'s laptop": {expected}' in " ".join(result.output.split()) +def test_status_without_a_background_service_points_to_connect(cli_runner, service, monkeypatch): + def no_background_service() -> FakeService: + raise NoBackgroundService("no systemd user session") + + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.service_for_current_platform", no_background_service) + save_registration(HOST, REGISTRATION) + + result = cli_runner.invoke(app, ["browser", "proxy", "status"]) + + assert result.exit_code == 0, result.output + assert "not running. Run `gumloop browser proxy connect` to start." in " ".join(result.output.split()) + + @pytest.mark.parametrize("command", [["browser", "proxy", "unlink"], ["logout"]]) @respx.mock def test_removing_deletes_the_linked_proxy_then_the_key(cli_runner, service, command): diff --git a/tests/cli/test_linked_proxy_service.py b/tests/cli/test_linked_proxy_service.py index a81b8f9..b885605 100644 --- a/tests/cli/test_linked_proxy_service.py +++ b/tests/cli/test_linked_proxy_service.py @@ -6,7 +6,10 @@ from collections.abc import Sequence from pathlib import Path +import pytest + from gumloop.cli.linked_proxy_service import LaunchAgentService +from gumloop.cli.linked_proxy_service import NoBackgroundService from gumloop.cli.linked_proxy_service import SystemdUserService from gumloop.cli.linked_proxy_service import service_for_current_platform @@ -29,7 +32,7 @@ def test_launch_agent_runs_the_linked_proxy_at_login_and_after_failures(tmp_path service.install(EXECUTABLE) plist = plistlib.loads(service.plist_path.read_bytes()) - assert plist["ProgramArguments"] == [str(EXECUTABLE), "browser", "proxy", "run"] + assert plist["ProgramArguments"] == [str(EXECUTABLE), "browser", "proxy", "connect"] assert plist["RunAtLoad"] is True assert plist["KeepAlive"] == {"SuccessfulExit": False} assert ["launchctl", "bootstrap", "gui/501", str(service.plist_path)] in runner.calls @@ -47,7 +50,7 @@ def test_systemd_unit_runs_the_linked_proxy_at_login_and_after_failures(tmp_path service.install(EXECUTABLE) unit = service.unit_path.read_text() - assert 'ExecStart="/opt/gumloop bin/gumloop" "browser" "proxy" "run"\n' in unit + assert 'ExecStart="/opt/gumloop bin/gumloop" "browser" "proxy" "connect"\n' in unit assert "Restart=on-failure\n" in unit assert "WantedBy=default.target\n" in unit assert runner.calls[-2:] == [ @@ -72,9 +75,27 @@ def test_systemd_unit_runs_an_executable_path_with_special_characters_as_written def test_systemd_unit_goes_where_systemd_looks_for_user_units(tmp_path, monkeypatch): monkeypatch.setattr(sys, "platform", "linux") + monkeypatch.setattr("gumloop.cli.linked_proxy_service._SYSTEMD_BOOTED_DIR", tmp_path) + monkeypatch.setenv("XDG_RUNTIME_DIR", str(tmp_path / "run")) monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path / "config")) service = service_for_current_platform(home=tmp_path) assert isinstance(service, SystemdUserService) assert service.unit_path == tmp_path / "config" / "systemd" / "user" / "gumloop-linked-proxy.service" + + +@pytest.mark.parametrize(("systemd_booted", "runtime_dir"), [(False, "/run/user/1000"), (True, None)]) +def test_linux_without_a_systemd_user_session_has_no_background_service( + tmp_path, monkeypatch, systemd_booted, runtime_dir +): + monkeypatch.setattr(sys, "platform", "linux") + booted_dir = tmp_path if systemd_booted else tmp_path / "missing" + monkeypatch.setattr("gumloop.cli.linked_proxy_service._SYSTEMD_BOOTED_DIR", booted_dir) + if runtime_dir is None: + monkeypatch.delenv("XDG_RUNTIME_DIR", raising=False) + else: + monkeypatch.setenv("XDG_RUNTIME_DIR", runtime_dir) + + with pytest.raises(NoBackgroundService): + service_for_current_platform(home=tmp_path) From a5d0170da64dcfa4de5937b38a7efe27d947c9df Mon Sep 17 00:00:00 2001 From: daniel-panhead Date: Wed, 25 Nov 2026 07:35:59 +0000 Subject: [PATCH 6/7] [PROD-871] gumloop browser proxy connect forgets this computer only when it was unlinked, and says why Gumloop refused it otherwise Co-authored-by: Cursor --- src/gumloop/cli/commands/linked_proxy.py | 46 +++++++++++++++---- tests/cli/test_linked_proxy_command.py | 56 +++++++++++++++++++++++- 2 files changed, 92 insertions(+), 10 deletions(-) diff --git a/src/gumloop/cli/commands/linked_proxy.py b/src/gumloop/cli/commands/linked_proxy.py index 21b0596..9ec51dc 100644 --- a/src/gumloop/cli/commands/linked_proxy.py +++ b/src/gumloop/cli/commands/linked_proxy.py @@ -43,6 +43,7 @@ from gumloop.cli.linked_proxy_service import NoBackgroundService from gumloop.cli.linked_proxy_service import gumloop_executable from gumloop.cli.linked_proxy_service import service_for_current_platform +from gumloop.linked_proxy.connection import SIGN_IN_REFUSED from gumloop.linked_proxy.connection import GatewayConnection from gumloop.linked_proxy.connection import GatewayTokenUnavailable from gumloop.linked_proxy.connection import SignedOut @@ -60,6 +61,21 @@ _NAME_MAX_LENGTH = 100 _CREDENTIAL_OVERRIDES = ("GUMLOOP_ACCESS_TOKEN", "GUMLOOP_API_KEY", "GUMLOOP_USER_ID") +_ROLE_DENIED = "Your organization's roles don't allow you to use personal proxies. Ask an admin to turn them on." +_PLAN_REQUIRED = "Personal proxies need an Enterprise plan." +_NOT_RELEASED = "Personal proxies aren't available for your organization yet." +# Why this member can't use personal proxies right now, keyed by Gumloop API error code or gateway close reason. +_UNAVAILABLE_REASONS = { + "policy_denied": _ROLE_DENIED, + "permission_denied": _ROLE_DENIED, + "tier_required_enterprise": _PLAN_REQUIRED, + "not_enterprise": _PLAN_REQUIRED, + "route_not_found": _NOT_RELEASED, + "not_released": _NOT_RELEASED, + "not_a_member": "Personal proxies need you to be in a Gumloop organization.", +} +# Refusals that mean the linked proxy no longer exists. Any other refusal keeps the registration. +_REMOVED_REASONS = frozenset({"not_found", "linked_proxy_not_found", SIGN_IN_REFUSED}) @proxy_app.command( @@ -102,7 +118,7 @@ def link( except TlsInspected as error: exit_with_error(_tls_inspected_error(error)) except (GumloopError, ValidationError) as error: - exit_with_error(error) + exit_with_error(_explained(error)) if service is None: console.print( @@ -171,7 +187,7 @@ def unlink(ctx: typer.Context) -> None: try: removed = remove_linked_proxy(cli, host) except (GumloopError, httpx.HTTPError) as error: - exit_with_error(error) + exit_with_error(_explained(error)) if removed: console.print("Unlinked this computer and deleted its key.") else: @@ -230,12 +246,17 @@ def connect(ctx: typer.Context) -> None: forget_connection_status(host) except TlsInspected as error: exit_with_error(_tls_inspected_error(error)) - except SignInRefused: - forget_registration(host) - error_console.print( - "Gumloop refused this computer: it was removed, or you can no longer use personal proxies. " - "Run `gumloop browser proxy link` to link it again." - ) + except SignInRefused as refusal: + if refusal.reason in _REMOVED_REASONS: + forget_registration(host) + error_console.print( + "This computer was unlinked from Gumloop. Run `gumloop browser proxy link` to link it again." + ) + else: + reason = _UNAVAILABLE_REASONS.get(refusal.reason, "You can't use personal proxies right now.") + error_console.print( + f"{reason} This computer disconnected. Run `gumloop browser proxy link` once that changes." + ) except SignedOut: error_console.print("You logged out of Gumloop, so this computer disconnected.") except KeyboardInterrupt: @@ -274,7 +295,7 @@ def _gateway_token(host: str, linked_proxy_id: str) -> str: ) except APIStatusError as error: if error.status_code in (403, 404): - raise SignInRefused(str(error)) from error + raise SignInRefused(error.code if isinstance(error.code, str) else str(error)) from error raise GatewayTokenUnavailable(f"Gumloop didn't give a gateway token (HTTP {error.status_code})") from error except (GumloopError, httpx.HTTPError) as error: raise GatewayTokenUnavailable(f"Gumloop didn't give a gateway token ({error})") from error @@ -309,6 +330,13 @@ def _service_or_none() -> LinkedProxyService | None: return None +def _explained(error: Exception) -> Exception: + """Personal proxies being off for this member, in words. Any other error stays as it is.""" + if isinstance(error, APIStatusError) and error.code in _UNAVAILABLE_REASONS: + return GumloopError(_UNAVAILABLE_REASONS[error.code]) + return error + + def _tls_inspected_error(error: TlsInspected) -> GumloopError: return GumloopError( f"This network inspects TLS traffic ({error}), so sites would show your agents' browser " diff --git a/tests/cli/test_linked_proxy_command.py b/tests/cli/test_linked_proxy_command.py index 77d7db0..59b70cd 100644 --- a/tests/cli/test_linked_proxy_command.py +++ b/tests/cli/test_linked_proxy_command.py @@ -128,13 +128,67 @@ async def run(self) -> None: assert not respx.calls +@pytest.mark.parametrize( + ("reason", "kept", "expected"), + [ + ("not_found", False, "This computer was unlinked from Gumloop."), + ("permission_denied", True, "Your organization's roles don't allow you to use personal proxies."), + ("not_released", True, "Personal proxies aren't available for your organization yet."), + ], +) +def test_connect_keeps_the_registration_unless_the_linked_proxy_was_removed( + cli_runner, service, monkeypatch, reason, kept, expected +): + save_registration(HOST, REGISTRATION) + + class RefusedConnection: + def __init__(self, **kwargs: object) -> None: + pass + + async def run(self) -> None: + raise SignInRefused(reason) + + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.GatewayConnection", RefusedConnection) + + result = cli_runner.invoke(app, ["browser", "proxy", "connect"]) + + assert result.exit_code == 0, result.output + assert (load_registration(HOST) == REGISTRATION) is kept + assert expected in " ".join(result.stderr.split()) + + +@pytest.mark.parametrize( + ("status", "payload", "expected"), + [ + ( + 403, + {"error": "policy_denied", "denied_keys": ["organization:use_linked_proxies"]}, + "Your organization's roles don't allow you to use personal proxies. Ask an admin to turn them on.", + ), + (403, {"error": "tier_required_enterprise"}, "Personal proxies need an Enterprise plan."), + (404, {"error": "route_not_found"}, "Personal proxies aren't available for your organization yet."), + ], +) +@respx.mock +def test_link_says_why_personal_proxies_are_off(cli_runner, service, status, payload, expected): + respx.post(f"{API_BASE}/linked-proxies/cli").respond(status, json=payload) + + result = cli_runner.invoke(app, ["browser", "proxy", "link"]) + + assert result.exit_code == 1 + assert expected in " ".join(result.stderr.split()) + assert load_registration(HOST) is None + assert not service.installed + + @pytest.mark.parametrize( ("status", "payload", "expected_token", "kept"), [ (200, {"gateway_token": "token-1"}, "token-1", True), (503, {"error": "unavailable"}, GatewayTokenUnavailable, True), (404, {"error": {"code": "linked_proxy_not_found"}}, None, False), - (403, {"error": {"code": "permission_denied"}}, None, False), + (403, {"error": "policy_denied", "denied_keys": ["organization:use_linked_proxies"]}, None, True), + (404, {"error": "route_not_found"}, None, True), ], ) @respx.mock From f41fe874d2dd90dfef8b4eed08e6fa79604e328d Mon Sep 17 00:00:00 2001 From: daniel-panhead Date: Wed, 25 Nov 2026 07:35:59 +0000 Subject: [PATCH 7/7] [PROD-871] Fix ruff and pyright errors in the linked proxy CLI Co-authored-by: Cursor --- src/gumloop/cli/commands/linked_proxy.py | 134 +++++++++++++---- src/gumloop/cli/linked_proxy_key.py | 6 +- src/gumloop/cli/linked_proxy_service.py | 5 +- src/gumloop/linked_proxy/connection.py | 34 ++--- src/gumloop/linked_proxy/sign_in.py | 3 +- tests/cli/test_linked_proxy_command.py | 184 ++++++++++++++++++++--- tests/cli/test_linked_proxy_key.py | 9 +- tests/linked_proxy/test_connection.py | 26 ++-- 8 files changed, 308 insertions(+), 93 deletions(-) diff --git a/src/gumloop/cli/commands/linked_proxy.py b/src/gumloop/cli/commands/linked_proxy.py index 9ec51dc..8b1221d 100644 --- a/src/gumloop/cli/commands/linked_proxy.py +++ b/src/gumloop/cli/commands/linked_proxy.py @@ -1,6 +1,8 @@ from __future__ import annotations import asyncio +import base64 +import json import os import socket import sys @@ -43,7 +45,6 @@ from gumloop.cli.linked_proxy_service import NoBackgroundService from gumloop.cli.linked_proxy_service import gumloop_executable from gumloop.cli.linked_proxy_service import service_for_current_platform -from gumloop.linked_proxy.connection import SIGN_IN_REFUSED from gumloop.linked_proxy.connection import GatewayConnection from gumloop.linked_proxy.connection import GatewayTokenUnavailable from gumloop.linked_proxy.connection import SignedOut @@ -52,6 +53,7 @@ from gumloop.linked_proxy.sign_in import public_key_text from gumloop.linked_proxy.tls_check import TlsInspected from gumloop.linked_proxy.tls_check import check_tls_not_inspected +from gumloop.types import LinkedProxyGatewayToken proxy_app = typer.Typer( help="Let your agents' browser go out to the internet through this computer.", @@ -62,20 +64,16 @@ _NAME_MAX_LENGTH = 100 _CREDENTIAL_OVERRIDES = ("GUMLOOP_ACCESS_TOKEN", "GUMLOOP_API_KEY", "GUMLOOP_USER_ID") _ROLE_DENIED = "Your organization's roles don't allow you to use personal proxies. Ask an admin to turn them on." -_PLAN_REQUIRED = "Personal proxies need an Enterprise plan." -_NOT_RELEASED = "Personal proxies aren't available for your organization yet." -# Why this member can't use personal proxies right now, keyed by Gumloop API error code or gateway close reason. +# Why this member can't use personal proxies right now, keyed by Gumloop API error code. _UNAVAILABLE_REASONS = { "policy_denied": _ROLE_DENIED, - "permission_denied": _ROLE_DENIED, - "tier_required_enterprise": _PLAN_REQUIRED, - "not_enterprise": _PLAN_REQUIRED, - "route_not_found": _NOT_RELEASED, - "not_released": _NOT_RELEASED, - "not_a_member": "Personal proxies need you to be in a Gumloop organization.", + "organization_permission_required": _ROLE_DENIED, + "insufficient_permissions": _ROLE_DENIED, + "tier_required_enterprise": "Personal proxies need an Enterprise plan.", + "route_not_found": "Personal proxies aren't available for your organization yet.", } -# Refusals that mean the linked proxy no longer exists. Any other refusal keeps the registration. -_REMOVED_REASONS = frozenset({"not_found", "linked_proxy_not_found", SIGN_IN_REFUSED}) +# The only refusal that forgets the registration. +_REMOVED = "linked_proxy_not_found" @proxy_app.command( @@ -111,7 +109,12 @@ def link( executable = gumloop_executable() if service is not None else None check_tls_not_inspected() key = load_or_create_key(host) - if load_registration(host) is None: + registration = load_registration(host) + if registration is not None and _is_someone_else(registration, _stored_credentials()): + raise GumloopError( + "This computer is linked to another Gumloop user. Run `gumloop browser proxy unlink`, then link again." + ) + if registration is None or registration.public_key != public_key_text(key): _register(cli, host, key, name) if service is not None and executable is not None: service.install(executable) @@ -126,7 +129,7 @@ def link( "Run `gumloop browser proxy connect` and keep it open, for example in tmux." ) return - console.print("Connected. Your agents' browser now goes out through this computer.") + console.print("[green]Connected.[/green] Your agents' browser now goes out through this computer.") if sys.platform.startswith("linux"): console.print("[dim]It connects when you log in, once your keyring is unlocked.[/dim]") @@ -216,7 +219,13 @@ def remove_linked_proxy(cli: CliContext, host: str) -> bool: @proxy_app.command("connect") -def connect(ctx: typer.Context) -> None: +def connect( + ctx: typer.Context, + verbose: Annotated[ + bool, + typer.Option("--verbose", "-v", help="Show more detail while connected."), + ] = False, +) -> None: """Keep this computer connected from this terminal until you stop it with Ctrl-C.""" # The background service runs this too. A clean exit means the service should stay down. cli: CliContext = ctx.obj @@ -227,16 +236,35 @@ def connect(ctx: typer.Context) -> None: if registration is None: error_console.print("This computer is not linked. Run `gumloop browser proxy link`.") return + key = load_or_create_key(host) + if registration.public_key != public_key_text(key): + forget_registration(host) + error_console.print( + "This computer's linked proxy key is gone from the OS keychain. " + "Run `gumloop browser proxy link` to link it again." + ) + return check_tls_not_inspected() - linked_proxy_id = registration.linked_proxy_id + announced = False + + def on_connected() -> None: + nonlocal announced + _record_connection(host, connected=True) + if not announced: + announced = True + console.print( + "[green]Connected.[/green] Agents can now send browser traffic through this computer. " + "Press Ctrl-C to stop." + ) + connection = GatewayConnection( gateway_url=registration.gateway_url, - linked_proxy_id=linked_proxy_id, - key=load_or_create_key(host), - signed_in=lambda: _signed_in(host), - gateway_token=lambda: _gateway_token(host, linked_proxy_id), - on_open=_print_destination, - on_connected=lambda: _record_connection(host, connected=True), + linked_proxy_id=registration.linked_proxy_id, + key=key, + signed_in=lambda: _owner_login(host, registration) is not None, + gateway_token=lambda: _gateway_token(host, registration), + on_open=_print_destination if verbose else None, + on_connected=on_connected, on_failed=lambda error: _record_connection(host, connected=False, last_error=error), ) _record_connection(host, connected=False) @@ -247,7 +275,7 @@ def connect(ctx: typer.Context) -> None: except TlsInspected as error: exit_with_error(_tls_inspected_error(error)) except SignInRefused as refusal: - if refusal.reason in _REMOVED_REASONS: + if refusal.reason == _REMOVED: forget_registration(host) error_console.print( "This computer was unlinked from Gumloop. Run `gumloop browser proxy link` to link it again." @@ -258,7 +286,13 @@ def connect(ctx: typer.Context) -> None: f"{reason} This computer disconnected. Run `gumloop browser proxy link` once that changes." ) except SignedOut: - error_console.print("You logged out of Gumloop, so this computer disconnected.") + if _signed_in(host): + error_console.print( + "You logged in to Gumloop as someone else, so this computer disconnected. " + "Log back in as the person who linked it, or run `gumloop browser proxy unlink` and link it again." + ) + else: + error_console.print("You logged out of Gumloop, so this computer disconnected.") except KeyboardInterrupt: console.print("Stopped.") except GumloopError as error: @@ -283,23 +317,54 @@ def _login_host(credentials: Credentials) -> str: return backend_host(credentials.base_url or DEFAULT_BASE_URL) -def _gateway_token(host: str, linked_proxy_id: str) -> str: - """A 403 or 404 means the linked proxy was unlinked or its owner can't use it anymore.""" - # The service outlives logins, so each request uses the login stored now, not the one it started with. +def _owner_login(host: str, registration: LinkedProxyRegistration) -> Credentials | None: + """The stored login, while it is for this backend and not someone other than who linked this computer.""" credentials = _stored_credentials() - if not credentials.has_any or _login_host(credentials) != host: + if not credentials.has_any or _login_host(credentials) != host or _is_someone_else(registration, credentials): + return None + return credentials + + +def _is_someone_else(registration: LinkedProxyRegistration, credentials: Credentials) -> bool: + """Only when both users are known: another user's gateway token request answers linked_proxy_not_found.""" + login_user_id = _login_user_id(credentials) + return None not in (registration.user_id, login_user_id) and login_user_id != registration.user_id + + +def _login_user_id(credentials: Credentials) -> str | None: + """Read from the access token without verifying it, which only tells logins apart.""" + if credentials.auth_method == "api_key": + return credentials.user_id + if not credentials.access_token: + return None + try: + payload = credentials.access_token.split(".")[1] + claims = json.loads(base64.urlsafe_b64decode(payload + "=" * (-len(payload) % 4))) + except (IndexError, ValueError): + return None + subject = claims.get("sub") if isinstance(claims, dict) else None + return subject if isinstance(subject, str) else None + + +def _gateway_token(host: str, registration: LinkedProxyRegistration) -> LinkedProxyGatewayToken: + """Only the codes that say the linked proxy is gone or unavailable to its owner stop the + linked proxy. Any other refusal is retried.""" + # The service outlives logins, so each request uses the login stored now, not the one it started with. + credentials = _owner_login(host, registration) + if credentials is None: raise SignedOut() try: response = CliContext(credentials=credentials).call_with_refresh( - lambda client: client.linked_proxies.create_gateway_token(linked_proxy_id) + lambda client: client.linked_proxies.create_gateway_token(registration.linked_proxy_id) ) except APIStatusError as error: - if error.status_code in (403, 404): - raise SignInRefused(error.code if isinstance(error.code, str) else str(error)) from error + code = error.code if isinstance(error.code, str) else None + if code is not None and (code == _REMOVED or code in _UNAVAILABLE_REASONS): + raise SignInRefused(code) from error raise GatewayTokenUnavailable(f"Gumloop didn't give a gateway token (HTTP {error.status_code})") from error except (GumloopError, httpx.HTTPError) as error: raise GatewayTokenUnavailable(f"Gumloop didn't give a gateway token ({error})") from error - return response.gateway_token + return response def _register(cli: CliContext, host: str, key: Ed25519PrivateKey, name: str | None) -> LinkedProxyRegistration: @@ -316,6 +381,8 @@ def _register(cli: CliContext, host: str, key: Ed25519PrivateKey, name: str | No linked_proxy_id=response.linked_proxy.id, name=response.linked_proxy.name, gateway_url=response.gateway_url, + public_key=public_key_text(key), + user_id=_login_user_id(_stored_credentials()), ) save_registration(host, registration) added_name = escape_markup(response.linked_proxy.name) @@ -359,4 +426,5 @@ def _clock_time(moment: datetime) -> str: def _print_destination(target: Target) -> None: - console.print(f"[dim]{escape_markup(target.host)}:{target.port}[/dim]") + opened = datetime.now().astimezone().strftime("%b %-d, %-I:%M:%S %p") + console.print(f"[dim]{opened} {escape_markup(target.host)}[/dim]", highlight=False) diff --git a/src/gumloop/cli/linked_proxy_key.py b/src/gumloop/cli/linked_proxy_key.py index 3ffc004..21bac16 100644 --- a/src/gumloop/cli/linked_proxy_key.py +++ b/src/gumloop/cli/linked_proxy_key.py @@ -35,6 +35,10 @@ class LinkedProxyRegistration(BaseModel): linked_proxy_id: str = Field(min_length=1) name: str = Field(min_length=1) gateway_url: str = Field(min_length=1) + # The key it registered, which the keychain no longer has if it was reset. + public_key: str = Field(min_length=1) + # The Gumloop user who linked it; None when their login didn't say. + user_id: str | None = None @field_validator("gateway_url") @classmethod @@ -133,7 +137,7 @@ def _write_private(destination: Path, text: str) -> None: descriptor = os.open(staging, os.O_WRONLY | os.O_CREAT | os.O_TRUNC, 0o600) with os.fdopen(descriptor, "w", encoding="utf-8") as file: file.write(text) - os.replace(staging, destination) + staging.replace(destination) def _registration_path(host: str, home: Path | None) -> Path: diff --git a/src/gumloop/cli/linked_proxy_service.py b/src/gumloop/cli/linked_proxy_service.py index f99dffc..032f4d1 100644 --- a/src/gumloop/cli/linked_proxy_service.py +++ b/src/gumloop/cli/linked_proxy_service.py @@ -173,9 +173,10 @@ def _write_private(destination: Path, content: bytes) -> None: try: destination.parent.mkdir(parents=True, exist_ok=True) with tempfile.NamedTemporaryFile(dir=destination.parent, prefix=f".{destination.name}.", delete=False) as file: - os.chmod(file.name, 0o600) + staging = Path(file.name) + staging.chmod(0o600) file.write(content) - os.replace(file.name, destination) + staging.replace(destination) except OSError as error: raise GumloopError(f"Could not write {destination}: {error}") from error diff --git a/src/gumloop/linked_proxy/connection.py b/src/gumloop/linked_proxy/connection.py index 0c57b8d..ce7a491 100644 --- a/src/gumloop/linked_proxy/connection.py +++ b/src/gumloop/linked_proxy/connection.py @@ -1,5 +1,5 @@ """Keeps this machine's tunnel to the linked proxy gateway open: signs in, serves the -gateway's streams, and reconnects until the gateway refuses the sign-in or the +gateway's streams, and reconnects until Gumloop refuses a gateway token or the user signs out.""" from __future__ import annotations @@ -29,12 +29,13 @@ from gumloop.linked_proxy.tunnel import Tunnel from gumloop.types import LinkedProxyGatewayToken -# The gateway's close code and refusal header for a sign-in it won't accept. -CLOSE_SIGN_IN_REFUSED = 4001 +# The gateway's refusal header for a sign-in it won't accept. ERROR_HEADER = "X-Gumloop-Linked-Proxy-Error" SIGN_IN_REFUSED = "sign_in_refused" FIRST_RETRY_SECONDS = 1.0 +# Spreads out the linked proxies that all reconnect at once when a gateway replica restarts. +FIRST_RETRY_CAP_SECONDS = 5.0 MAX_RETRY_SECONDS = 60.0 # A connection that stayed up this long starts the backoff over. STABLE_SECONDS = 60.0 @@ -49,7 +50,7 @@ class SignInRefused(Exception): - """The gateway won't accept this linked proxy: it was unlinked, or its owner can't use it anymore.""" + """Gumloop won't give this linked proxy a gateway token: it was unlinked, or its owner can't use it anymore.""" def __init__(self, reason: str) -> None: super().__init__(reason) @@ -96,8 +97,10 @@ async def run(self) -> None: """Runs until it raises ``SignInRefused`` or ``SignedOut``. Every other failure reconnects after a random wait whose cap doubles up to ``MAX_RETRY_SECONDS``. ``gateway_token`` runs in a thread before each connect and each refresh, and raises - ``SignInRefused`` or ``GatewayTokenUnavailable`` when it has no token.""" - retry_cap = FIRST_RETRY_SECONDS + ``SignInRefused`` or ``GatewayTokenUnavailable`` when it has no token. A gateway + refusal reconnects too: a wrong clock looks the same to the gateway as an unlinked + linked proxy, and the next gateway token request tells them apart.""" + retry_cap = FIRST_RETRY_CAP_SECONDS while True: if not self._signed_in(): raise SignedOut() @@ -105,13 +108,10 @@ async def run(self) -> None: try: await self._serve() except (OSError, asyncio.TimeoutError, WebSocketException, ProtocolError, GatewayTokenUnavailable) as error: - reason = _sign_in_refusal(error) - if reason is not None: - raise SignInRefused(reason) from error if self._on_failed is not None: self._on_failed(describe_failure(error)) if time.monotonic() - started >= STABLE_SECONDS: - retry_cap = FIRST_RETRY_SECONDS + retry_cap = FIRST_RETRY_CAP_SECONDS await self._sleep(random.uniform(FIRST_RETRY_SECONDS, retry_cap)) retry_cap = min(retry_cap * 2, MAX_RETRY_SECONDS) @@ -163,6 +163,8 @@ def describe_failure(error: BaseException) -> str: return "the connection dropped" return f"the gateway closed the connection ({error.rcvd.reason or error.rcvd.code})" if isinstance(error, InvalidStatus): + if error.response.headers.get(ERROR_HEADER) == SIGN_IN_REFUSED: + return "the gateway refused the sign-in (is this computer's clock right?)" return f"the gateway answered HTTP {error.response.status_code}" if isinstance(error, asyncio.TimeoutError): return "the gateway didn't answer in time" @@ -173,18 +175,6 @@ def describe_failure(error: BaseException) -> str: return str(error) or type(error).__name__ -def _sign_in_refusal(error: BaseException) -> str | None: - if isinstance(error, ConnectionClosed) and error.rcvd is not None and error.rcvd.code == CLOSE_SIGN_IN_REFUSED: - return error.rcvd.reason or SIGN_IN_REFUSED - if ( - isinstance(error, InvalidStatus) - and error.response.status_code == 401 - and error.response.headers.get(ERROR_HEADER) == SIGN_IN_REFUSED - ): - return SIGN_IN_REFUSED - return None - - def _open_websocket(url: str, headers: dict[str, str]) -> AbstractAsyncContextManager[Connection]: return websocket_connect( url, diff --git a/src/gumloop/linked_proxy/sign_in.py b/src/gumloop/linked_proxy/sign_in.py index 81c34c0..0950bd6 100644 --- a/src/gumloop/linked_proxy/sign_in.py +++ b/src/gumloop/linked_proxy/sign_in.py @@ -8,6 +8,7 @@ import json import secrets import time +from collections.abc import Mapping from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey from cryptography.hazmat.primitives.serialization import Encoding @@ -40,7 +41,7 @@ def sign_in_token( return f"{signing_input}.{_encode(key.sign(signing_input.encode()))}" -def _encode_json(value: dict[str, str | int]) -> str: +def _encode_json(value: Mapping[str, str | int]) -> str: return _encode(json.dumps(value, separators=(",", ":")).encode()) diff --git a/tests/cli/test_linked_proxy_command.py b/tests/cli/test_linked_proxy_command.py index 59b70cd..814f2cd 100644 --- a/tests/cli/test_linked_proxy_command.py +++ b/tests/cli/test_linked_proxy_command.py @@ -1,5 +1,6 @@ from __future__ import annotations +import base64 import json from collections.abc import Callable from datetime import datetime @@ -23,12 +24,29 @@ from gumloop.cli.main import app from gumloop.linked_proxy.connection import GatewayTokenUnavailable from gumloop.linked_proxy.connection import SignInRefused +from gumloop.linked_proxy.destinations import Target from gumloop.linked_proxy.sign_in import public_key_text +from gumloop.types import LinkedProxyGatewayToken from tests.sdk.helpers import API_BASE HOST = "api.gumloop.com" GATEWAY_URL = "wss://linked-proxy-gateway.gumloop.com/v1/cli/connect" -REGISTRATION = LinkedProxyRegistration(linked_proxy_id="dp-1", name="Ada's laptop", gateway_url=GATEWAY_URL) + + +def _registration(**changes: str) -> LinkedProxyRegistration: + """What `link` saves for the keychain's key and the `service` fixture's login.""" + return LinkedProxyRegistration( + linked_proxy_id="dp-1", + name="Ada's laptop", + gateway_url=GATEWAY_URL, + public_key=public_key_text(load_or_create_key(HOST)), + user_id="actor", + ).model_copy(update=changes) + + +def _access_token(user_id: str) -> str: + claims = base64.urlsafe_b64encode(json.dumps({"sub": user_id}).encode()).decode().rstrip("=") + return f"header.{claims}.signature" class FakeService: @@ -70,7 +88,7 @@ def test_add_registers_and_turns_on_the_service(cli_runner, service, fake_execut assert result.exit_code == 0, result.output assert json.loads(route.calls[0].request.content)["public_key"] == public_key_text(load_or_create_key(HOST)) - assert load_registration(HOST) == REGISTRATION + assert load_registration(HOST) == _registration() assert service.executable == fake_executable_path / "gumloop" @@ -91,7 +109,7 @@ def no_background_service() -> FakeService: result = cli_runner.invoke(app, ["browser", "proxy", "link"]) assert result.exit_code == 0, result.output - assert load_registration(HOST) == REGISTRATION + assert load_registration(HOST) == _registration() assert not service.installed assert "Run `gumloop browser proxy connect`" in " ".join(result.output.split()) @@ -109,14 +127,14 @@ def test_add_refuses_a_temporary_credential_override(cli_runner, service): @respx.mock def test_a_refused_linked_proxy_stays_down_after_a_restart(cli_runner, service, monkeypatch): - save_registration(HOST, REGISTRATION) + save_registration(HOST, _registration()) class RefusedConnection: def __init__(self, **kwargs: object) -> None: assert kwargs["linked_proxy_id"] == "dp-1" async def run(self) -> None: - raise SignInRefused("sign_in_refused") + raise SignInRefused("linked_proxy_not_found") monkeypatch.setattr("gumloop.cli.commands.linked_proxy.GatewayConnection", RefusedConnection) @@ -128,18 +146,61 @@ async def run(self) -> None: assert not respx.calls +def test_connect_says_it_connected_once_across_reconnects(cli_runner, service, monkeypatch): + save_registration(HOST, _registration()) + + class ReconnectingConnection: + def __init__(self, *, on_connected: Callable[[], None], **kwargs: object) -> None: + self._on_connected = on_connected + + async def run(self) -> None: + self._on_connected() + self._on_connected() + + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.GatewayConnection", ReconnectingConnection) + + result = cli_runner.invoke(app, ["browser", "proxy", "connect"]) + + assert result.exit_code == 0, result.output + assert " ".join(result.stdout.split()).count("Connected. Agents can now send browser traffic") == 1 + + +@pytest.mark.parametrize(("flags", "printed"), [([], False), (["-v"], True)]) +def test_connect_prints_the_sites_agents_open_only_when_verbose(cli_runner, service, monkeypatch, flags, printed): + save_registration(HOST, _registration()) + + class OpeningConnection: + def __init__(self, *, on_open: Callable[[Target], None] | None, **kwargs: object) -> None: + self._on_open = on_open + + async def run(self) -> None: + if self._on_open is not None: + self._on_open(Target(host="example.com", port=443)) + + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.GatewayConnection", OpeningConnection) + + result = cli_runner.invoke(app, ["browser", "proxy", "connect", *flags]) + + assert result.exit_code == 0, result.output + assert ("example.com" in result.stdout) is printed + + @pytest.mark.parametrize( ("reason", "kept", "expected"), [ - ("not_found", False, "This computer was unlinked from Gumloop."), - ("permission_denied", True, "Your organization's roles don't allow you to use personal proxies."), - ("not_released", True, "Personal proxies aren't available for your organization yet."), + ("linked_proxy_not_found", False, "This computer was unlinked from Gumloop."), + ( + "organization_permission_required", + True, + "Your organization's roles don't allow you to use personal proxies.", + ), + ("route_not_found", True, "Personal proxies aren't available for your organization yet."), ], ) def test_connect_keeps_the_registration_unless_the_linked_proxy_was_removed( cli_runner, service, monkeypatch, reason, kept, expected ): - save_registration(HOST, REGISTRATION) + save_registration(HOST, _registration()) class RefusedConnection: def __init__(self, **kwargs: object) -> None: @@ -153,7 +214,7 @@ async def run(self) -> None: result = cli_runner.invoke(app, ["browser", "proxy", "connect"]) assert result.exit_code == 0, result.output - assert (load_registration(HOST) == REGISTRATION) is kept + assert (load_registration(HOST) == _registration()) is kept assert expected in " ".join(result.stderr.split()) @@ -188,24 +249,27 @@ def test_link_says_why_personal_proxies_are_off(cli_runner, service, status, pay (503, {"error": "unavailable"}, GatewayTokenUnavailable, True), (404, {"error": {"code": "linked_proxy_not_found"}}, None, False), (403, {"error": "policy_denied", "denied_keys": ["organization:use_linked_proxies"]}, None, True), + (403, {"error": {"code": "organization_permission_required"}}, None, True), (404, {"error": "route_not_found"}, None, True), + (403, {"error": {"code": "not_a_code_the_cli_knows"}}, GatewayTokenUnavailable, True), + (404, {"error": "not_found"}, GatewayTokenUnavailable, True), ], ) @respx.mock def test_connect_signs_in_with_a_gateway_token_and_stops_when_gumloop_refuses_one( cli_runner, service, monkeypatch, status, payload, expected_token, kept ): - save_registration(HOST, REGISTRATION) + save_registration(HOST, _registration()) respx.post(f"{API_BASE}/linked-proxies/dp-1/gateway-token").respond(status, json=payload) fetched: list[object] = [] class TokenFetchingConnection: - def __init__(self, **kwargs: object) -> None: - self._gateway_token = kwargs["gateway_token"] + def __init__(self, *, gateway_token: Callable[[], LinkedProxyGatewayToken], **kwargs: object) -> None: + self._gateway_token = gateway_token async def run(self) -> None: try: - fetched.append(self._gateway_token()) + fetched.append(self._gateway_token().gateway_token) except GatewayTokenUnavailable as error: fetched.append(type(error)) @@ -215,16 +279,16 @@ async def run(self) -> None: assert result.exit_code == 0, result.output assert fetched == ([expected_token] if expected_token is not None else []) - assert (load_registration(HOST) == REGISTRATION) is kept + assert (load_registration(HOST) == _registration()) is kept @respx.mock def test_connect_signs_in_with_the_login_stored_after_it_started(cli_runner, service, monkeypatch): - save_registration(HOST, REGISTRATION) + save_registration(HOST, _registration()) route = respx.post(f"{API_BASE}/linked-proxies/dp-1/gateway-token").respond(200, json={"gateway_token": "t"}) class ReconnectingConnection: - def __init__(self, *, gateway_token: Callable[[], str], **kwargs: object) -> None: + def __init__(self, *, gateway_token: Callable[[], LinkedProxyGatewayToken], **kwargs: object) -> None: self._gateway_token = gateway_token async def run(self) -> None: @@ -240,6 +304,80 @@ async def run(self) -> None: assert [call.request.headers["authorization"] for call in route.calls] == ["Bearer key", "Bearer fresh"] +@pytest.mark.parametrize( + "login", + [Credentials(api_key="key", user_id="someone-else"), Credentials(access_token=_access_token("someone-else"))], +) +@respx.mock +def test_connect_as_someone_else_disconnects_and_keeps_the_registration(cli_runner, service, monkeypatch, login): + save_registration(HOST, _registration()) + save_credentials(login) + route = respx.post(f"{API_BASE}/linked-proxies/dp-1/gateway-token") + + class TokenFetchingConnection: + def __init__(self, *, gateway_token: Callable[[], LinkedProxyGatewayToken], **kwargs: object) -> None: + self._gateway_token = gateway_token + + async def run(self) -> None: + self._gateway_token() + + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.GatewayConnection", TokenFetchingConnection) + + result = cli_runner.invoke(app, ["browser", "proxy", "connect"]) + + assert result.exit_code == 0, result.output + assert not route.called + assert load_registration(HOST) == _registration() + assert "You logged in to Gumloop as someone else" in " ".join(result.stderr.split()) + + +def test_connect_forgets_a_registration_whose_key_is_gone(cli_runner, service, monkeypatch): + save_registration(HOST, _registration(public_key="a key the keychain no longer has")) + + class UnusedConnection: + def __init__(self, **kwargs: object) -> None: + pytest.fail("connected with a key Gumloop doesn't know") + + monkeypatch.setattr("gumloop.cli.commands.linked_proxy.GatewayConnection", UnusedConnection) + + result = cli_runner.invoke(app, ["browser", "proxy", "connect"]) + + assert result.exit_code == 0, result.output + assert load_registration(HOST) is None + assert "key is gone from the OS keychain" in " ".join(result.stderr.split()) + + +@respx.mock +def test_link_registers_again_when_the_keychain_key_changed(cli_runner, service): + save_registration(HOST, _registration(public_key="a key the keychain no longer has")) + route = respx.post(f"{API_BASE}/linked-proxies/cli").respond( + 201, + json={ + "linked_proxy": {"id": "dp-2", "name": "Ada's laptop", "kind": "cli", "is_default": True}, + "gateway_url": GATEWAY_URL, + }, + ) + + result = cli_runner.invoke(app, ["browser", "proxy", "link"]) + + assert result.exit_code == 0, result.output + assert route.called + assert load_registration(HOST) == _registration(linked_proxy_id="dp-2") + + +@respx.mock +def test_link_refuses_a_computer_linked_to_someone_else(cli_runner, service): + save_registration(HOST, _registration(user_id="someone-else")) + route = respx.post(f"{API_BASE}/linked-proxies/cli") + + result = cli_runner.invoke(app, ["browser", "proxy", "link"]) + + assert result.exit_code == 1 + assert not route.called + assert not service.installed + assert "linked to another Gumloop user" in " ".join(result.stderr.split()) + + @pytest.mark.parametrize( ("running", "connected", "last_error", "expected"), [ @@ -251,7 +389,7 @@ async def run(self) -> None: def test_status_reads_the_running_linked_proxy_connection( cli_runner, service, monkeypatch, running, connected, last_error, expected ): - save_registration(HOST, REGISTRATION) + save_registration(HOST, _registration()) save_connection_status( HOST, LinkedProxyConnectionStatus(connected=connected, since=datetime.now(timezone.utc), last_error=last_error), @@ -269,7 +407,7 @@ def no_background_service() -> FakeService: raise NoBackgroundService("no systemd user session") monkeypatch.setattr("gumloop.cli.commands.linked_proxy.service_for_current_platform", no_background_service) - save_registration(HOST, REGISTRATION) + save_registration(HOST, _registration()) result = cli_runner.invoke(app, ["browser", "proxy", "status"]) @@ -281,7 +419,7 @@ def no_background_service() -> FakeService: @respx.mock def test_removing_deletes_the_linked_proxy_then_the_key(cli_runner, service, command): service.installed = True - save_registration(HOST, REGISTRATION) + save_registration(HOST, _registration()) load_or_create_key(HOST) route = respx.delete(f"{API_BASE}/linked-proxies/dp-1").respond(204) @@ -300,7 +438,7 @@ def test_removing_another_backends_linked_proxy_keeps_the_service_only_while_the ): service.installed = True if login_has_linked_proxy: - save_registration(HOST, REGISTRATION) + save_registration(HOST, _registration()) result = cli_runner.invoke( app, ["browser", "proxy", "unlink"], env={"GUMLOOP_BASE_URL": "https://staging.api.gumloop.com"} @@ -312,7 +450,7 @@ def test_removing_another_backends_linked_proxy_keeps_the_service_only_while_the @respx.mock def test_remove_keeps_the_key_when_gumloop_cannot_delete_the_linked_proxy(cli_runner, service): - save_registration(HOST, REGISTRATION) + save_registration(HOST, _registration()) key = public_key_text(load_or_create_key(HOST)) respx.delete(f"{API_BASE}/linked-proxies/dp-1").respond(503, json={"error": "unavailable"}) @@ -320,4 +458,4 @@ def test_remove_keeps_the_key_when_gumloop_cannot_delete_the_linked_proxy(cli_ru assert result.exit_code == 1 assert public_key_text(load_or_create_key(HOST)) == key - assert load_registration(HOST) == REGISTRATION + assert load_registration(HOST) == _registration() diff --git a/tests/cli/test_linked_proxy_key.py b/tests/cli/test_linked_proxy_key.py index 432ab87..3911f55 100644 --- a/tests/cli/test_linked_proxy_key.py +++ b/tests/cli/test_linked_proxy_key.py @@ -12,13 +12,15 @@ def test_key_and_registration_persist(temporary_home): host = "api.gumloop.com" + first = public_key_text(load_or_create_key(host)) registration = LinkedProxyRegistration( linked_proxy_id="dp-1", name="Ada's laptop", gateway_url="wss://linked-proxy-gateway.gumloop.com/v1/cli/connect", + public_key=first, + user_id="ada", ) - first = public_key_text(load_or_create_key(host)) save_registration(host, registration) assert public_key_text(load_or_create_key(host)) == first @@ -30,7 +32,9 @@ def test_key_and_registration_persist(temporary_home): ["wss://linked-proxy-gateway.gumloop.com/v1/cli/connect", "ws://localhost:8443/v1/cli/connect"], ) def test_registration_accepts_an_encrypted_or_local_gateway(gateway_url): - registration = LinkedProxyRegistration(linked_proxy_id="dp-1", name="Ada's laptop", gateway_url=gateway_url) + registration = LinkedProxyRegistration( + linked_proxy_id="dp-1", name="Ada's laptop", gateway_url=gateway_url, public_key="key" + ) assert registration.gateway_url == gateway_url @@ -41,4 +45,5 @@ def test_registration_refuses_an_unencrypted_remote_gateway(): linked_proxy_id="dp-1", name="Ada's laptop", gateway_url="ws://linked-proxy-gateway.gumloop.com/v1/cli/connect", + public_key="key", ) diff --git a/tests/linked_proxy/test_connection.py b/tests/linked_proxy/test_connection.py index a0e0c1d..2e1a776 100644 --- a/tests/linked_proxy/test_connection.py +++ b/tests/linked_proxy/test_connection.py @@ -172,20 +172,28 @@ def fetch() -> LinkedProxyGatewayToken: @pytest.mark.parametrize( - ("outcome", "reason"), + ("refusal", "described"), [ - (Outcome(ConnectionClosed(Close(4001, "not_a_member"), None), opened=True), "not_a_member"), - (Outcome(_refused_handshake(401, "sign_in_refused")), "sign_in_refused"), + ( + Outcome(ConnectionClosed(Close(4001, "not_a_member"), None), opened=True), + "the gateway closed the connection (not_a_member)", + ), + ( + Outcome(_refused_handshake(401, "sign_in_refused")), + "the gateway refused the sign-in (is this computer's clock right?)", + ), ], ) -def test_refused_sign_in_stops_without_reconnecting(outcome, reason): - gateway = ScriptedGateway([outcome]) +def test_a_gateway_refusal_reconnects_and_gumloop_decides_whether_to_stop(refusal, described): + gateway = ScriptedGateway([refusal]) + events: list[str] = [] with pytest.raises(SignInRefused) as refused: - _run(gateway, [True]) + _run(gateway, [True, True], events, gateway_token=_tokens("token-1", SignInRefused("linked_proxy_not_found"))) - assert refused.value.reason == reason - assert gateway.waits == [] + assert refused.value.reason == "linked_proxy_not_found" + assert described in events + assert len(gateway.waits) == 1 def test_other_failures_reconnect_with_a_growing_wait_until_signed_out(): @@ -206,7 +214,7 @@ def test_other_failures_reconnect_with_a_growing_wait_until_signed_out(): "can't reach the gateway (unreachable)", ] assert len(gateway.waits) == 2 - for wait, cap in zip(gateway.waits, [1.0, 2.0]): + for wait, cap in zip(gateway.waits, [5.0, 10.0], strict=True): assert FIRST_RETRY_SECONDS <= wait <= cap assert len(set(gateway.authorizations)) == 2