upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/grasp-audit
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-03 11:38:07 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-03 11:38:07 +0000
commite30dfd5e5abb96cdc89b80f1d085466e55c347e0 (patch)
treec12c1d54d30f0541c9689acbcb3b64d54cc8b996 /grasp-audit
parent2eaff5b79fed364d5eba5eb38e4b7bf76326884d (diff)
remove depricated audit mode label ci / production ~> isolated / shared
Diffstat (limited to 'grasp-audit')
-rw-r--r--grasp-audit/QUICK_START.md16
-rw-r--r--grasp-audit/src/audit.rs12
-rw-r--r--grasp-audit/src/bin/grasp-audit.rs12
3 files changed, 19 insertions, 21 deletions
diff --git a/grasp-audit/QUICK_START.md b/grasp-audit/QUICK_START.md
index d4ee494..cb6d8a7 100644
--- a/grasp-audit/QUICK_START.md
+++ b/grasp-audit/QUICK_START.md
@@ -108,21 +108,21 @@ use grasp_audit::*;
108#[tokio::main] 108#[tokio::main]
109async fn main() -> Result<()> { 109async fn main() -> Result<()> {
110 // Create audit client 110 // Create audit client
111 let config = AuditConfig::ci(); 111 let config = AuditConfig::isolated();
112 let client = AuditClient::new("ws://localhost:7000", config).await?; 112 let client = AuditClient::new("ws://localhost:7000", config).await?;
113 113
114 // Run smoke tests 114 // Run smoke tests
115 let results = specs::Nip01SmokeTests::run_all(&client).await; 115 let results = specs::Nip01SmokeTests::run_all(&client).await;
116 116
117 // Print results 117 // Print results
118 results.print_report(); 118 results.print_report();
119 119
120 // Check if passed 120 // Check if passed
121 if !results.all_passed() { 121 if !results.all_passed() {
122 eprintln!("Some tests failed!"); 122 eprintln!("Some tests failed!");
123 std::process::exit(1); 123 std::process::exit(1);
124 } 124 }
125 125
126 Ok(()) 126 Ok(())
127} 127}
128``` 128```
@@ -134,17 +134,20 @@ async fn main() -> Result<()> {
134**Error:** `linker 'cc' not found` 134**Error:** `linker 'cc' not found`
135 135
136**Solution (NixOS):** 136**Solution (NixOS):**
137
137```bash 138```bash
138nix develop # Use the provided flake.nix 139nix develop # Use the provided flake.nix
139``` 140```
140 141
141**Solution (Other Linux):** 142**Solution (Other Linux):**
143
142```bash 144```bash
143sudo apt-get install build-essential # Debian/Ubuntu 145sudo apt-get install build-essential # Debian/Ubuntu
144sudo yum install gcc # RedHat/CentOS 146sudo yum install gcc # RedHat/CentOS
145``` 147```
146 148
147**Solution (macOS):** 149**Solution (macOS):**
150
148```bash 151```bash
149xcode-select --install 152xcode-select --install
150``` 153```
@@ -154,6 +157,7 @@ xcode-select --install
154**Error:** `Failed to connect to relay` 157**Error:** `Failed to connect to relay`
155 158
156**Solutions:** 159**Solutions:**
160
1571. Make sure a relay is running at the specified URL 1611. Make sure a relay is running at the specified URL
1582. Check firewall settings 1622. Check firewall settings
1593. Try a different relay URL 1633. Try a different relay URL
@@ -164,6 +168,7 @@ xcode-select --install
164**Error:** Tests fail with timeout 168**Error:** Tests fail with timeout
165 169
166**Solutions:** 170**Solutions:**
171
1671. Increase timeout in test code 1721. Increase timeout in test code
1682. Check relay is responding (try with `websocat`) 1732. Check relay is responding (try with `websocat`)
1693. Check network connectivity 1743. Check network connectivity
@@ -216,6 +221,7 @@ xcode-select --install
216## Support 221## Support
217 222
218For issues or questions: 223For issues or questions:
224
2191. Check the documentation in this directory 2251. Check the documentation in this directory
2202. Review the examples 2262. Review the examples
2213. Check the test code for usage patterns 2273. Check the test code for usage patterns
diff --git a/grasp-audit/src/audit.rs b/grasp-audit/src/audit.rs
index 713c948..0a4df42 100644
--- a/grasp-audit/src/audit.rs
+++ b/grasp-audit/src/audit.rs
@@ -68,18 +68,6 @@ impl AuditConfig {
68 } 68 }
69 } 69 }
70 70
71 /// Alias for isolated() - for backwards compatibility
72 #[deprecated(since = "0.2.0", note = "Use isolated() instead")]
73 pub fn ci() -> Self {
74 Self::isolated()
75 }
76
77 /// Alias for shared() - for backwards compatibility
78 #[deprecated(since = "0.2.0", note = "Use shared() instead")]
79 pub fn production() -> Self {
80 Self::shared()
81 }
82
83 /// Create config with custom run ID 71 /// Create config with custom run ID
84 pub fn with_run_id(run_id: String, mode: AuditMode) -> Self { 72 pub fn with_run_id(run_id: String, mode: AuditMode) -> Self {
85 Self { 73 Self {
diff --git a/grasp-audit/src/bin/grasp-audit.rs b/grasp-audit/src/bin/grasp-audit.rs
index 0d88bce..08a92c7 100644
--- a/grasp-audit/src/bin/grasp-audit.rs
+++ b/grasp-audit/src/bin/grasp-audit.rs
@@ -56,14 +56,18 @@ async fn main() -> Result<()> {
56 spec, 56 spec,
57 git_data_dir, 57 git_data_dir,
58 } => { 58 } => {
59 #[allow(deprecated)]
60 let mut config = match mode.as_str() { 59 let mut config = match mode.as_str() {
61 "shared" => AuditConfig::shared(), 60 "shared" => AuditConfig::shared(),
62 "isolated" => AuditConfig::isolated(), 61 "isolated" => AuditConfig::isolated(),
63 // Backwards compatibility aliases 62 // Backwards compatibility aliases
64 "ci" => AuditConfig::ci(), 63 "ci" => AuditConfig::isolated(),
65 "production" => AuditConfig::production(), 64 "production" => AuditConfig::shared(),
66 _ => return Err(anyhow!("Invalid mode: {}. Use 'shared' or 'isolated'", mode)), 65 _ => {
66 return Err(anyhow!(
67 "Invalid mode: {}. Use 'shared' or 'isolated'",
68 mode
69 ))
70 }
67 }; 71 };
68 72
69 // Audit needs to create events to test the relay, so disable read-only mode 73 // Audit needs to create events to test the relay, so disable read-only mode