revert(server): bind grant revocation state (revoked_at) to integrity hash

This commit is contained in:
CleverWild
2026-06-09 18:45:30 +02:00
committed by Skipper
parent 96b4eb1d98
commit 7a64bcd1bf
5 changed files with 26 additions and 0 deletions

View File

@@ -394,6 +394,7 @@ mod tests {
chain: CHAIN_ID,
valid_from: None,
valid_until: None,
revoked_at: None,
max_gas_fee_per_gas: None,
max_priority_fee_per_gas: None,
rate_limit: None,
@@ -596,4 +597,24 @@ mod tests {
assert!(violations.is_empty());
}
}
#[test]
fn shared_settings_hash_changes_when_revoked_at_changes() {
use arbiter_crypto::hashing::Hashable;
use sha2::Digest;
let active = shared_settings();
let revoked = SharedGrantSettings {
revoked_at: Some(Utc::now()),
..shared_settings()
};
let mut active_hash = sha2::Sha256::new();
active.hash(&mut active_hash);
let mut revoked_hash = sha2::Sha256::new();
revoked.hash(&mut revoked_hash);
assert_ne!(active_hash.finalize(), revoked_hash.finalize());
}
}