mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-26 08:18:18 +00:00
test(rpc): cover tonic auth service binding (#5034)
This commit is contained in:
@@ -1048,6 +1048,17 @@ mod tests {
|
||||
assert_eq!(error.to_string(), "Invalid RPC v2 signature");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tonic_v2_signature_is_bound_to_exact_service() {
|
||||
ensure_test_rpc_secret();
|
||||
let headers = gen_tonic_signature_headers("node-a:9000", "node_service.NodeService", "Ping", None)
|
||||
.expect("tonic auth headers should build");
|
||||
|
||||
let error = verify_tonic_rpc_signature("node-a:9000", "/other.NodeService/Ping", &headers)
|
||||
.expect_err("signature replayed to a different service must fail");
|
||||
assert_eq!(error.to_string(), "Invalid RPC v2 signature");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn tonic_v2_signature_is_bound_to_destination_audience() {
|
||||
ensure_test_rpc_secret();
|
||||
|
||||
Reference in New Issue
Block a user