MCPcopy Create free account
hub / github.com/evilsocket/cake / test_handshake_auth_wrong_key

Function test_handshake_auth_wrong_key

cake-core/tests/protocol.rs:177–190  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175
176#[tokio::test]
177async fn test_handshake_auth_wrong_key() {
178 let mock = MockWorker::bind().await;
179 let addr = mock.addr();
180 let worker = tokio::spawn(async move { mock.handle_one(Some("correct-key")).await });
181
182 let mut stream = TcpStream::connect(addr).await.unwrap();
183 let result = cake_core::cake::auth::authenticate_as_master(&mut stream, "wrong-key").await;
184 assert!(result.is_err());
185
186 drop(stream);
187 // Worker should also fail
188 let worker_result = worker.await.unwrap();
189 assert!(worker_result.is_err());
190}
191
192// ============================================================================
193// Forward (Echo) Tests

Callers

nothing calls this directly

Calls 3

authenticate_as_masterFunction · 0.85
addrMethod · 0.80
handle_oneMethod · 0.80

Tested by

no test coverage detected