Skip to content

Commit 8ca990e

Browse files
feat(portal): support tunnel authorization header (#9597)
1 parent 018cb8c commit 8ca990e

5 files changed

Lines changed: 17 additions & 11 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: 120
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai/runloop-96b0ac0a148db6fde2e8363ea2dcfaa63f2dc23cf35c30c5fcfffbefc222e5d1.yml
3-
openapi_spec_hash: 01b9dbab4b732e4b83952debd108e404
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai/runloop-1fc91661b27bb65f33c23969c150c99919820c6750b0f40dfad0d22e8827a82c.yml
3+
openapi_spec_hash: 2659e11dc1a69ec327f5e7bb0c0c6fe2
44
config_hash: ed1fdd7c9f0a25647e16b602bad4ff2e

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,8 @@ def create_pty_tunnel(
600600
Devbox.
601601
602602
This tunnel is not persisted on the Devbox and is generated fresh on
603-
each request. The returned auth_token must be passed as a Bearer token in the
604-
Authorization header.
603+
each request. The returned auth_token should be passed as a Bearer token in the
604+
X-Runloop-Tunnel-Authorization header.
605605
606606
Args:
607607
extra_headers: Send extra headers
@@ -2263,8 +2263,8 @@ async def create_pty_tunnel(
22632263
Devbox.
22642264
22652265
This tunnel is not persisted on the Devbox and is generated fresh on
2266-
each request. The returned auth_token must be passed as a Bearer token in the
2267-
Authorization header.
2266+
each request. The returned auth_token should be passed as a Bearer token in the
2267+
X-Runloop-Tunnel-Authorization header.
22682268
22692269
Args:
22702270
extra_headers: Send extra headers

src/runloop_api_client/types/devbox_view.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,5 +146,6 @@ class DevboxView(BaseModel):
146146
services running inside a Devbox without requiring direct network access. Each
147147
tunnel is uniquely identified by an encrypted tunnel_key and can be configured
148148
for either open (public) or authenticated access. Usage:
149-
https://{port}-{tunnel_key}.tunnel.runloop.ai
149+
https://{port}-{tunnel_key}.tunnel.runloop.ai. Authenticated tunnels should pass
150+
auth_token as X-Runloop-Tunnel-Authorization: Bearer {auth_token}.
150151
"""

src/runloop_api_client/types/pty_tunnel_view.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@
88
class PtyTunnelView(BaseModel):
99
"""An ephemeral PTY tunnel providing authenticated terminal access to a Devbox.
1010
11-
These tunnels are not stored on the Devbox and are generated fresh on each request. Usage: https://{port}-{tunnel_key}.tunnel.runloop.ai with Authorization: Bearer {auth_token}
11+
These tunnels are not stored on the Devbox and are generated fresh on each request. Usage: https://{port}-{tunnel_key}.tunnel.runloop.ai with X-Runloop-Tunnel-Authorization: Bearer {auth_token}.
1212
"""
1313

1414
auth_token: str
15-
"""Bearer token for tunnel authentication. Always required for PTY tunnels."""
15+
"""Bearer token for tunnel authentication.
16+
17+
Always required for PTY tunnels. Pass as X-Runloop-Tunnel-Authorization: Bearer
18+
{auth_token}.
19+
"""
1620

1721
tunnel_key: str
1822
"""The encrypted tunnel key used to construct the tunnel URL.

src/runloop_api_client/types/tunnel_view.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class TunnelView(BaseModel):
1212
"""A V2 tunnel provides secure HTTP access to services running on a Devbox.
1313
1414
Tunnels allow external clients to reach web servers, APIs, or other HTTP services running inside a Devbox without requiring direct network access. Each tunnel is uniquely identified by an encrypted tunnel_key and can be configured for either open (public) or authenticated access.
15-
Usage: https://{port}-{tunnel_key}.tunnel.runloop.ai
15+
Usage: https://{port}-{tunnel_key}.tunnel.runloop.ai. Authenticated tunnels should pass auth_token as X-Runloop-Tunnel-Authorization: Bearer {auth_token}.
1616
"""
1717

1818
auth_mode: Literal["open", "authenticated"]
@@ -42,5 +42,6 @@ class TunnelView(BaseModel):
4242
auth_token: Optional[str] = None
4343
"""Bearer token for tunnel authentication.
4444
45-
Only present when auth_mode is 'authenticated'.
45+
Only present when auth_mode is 'authenticated'. Pass as
46+
X-Runloop-Tunnel-Authorization: Bearer {auth_token}.
4647
"""

0 commit comments

Comments
 (0)