Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/06_ssh_access.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
log:
2026-12-04: `colab ssh` no longer sends an `Origin` header on the `/colab/ssh` upgrade (`suppress_origin=True`); the runtime rejects an upgrade that carries one with HTTP 403.
2026-11-27: Fixed `colab ssh` under Git for Windows' MSYS `ssh` (`/usr/bin/ssh` in Git Bash): ProxyCommand path arguments now use forward slashes on Windows (bash stripped the backslashes, failing with `D:Projects...python.exe: not found`), and `UserKnownHostsFile` is `/dev/null` when `ssh.exe` is an MSYS/Cygwin build (it wrote the host key to a `./nul` file). Native Windows OpenSSH keeps `nul`. Verified live from Git Bash and PowerShell (OpenSSH_for_Windows 9.5), and `integration/repro_windows_ssh/test.py` passed.
2026-11-23: Updated `integration/repro_windows_ssh/test.py` to check cached OAuth2 credentials via the OS `keyring` (`KEYRING_SERVICE_NAME` / `KEYRING_USERNAME`) instead of the removed `TOKEN_CONFIG_PATH`, and added portable import and prerequisite-skip regression tests in `tests/test_windows_ssh.py`.
2026-11-09: `--identity/-i` now accepts either a `.pub` public key or a private key path: `_resolve_pubkey` reads the `.pub` file directly when present before falling back to `_pubkey_from_identity` (`ssh-keygen -y -f`), and `_ssh_base_args` strips `.pub` for `ssh -i` when the sibling private key exists on disk.
Expand Down
5 changes: 4 additions & 1 deletion src/colab_cli/commands/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,10 @@ def _connect_websocket(url: str, pubkey: str) -> websocket.WebSocket:
agent = COLAB_CLIENT_AGENT_HEADER
header = [f"{_PUBKEY_HEADER}: {pubkey}", f"{agent['key']}: {agent['value']}"]
try:
ws.connect(url, header=header)
# The runtime rejects an upgrade that carries an Origin header with 403,
# treating it as a cross-origin browser request. A CLI is not a browser,
# so the header must not be sent at all.
ws.connect(url, header=header, suppress_origin=True)
return ws
except websocket.WebSocketBadStatusException as e:
status = getattr(e, "status_code", None)
Expand Down
4 changes: 4 additions & 0 deletions tests/test_ssh_wire_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ def _assert_wire_contract(
), f"wrong upgrade target: {req.target!r}"
agent = req.headers_lower.get("x-colab-client-agent")
assert agent == ("X-Colab-Client-Agent", "colab-cli"), f"agent header: {agent!r}"
assert "origin" not in req.headers_lower, (
"the upgrade must not carry an Origin header: the runtime rejects it "
f"with 403. Headers sent: {sorted(req.headers)!r}"
)


# --- the real-wire contract, success path ------------------------------------
Expand Down