Skip to content

Commit bf94b51

Browse files
wall-rltode-rl
andauthored
chore: remove the SSH devbox helpers (#18)
The platform is removing SSH access to devboxes (runloopai/runloop#13139). Drop the hand-written create_ssh_key wrappers and their tests so the custom code no longer references the endpoint before the spec removes it. The generated client is unchanged. Co-authored-by: tode-rl <tony@runloop.ai>
1 parent 81fbf99 commit bf94b51

6 files changed

Lines changed: 2 additions & 114 deletions

File tree

‎src/runloop_api_client/sdk/async_devbox.py‎

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
DevboxView,
1212
TunnelView,
1313
DevboxExecutionDetailView,
14-
DevboxCreateSSHKeyResponse,
1514
)
1615
from ._types import (
1716
LogCallback,
@@ -647,31 +646,12 @@ async def upload(
647646
class AsyncNetworkInterface:
648647
"""Interface for networking operations on a devbox.
649648
650-
Accessed via devbox.net property. Provides coroutines for SSH access and tunneling.
649+
Accessed via devbox.net property. Provides coroutines for tunneling.
651650
"""
652651

653652
def __init__(self, devbox: AsyncDevbox) -> None:
654653
self._devbox = devbox
655654

656-
async def create_ssh_key(
657-
self,
658-
**options: Unpack[LongRequestOptions],
659-
) -> DevboxCreateSSHKeyResponse:
660-
"""Create an SSH key for remote access to the devbox.
661-
662-
:param options: Optional long-running request configuration
663-
:return: Response containing SSH connection info
664-
:rtype: DevboxCreateSSHKeyResponse
665-
666-
Example:
667-
>>> ssh_key = await devbox.net.create_ssh_key()
668-
>>> print(f"SSH URL: {ssh_key.url}")
669-
"""
670-
return await self._devbox._client.devboxes.create_ssh_key(
671-
self._devbox.id,
672-
**options,
673-
)
674-
675655
async def enable_tunnel(
676656
self,
677657
**params: Unpack[SDKDevboxEnableTunnelParams],

‎src/runloop_api_client/sdk/devbox.py‎

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
DevboxView,
1212
TunnelView,
1313
DevboxExecutionDetailView,
14-
DevboxCreateSSHKeyResponse,
1514
)
1615
from ._types import (
1716
LogCallback,
@@ -650,31 +649,12 @@ def upload(
650649
class NetworkInterface:
651650
"""Interface for network operations on a devbox.
652651
653-
Accessed via devbox.net property. Provides methods for SSH access and tunneling.
652+
Accessed via devbox.net property. Provides methods for tunneling.
654653
"""
655654

656655
def __init__(self, devbox: Devbox) -> None:
657656
self._devbox = devbox
658657

659-
def create_ssh_key(
660-
self,
661-
**options: Unpack[LongRequestOptions],
662-
) -> DevboxCreateSSHKeyResponse:
663-
"""Create an SSH key for remote access to the devbox.
664-
665-
:param options: Optional long-running request configuration
666-
:return: Response containing SSH connection info
667-
:rtype: :class:`~runloop_api_client.types.devbox_create_ssh_key_response.DevboxCreateSSHKeyResponse`
668-
669-
Example:
670-
>>> ssh_key = devbox.net.create_ssh_key()
671-
>>> print(f"SSH URL: {ssh_key.url}")
672-
"""
673-
return self._devbox._client.devboxes.create_ssh_key(
674-
self._devbox.id,
675-
**options,
676-
)
677-
678658
def enable_tunnel(
679659
self,
680660
**params: Unpack[SDKDevboxEnableTunnelParams],

‎tests/sdk/async_devbox/test_interfaces.py‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -173,24 +173,6 @@ async def test_upload(self, mock_async_client: AsyncMock, tmp_path: Path) -> Non
173173
class TestAsyncNetworkInterface:
174174
"""Tests for _AsyncNetworkInterface."""
175175

176-
@pytest.mark.asyncio
177-
async def test_create_ssh_key(self, mock_async_client: AsyncMock) -> None:
178-
"""Test create SSH key."""
179-
ssh_key_response = SimpleNamespace(public_key="ssh-rsa ...")
180-
mock_async_client.devboxes.create_ssh_key = AsyncMock(return_value=ssh_key_response)
181-
182-
devbox = AsyncDevbox(mock_async_client, "dbx_123")
183-
result = await devbox.net.create_ssh_key(
184-
extra_headers={"X-Custom": "value"},
185-
extra_query={"param": "value"},
186-
extra_body={"key": "value"},
187-
timeout=30.0,
188-
idempotency_key="key-123",
189-
)
190-
191-
assert result == ssh_key_response
192-
mock_async_client.devboxes.create_ssh_key.assert_called_once()
193-
194176
@pytest.mark.asyncio
195177
async def test_remove_tunnel(self, mock_async_client: AsyncMock) -> None:
196178
"""Test remove tunnel."""

‎tests/sdk/devbox/test_interfaces.py‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -265,30 +265,6 @@ def test_upload(self, mock_client: Mock, tmp_path: Path) -> None:
265265
class TestNetworkInterface:
266266
"""Tests for _NetworkInterface."""
267267

268-
def test_create_ssh_key(self, mock_client: Mock) -> None:
269-
"""Test create SSH key."""
270-
ssh_key_response = SimpleNamespace(public_key="ssh-rsa ...")
271-
mock_client.devboxes.create_ssh_key.return_value = ssh_key_response
272-
273-
devbox = Devbox(mock_client, "dbx_123")
274-
result = devbox.net.create_ssh_key(
275-
extra_headers={"X-Custom": "value"},
276-
extra_query={"param": "value"},
277-
extra_body={"key": "value"},
278-
timeout=30.0,
279-
idempotency_key="key-123",
280-
)
281-
282-
assert result == ssh_key_response
283-
mock_client.devboxes.create_ssh_key.assert_called_once_with(
284-
"dbx_123",
285-
extra_headers={"X-Custom": "value"},
286-
extra_query={"param": "value"},
287-
extra_body={"key": "value"},
288-
timeout=30.0,
289-
idempotency_key="key-123",
290-
)
291-
292268
def test_remove_tunnel(self, mock_client: Mock) -> None:
293269
"""Test remove tunnel."""
294270
mock_client.devboxes.remove_tunnel.return_value = object()

‎tests/smoketests/sdk/test_async_devbox.py‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -439,21 +439,6 @@ async def test_keep_alive(self, shared_devbox: AsyncDevbox) -> None:
439439
class TestAsyncDevboxNetworking:
440440
"""Test async devbox networking operations."""
441441

442-
@pytest.mark.timeout(TWO_MINUTE_TIMEOUT)
443-
async def test_create_ssh_key(self, async_sdk_client: AsyncRunloopSDK) -> None:
444-
"""Test creating SSH key for devbox."""
445-
devbox = await async_sdk_client.devbox.create(
446-
name=unique_name("sdk-async-devbox-ssh"),
447-
launch_parameters={"resource_size_request": "SMALL", "keep_alive_time_seconds": 60 * 5},
448-
)
449-
450-
try:
451-
ssh_key = await devbox.net.create_ssh_key()
452-
assert ssh_key is not None
453-
assert ssh_key.ssh_private_key is not None
454-
finally:
455-
await devbox.shutdown()
456-
457442
@pytest.mark.timeout(TWO_MINUTE_TIMEOUT)
458443
async def test_create_with_tunnel_param(self, async_sdk_client: AsyncRunloopSDK) -> None:
459444
"""Test creating a devbox with tunnel configuration in create params."""

‎tests/smoketests/sdk/test_devbox.py‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -435,21 +435,6 @@ def test_keep_alive(self, shared_devbox: Devbox) -> None:
435435
class TestDevboxNetworking:
436436
"""Test devbox networking operations."""
437437

438-
@pytest.mark.timeout(TWO_MINUTE_TIMEOUT)
439-
def test_create_ssh_key(self, sdk_client: RunloopSDK) -> None:
440-
"""Test creating SSH key for devbox."""
441-
devbox = sdk_client.devbox.create(
442-
name=unique_name("sdk-devbox-ssh"),
443-
launch_parameters={"resource_size_request": "SMALL", "keep_alive_time_seconds": 60 * 5},
444-
)
445-
446-
try:
447-
ssh_key = devbox.net.create_ssh_key()
448-
assert ssh_key is not None
449-
assert ssh_key.ssh_private_key is not None
450-
finally:
451-
devbox.shutdown()
452-
453438
@pytest.mark.timeout(TWO_MINUTE_TIMEOUT)
454439
def test_create_with_tunnel_param(self, sdk_client: RunloopSDK) -> None:
455440
"""Test creating a devbox with tunnel configuration in create params."""

0 commit comments

Comments
 (0)