refactor(tools): rename rhema-tools-contract to rhema-claw-tools-contract
The crate binds the claw to its client tools, not tools at large, so it carries the claw's name: package, lib and dep names, the mock's binary, and the conformance suite's use paths. Specs and README follow. The tools/contract directory keeps its name, and no reference to the old name remains.
This commit is contained in:
1 parent
9e132fdf71
commit
d067f4632f
11 files changed
+91
-76
No files matched your search
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "rhema-tools-contract"
|
||||
name = "rhema-claw-tools-contract"
|
||||
description = "The wire contract between the rhema claw daemon and its thin client tools: routes, shapes, the agent-token allowlist, and the conformance suite"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
//! The daemon's real router runs the same suite in its test tree —
|
||||
//! same results is the definition of implementing the contract.
|
||||
|
||||
use rhema_tools_contract::{CallRequest, MockClaw, conformance};
|
||||
use rhema_claw_tools_contract::{CallRequest, MockClaw, conformance};
|
||||
|
||||
#[tokio::test]
|
||||
async fn the_suite_passes_against_the_mock_router() {
|
||||
@@ -28,31 +28,40 @@ async fn an_open_mock_fails_the_suite() {
|
||||
|
||||
#[tokio::test]
|
||||
async fn the_agent_allowlist_reads_the_documented_routes() {
|
||||
assert!(rhema_tools_contract::agent_allowed("GET", "/v1/watches"));
|
||||
assert!(rhema_tools_contract::agent_allowed(
|
||||
assert!(rhema_claw_tools_contract::agent_allowed(
|
||||
"GET",
|
||||
"/v1/watches"
|
||||
));
|
||||
assert!(rhema_claw_tools_contract::agent_allowed(
|
||||
"DELETE",
|
||||
"/v1/watches/github/acme/widgets"
|
||||
));
|
||||
assert!(rhema_tools_contract::agent_allowed(
|
||||
assert!(rhema_claw_tools_contract::agent_allowed(
|
||||
"POST",
|
||||
"/v1/notifications"
|
||||
));
|
||||
assert!(rhema_tools_contract::agent_allowed(
|
||||
assert!(rhema_claw_tools_contract::agent_allowed(
|
||||
"DELETE",
|
||||
"/v1/tasks/12"
|
||||
));
|
||||
assert!(!rhema_tools_contract::agent_allowed("POST", "/v1/ingest"));
|
||||
assert!(!rhema_tools_contract::agent_allowed(
|
||||
assert!(!rhema_claw_tools_contract::agent_allowed(
|
||||
"POST",
|
||||
"/v1/ingest"
|
||||
));
|
||||
assert!(!rhema_claw_tools_contract::agent_allowed(
|
||||
"POST",
|
||||
"/v1/consents/c-1"
|
||||
));
|
||||
assert!(!rhema_tools_contract::agent_allowed("GET", "/v1/consents"));
|
||||
assert!(!rhema_tools_contract::agent_allowed(
|
||||
assert!(!rhema_claw_tools_contract::agent_allowed(
|
||||
"GET",
|
||||
"/v1/consents"
|
||||
));
|
||||
assert!(!rhema_claw_tools_contract::agent_allowed(
|
||||
"DELETE",
|
||||
"/v1/phones/p1"
|
||||
));
|
||||
assert!(
|
||||
!rhema_tools_contract::agent_allowed("GET", "/v1/watches/github/acme/widgets"),
|
||||
!rhema_claw_tools_contract::agent_allowed("GET", "/v1/watches/github/acme/widgets"),
|
||||
"only DELETE reaches subpaths of /v1/watches"
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user