()
| 324 | #[tokio::test] |
| 325 | #[cfg(unix)] |
| 326 | async fn vault_auth_error_path() { |
| 327 | let port = 18202u16; |
| 328 | let _srv = spawn_mock_vault(port); |
| 329 | tokio::time::sleep(std::time::Duration::from_millis(50)).await; |
| 330 | |
| 331 | let dir = tempfile::tempdir().unwrap(); |
| 332 | let token_path = dir.path().join("token"); |
| 333 | let blob_path = dir.path().join("blob"); |
| 334 | write_secure(&token_path, b"bad-token"); |
| 335 | write_secure(&blob_path, b"vault:v1:cipher=="); |
| 336 | |
| 337 | let provider = VaultKeyProvider::new( |
| 338 | format!("http://127.0.0.1:{port}"), |
| 339 | token_path, |
| 340 | "badkey".into(), |
| 341 | "transit".into(), |
| 342 | blob_path, |
| 343 | ); |
| 344 | |
| 345 | let err = provider.unwrap_key().await.unwrap_err(); |
| 346 | let detail = format!("{err:?}"); |
| 347 | assert!( |
| 348 | detail.contains("403") || detail.contains("permission"), |
| 349 | "expected auth error, got: {detail}" |
| 350 | ); |
| 351 | } |
| 352 | |
| 353 | #[tokio::test] |
| 354 | #[cfg(unix)] |
nothing calls this directly
no test coverage detected