Skip to content

Commit 03f13ad

Browse files
committed
Add internal_url to trickle responses, bump Python minimum version
1 parent 5bdc4e7 commit 03f13ad

3 files changed

Lines changed: 12 additions & 329 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
55
[project]
66
name = "livepeer-gateway"
77
version = "0.1.0"
8-
requires-python = ">=3.10"
8+
requires-python = ">=3.12"
99
dependencies = [
1010
"grpcio>=1.65.0",
1111
"protobuf>=4.25.0",

src/livepeer_gateway/live_runner.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import shutil
1010
import subprocess
1111
from dataclasses import dataclass, field
12-
from typing import Any, Awaitable, Callable, Literal, Optional, Protocol, TypedDict, cast
12+
from typing import Any, Awaitable, Callable, Literal, NotRequired, Optional, Protocol, TypedDict, cast
1313
from urllib.parse import quote, urlparse, urlunparse
1414

1515
import aiohttp
@@ -42,7 +42,13 @@ class LiveRunnerTrickleChannelRequest(TypedDict):
4242
class LiveRunnerTrickleChannel(TypedDict):
4343
name: str
4444
channel_name: str
45+
# Public/external trickle URL.
4546
url: str
47+
# Optional private-network URL for runner-to-orchestrator traffic. When the
48+
# runner and orchestrator share a network, such as Docker, this can bypass
49+
# public TLS/routing, but it is only present when the orchestrator is
50+
# configured to return one.
51+
internal_url: NotRequired[str]
4652
mime_type: str
4753

4854

@@ -872,7 +878,7 @@ def _is_trickle_channel_response(value: object) -> bool:
872878
return all(
873879
isinstance(value.get(key), str)
874880
for key in ("name", "channel_name", "url", "mime_type")
875-
)
881+
) and ("internal_url" not in value or isinstance(value.get("internal_url"), str))
876882

877883

878884
async def _post_empty(url: str, headers: dict[str, str], timeout: float) -> None:

0 commit comments

Comments
 (0)