Skip to content

Commit 756da1a

Browse files
committed
test: retire stale connections scenario tests (command removed in #221)
The `hotdata connections` command was removed in #221 (all commands scoped to the active database), but two scenario tests kept calling it: - `tests/connections_read.rs` — calls the removed `connections list`/`<id>`. It only existed to satisfy scenario-parity's file-existence check and skips in CI (no `HOTDATA_SDK_TEST_CONNECTION_ID`), so it was dead. The scenario has no CLI equivalent; a companion www.hotdata.dev PR opts the CLI out of it. Deleted. - `tests/auth_unknown_workspace.rs` — a security scenario (a fabricated workspace id must be rejected, no cross-workspace leak). It also called `connections list`, so it exited non-zero at *arg-parse* — passing for the wrong reason and never actually exercising the server rejection. Switched to `databases list`, a real workspace-scoped listing that reaches the gateway with the fabricated workspace id, restoring genuine coverage. Depends on hotdata-dev/www.hotdata.dev#290 (opts the CLI out of connections_read) merging first, or scenario-parity will still require the deleted file.
1 parent 2dc678e commit 756da1a

2 files changed

Lines changed: 9 additions & 52 deletions

File tree

‎tests/auth_unknown_workspace.rs‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
//! real api key, then sends the fabricated id as the gateway-enforced
66
//! `X-Workspace-Id`; the server responds 4xx (403/404). We assert the command
77
//! exits non-zero and never prints a successful listing.
8+
//!
9+
//! Uses `databases list` — a workspace-scoped listing that returns a JSON array
10+
//! — so a missing rejection would surface as leaked cross-workspace data. (The
11+
//! scenario's `ops: ["*"]` allows any op; this is a real command that reaches
12+
//! the gateway with the fabricated workspace id, unlike the removed
13+
//! `connections list` this test previously called, which failed at arg-parse.)
814
915
mod common;
1016

@@ -21,13 +27,13 @@ fn auth_unknown_workspace() {
2127
// Real api key (no HOTDATA_WORKSPACE lock) + fabricated workspace via -w.
2228
let output = cli
2329
.cmd_unlocked_workspace()
24-
.args(["connections", "list", "-w", &fake_workspace, "-o", "json"])
30+
.args(["databases", "list", "-w", &fake_workspace, "-o", "json"])
2531
.output()
2632
.expect("failed to spawn hotdata binary");
2733

2834
assert!(
2935
!output.status.success(),
30-
"connections list with fabricated workspace {fake_workspace} must fail \
36+
"databases list with fabricated workspace {fake_workspace} must fail \
3137
(potential cross-workspace leak); stdout:\n{}",
3238
String::from_utf8_lossy(&output.stdout)
3339
);
@@ -39,6 +45,6 @@ fn auth_unknown_workspace() {
3945
.ok()
4046
.and_then(|v| v.as_array().map(|a| !a.is_empty()))
4147
!= Some(true),
42-
"fabricated workspace {fake_workspace} leaked a connection listing:\n{stdout}"
48+
"fabricated workspace {fake_workspace} leaked a database listing:\n{stdout}"
4349
);
4450
}

‎tests/connections_read.rs‎

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)