(client: &reqwest::Client, base_url: &str)
| 129 | } |
| 130 | |
| 131 | async fn create_api_key(client: &reqwest::Client, base_url: &str) -> String { |
| 132 | let resp = client |
| 133 | .post(format!("{}/api/auth/api-keys", base_url)) |
| 134 | .json(&json!({ "name": "integration-key" })) |
| 135 | .send() |
| 136 | .await |
| 137 | .expect("POST /api/auth/api-keys failed"); |
| 138 | |
| 139 | assert_eq!(resp.status(), 200, "API key creation should succeed"); |
| 140 | let body: serde_json::Value = resp.json().await.expect("Failed to parse API key response"); |
| 141 | body["data"]["key"] |
| 142 | .as_str() |
| 143 | .expect("API key missing") |
| 144 | .to_string() |
| 145 | } |
| 146 | |
| 147 | async fn list_audit_entries(client: &reqwest::Client, base_url: &str) -> Vec<serde_json::Value> { |
| 148 | let audit_resp = client |
no test coverage detected