diff --git a/crates/buzz-auth/src/nip98_replay.rs b/crates/buzz-auth/src/nip98_replay.rs index 0b91065c98..9910399d2e 100644 --- a/crates/buzz-auth/src/nip98_replay.rs +++ b/crates/buzz-auth/src/nip98_replay.rs @@ -192,7 +192,11 @@ mod tests { #[test] fn default_ttl_meets_gate_floor() { // §5 gate: TTL ≥ 120s. Drift this constant down and the gate breaks. - assert!(DEFAULT_REPLAY_TTL_SECS >= 120); + // Const-drift tripwire: the assertion is intentionally over a constant. + #[allow(clippy::assertions_on_constants)] + { + assert!(DEFAULT_REPLAY_TTL_SECS >= 120); + } } #[test] @@ -200,7 +204,11 @@ mod tests { // Sanity: any caller's clamped TTL must end up in [DEFAULT, MAX]. // If these ever cross, the impl can't satisfy both bounds and the // contract is broken. - assert!(DEFAULT_REPLAY_TTL_SECS < MAX_REPLAY_TTL_SECS); + // Const-drift tripwire: the assertion is intentionally over a constant. + #[allow(clippy::assertions_on_constants)] + { + assert!(DEFAULT_REPLAY_TTL_SECS < MAX_REPLAY_TTL_SECS); + } } #[test] diff --git a/crates/buzz-db/src/archived_identities.rs b/crates/buzz-db/src/archived_identities.rs index 728f8bd0a9..941c0fc735 100644 --- a/crates/buzz-db/src/archived_identities.rs +++ b/crates/buzz-db/src/archived_identities.rs @@ -46,6 +46,7 @@ pub async fn is_archived(pool: &PgPool, community_id: CommunityId, pubkey: &str) /// Returns `true` if the row was inserted, `false` if the identity was already /// archived in that community. Re-archiving is idempotent and does not mutate /// the existing row. +#[allow(clippy::too_many_arguments)] pub async fn archive( pool: &PgPool, community_id: CommunityId, diff --git a/crates/buzz-db/src/channel.rs b/crates/buzz-db/src/channel.rs index 8ffc5866fa..99f202b790 100644 --- a/crates/buzz-db/src/channel.rs +++ b/crates/buzz-db/src/channel.rs @@ -83,6 +83,7 @@ pub struct MemberRecord { } /// Creates a new channel, bootstraps the creator as owner, and returns the record. +#[allow(clippy::too_many_arguments)] pub async fn create_channel( pool: &PgPool, community_id: CommunityId, @@ -1388,6 +1389,7 @@ mod tests { id } + #[allow(clippy::too_many_arguments)] async fn create_test_channel( pool: &PgPool, community_id: Uuid, diff --git a/crates/buzz-db/src/lib.rs b/crates/buzz-db/src/lib.rs index d5325bb5f7..3f636928ad 100644 --- a/crates/buzz-db/src/lib.rs +++ b/crates/buzz-db/src/lib.rs @@ -463,6 +463,7 @@ impl Db { } /// Creates a new channel, bootstraps the creator as owner, and returns the record. + #[allow(clippy::too_many_arguments)] pub async fn create_channel( &self, community_id: CommunityId, @@ -1754,6 +1755,7 @@ impl Db { } /// Archives an identity in `community_id`. Returns `true` if inserted, `false` if already archived. + #[allow(clippy::too_many_arguments)] pub async fn archive( &self, community_id: CommunityId, diff --git a/crates/buzz-pubsub/src/nip98_replay.rs b/crates/buzz-pubsub/src/nip98_replay.rs index 264e935d55..79df78db11 100644 --- a/crates/buzz-pubsub/src/nip98_replay.rs +++ b/crates/buzz-pubsub/src/nip98_replay.rs @@ -44,9 +44,7 @@ impl Nip98ReplayGuard for RedisNip98ReplayGuard { // down to MAX_REPLAY_TTL_SECS (contract REQUIRES clamping) so a buggy // caller cannot send a Redis-incompatible `EX` arg or pin a slot for // implausibly long. - let ttl = ttl_secs - .max(DEFAULT_REPLAY_TTL_SECS) - .min(MAX_REPLAY_TTL_SECS); + let ttl = ttl_secs.clamp(DEFAULT_REPLAY_TTL_SECS, MAX_REPLAY_TTL_SECS); let mut conn = self.pool.get().await.map_err(|e| { // Structured field for ops; the user-facing AuthError stays a diff --git a/crates/buzz-relay/src/handlers/side_effects.rs b/crates/buzz-relay/src/handlers/side_effects.rs index ea5ee57cf6..3152112e1e 100644 --- a/crates/buzz-relay/src/handlers/side_effects.rs +++ b/crates/buzz-relay/src/handlers/side_effects.rs @@ -2718,6 +2718,7 @@ pub async fn publish_nipia_archived( } /// Publish a kind:8003 unarchived-identity delta event (NIP-IA). +#[allow(clippy::too_many_arguments)] pub async fn publish_nipia_unarchived( tenant: &TenantContext, state: &Arc,