Skip to content

Commit c042398

Browse files
feat(network): add allow_runloop_mirrors egress flag to network policies (#10350)
1 parent b77a065 commit c042398

6 files changed

Lines changed: 44 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 119
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai/runloop-53098c6f2c4d6e31f36a6975b3f7f504ad3f8fbe5a209dac9b2304afcd053a77.yml
3-
openapi_spec_hash: 05dcd360988cd1044b6a7ab03933a5ef
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai/runloop-0b7cd0c2fc193b18189cd7f44cf45ece7726b5d485fb72577f7d235266432ea0.yml
3+
openapi_spec_hash: 78c340dbfb9d3d58b24ef318fc2a657b
44
config_hash: 218b8d25038e627faab98532392ee9a0

src/runloop_api_client/resources/network_policies.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def create(
5353
allow_all: Optional[bool] | Omit = omit,
5454
allow_devbox_to_devbox: Optional[bool] | Omit = omit,
5555
allow_mcp_gateway: Optional[bool] | Omit = omit,
56+
allow_runloop_mirrors: Optional[bool] | Omit = omit,
5657
allowed_cidrs: Optional[Iterable[AllowedCidrParam]] | Omit = omit,
5758
allowed_hostnames: Optional[SequenceNotStr[str]] | Omit = omit,
5859
description: Optional[str] | Omit = omit,
@@ -86,6 +87,9 @@ def create(
8687
allow_mcp_gateway: (Optional) If true, allows devbox egress to the MCP hub for MCP server access.
8788
Defaults to false.
8889
90+
allow_runloop_mirrors: (Optional) If true, allows devbox egress to Runloop's package/image registry
91+
mirrors. Defaults to false. Implicitly allowed when allow_all is true.
92+
8993
allowed_cidrs: (Optional) IPv4 CIDR-based allow list with optional port restrictions, additive
9094
with allowed_hostnames. Example: [{'cidr': '10.12.0.0/16', 'ports': [{'port':
9195
443}]}].
@@ -114,6 +118,7 @@ def create(
114118
"allow_all": allow_all,
115119
"allow_devbox_to_devbox": allow_devbox_to_devbox,
116120
"allow_mcp_gateway": allow_mcp_gateway,
121+
"allow_runloop_mirrors": allow_runloop_mirrors,
117122
"allowed_cidrs": allowed_cidrs,
118123
"allowed_hostnames": allowed_hostnames,
119124
"description": description,
@@ -171,6 +176,7 @@ def update(
171176
allow_all: Optional[bool] | Omit = omit,
172177
allow_devbox_to_devbox: Optional[bool] | Omit = omit,
173178
allow_mcp_gateway: Optional[bool] | Omit = omit,
179+
allow_runloop_mirrors: Optional[bool] | Omit = omit,
174180
allowed_cidrs: Optional[Iterable[AllowedCidrParam]] | Omit = omit,
175181
allowed_hostnames: Optional[SequenceNotStr[str]] | Omit = omit,
176182
description: Optional[str] | Omit = omit,
@@ -196,6 +202,9 @@ def update(
196202
197203
allow_mcp_gateway: If true, allows devbox egress to the MCP hub.
198204
205+
allow_runloop_mirrors: If true, allows devbox egress to Runloop's package/image registry mirrors.
206+
Implicitly allowed when allow_all is true.
207+
199208
allowed_cidrs: Updated IPv4 CIDR-based allow list with optional port restrictions, additive
200209
with allowed_hostnames.
201210
@@ -226,6 +235,7 @@ def update(
226235
"allow_all": allow_all,
227236
"allow_devbox_to_devbox": allow_devbox_to_devbox,
228237
"allow_mcp_gateway": allow_mcp_gateway,
238+
"allow_runloop_mirrors": allow_runloop_mirrors,
229239
"allowed_cidrs": allowed_cidrs,
230240
"allowed_hostnames": allowed_hostnames,
231241
"description": description,
@@ -377,6 +387,7 @@ async def create(
377387
allow_all: Optional[bool] | Omit = omit,
378388
allow_devbox_to_devbox: Optional[bool] | Omit = omit,
379389
allow_mcp_gateway: Optional[bool] | Omit = omit,
390+
allow_runloop_mirrors: Optional[bool] | Omit = omit,
380391
allowed_cidrs: Optional[Iterable[AllowedCidrParam]] | Omit = omit,
381392
allowed_hostnames: Optional[SequenceNotStr[str]] | Omit = omit,
382393
description: Optional[str] | Omit = omit,
@@ -410,6 +421,9 @@ async def create(
410421
allow_mcp_gateway: (Optional) If true, allows devbox egress to the MCP hub for MCP server access.
411422
Defaults to false.
412423
424+
allow_runloop_mirrors: (Optional) If true, allows devbox egress to Runloop's package/image registry
425+
mirrors. Defaults to false. Implicitly allowed when allow_all is true.
426+
413427
allowed_cidrs: (Optional) IPv4 CIDR-based allow list with optional port restrictions, additive
414428
with allowed_hostnames. Example: [{'cidr': '10.12.0.0/16', 'ports': [{'port':
415429
443}]}].
@@ -438,6 +452,7 @@ async def create(
438452
"allow_all": allow_all,
439453
"allow_devbox_to_devbox": allow_devbox_to_devbox,
440454
"allow_mcp_gateway": allow_mcp_gateway,
455+
"allow_runloop_mirrors": allow_runloop_mirrors,
441456
"allowed_cidrs": allowed_cidrs,
442457
"allowed_hostnames": allowed_hostnames,
443458
"description": description,
@@ -495,6 +510,7 @@ async def update(
495510
allow_all: Optional[bool] | Omit = omit,
496511
allow_devbox_to_devbox: Optional[bool] | Omit = omit,
497512
allow_mcp_gateway: Optional[bool] | Omit = omit,
513+
allow_runloop_mirrors: Optional[bool] | Omit = omit,
498514
allowed_cidrs: Optional[Iterable[AllowedCidrParam]] | Omit = omit,
499515
allowed_hostnames: Optional[SequenceNotStr[str]] | Omit = omit,
500516
description: Optional[str] | Omit = omit,
@@ -520,6 +536,9 @@ async def update(
520536
521537
allow_mcp_gateway: If true, allows devbox egress to the MCP hub.
522538
539+
allow_runloop_mirrors: If true, allows devbox egress to Runloop's package/image registry mirrors.
540+
Implicitly allowed when allow_all is true.
541+
523542
allowed_cidrs: Updated IPv4 CIDR-based allow list with optional port restrictions, additive
524543
with allowed_hostnames.
525544
@@ -550,6 +569,7 @@ async def update(
550569
"allow_all": allow_all,
551570
"allow_devbox_to_devbox": allow_devbox_to_devbox,
552571
"allow_mcp_gateway": allow_mcp_gateway,
572+
"allow_runloop_mirrors": allow_runloop_mirrors,
553573
"allowed_cidrs": allowed_cidrs,
554574
"allowed_hostnames": allowed_hostnames,
555575
"description": description,

src/runloop_api_client/types/network_policy_create_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ class NetworkPolicyCreateParams(TypedDict, total=False):
4343
Defaults to false.
4444
"""
4545

46+
allow_runloop_mirrors: Optional[bool]
47+
"""
48+
(Optional) If true, allows devbox egress to Runloop's package/image registry
49+
mirrors. Defaults to false. Implicitly allowed when allow_all is true.
50+
"""
51+
4652
allowed_cidrs: Optional[Iterable[AllowedCidrParam]]
4753
"""
4854
(Optional) IPv4 CIDR-based allow list with optional port restrictions, additive

src/runloop_api_client/types/network_policy_update_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ class NetworkPolicyUpdateParams(TypedDict, total=False):
2424
allow_mcp_gateway: Optional[bool]
2525
"""If true, allows devbox egress to the MCP hub."""
2626

27+
allow_runloop_mirrors: Optional[bool]
28+
"""If true, allows devbox egress to Runloop's package/image registry mirrors.
29+
30+
Implicitly allowed when allow_all is true.
31+
"""
32+
2733
allowed_cidrs: Optional[Iterable[AllowedCidrParam]]
2834
"""
2935
Updated IPv4 CIDR-based allow list with optional port restrictions, additive

src/runloop_api_client/types/network_policy_view.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ class Egress(BaseModel):
2626
allow_mcp_gateway: bool
2727
"""If true, allows devbox egress to the MCP hub for MCP server access."""
2828

29+
allow_runloop_mirrors: bool
30+
"""If true, allows devbox egress to Runloop's package/image registry mirrors.
31+
32+
Implicitly allowed when allow_all is true.
33+
"""
34+
2935
allowed_cidrs: List[AllowedCidr]
3036
"""
3137
CIDR-based allow list with optional port restrictions, additive with

tests/api_resources/test_network_policies.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None:
3535
allow_all=True,
3636
allow_devbox_to_devbox=True,
3737
allow_mcp_gateway=True,
38+
allow_runloop_mirrors=True,
3839
allowed_cidrs=[
3940
{
4041
"cidr": "cidr",
@@ -129,6 +130,7 @@ def test_method_update_with_all_params(self, client: Runloop) -> None:
129130
allow_all=True,
130131
allow_devbox_to_devbox=True,
131132
allow_mcp_gateway=True,
133+
allow_runloop_mirrors=True,
132134
allowed_cidrs=[
133135
{
134136
"cidr": "cidr",
@@ -274,6 +276,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -
274276
allow_all=True,
275277
allow_devbox_to_devbox=True,
276278
allow_mcp_gateway=True,
279+
allow_runloop_mirrors=True,
277280
allowed_cidrs=[
278281
{
279282
"cidr": "cidr",
@@ -368,6 +371,7 @@ async def test_method_update_with_all_params(self, async_client: AsyncRunloop) -
368371
allow_all=True,
369372
allow_devbox_to_devbox=True,
370373
allow_mcp_gateway=True,
374+
allow_runloop_mirrors=True,
371375
allowed_cidrs=[
372376
{
373377
"cidr": "cidr",

0 commit comments

Comments
 (0)