chore(relay): don't log all AUTH errors on WARN (#7506)

Not all authentication errors are warnings that we need to be alerted
about.
This commit is contained in:
Thomas Eizinger
2024-12-13 16:37:15 +11:00
committed by GitHub
parent 5d5e5ab0b1
commit 73625e4669

View File

@@ -850,7 +850,15 @@ where
.verify(&self.auth_secret, username.name(), SystemTime::now()) // This is impure but we don't need to control this in our tests.
.map_err(|e| {
let (error_response, msg) = make_error_response(Unauthorized, request);
tracing::warn!(target: "relay", "{msg}: MessageIntegrity check failed: {e}");
match e {
auth::Error::UnknownNonce | auth::Error::NonceUsedUp | auth::Error::Expired | auth::Error::InvalidPassword => {
tracing::debug!(target: "relay", "{msg}: MessageIntegrity check failed: {e}");
},
auth::Error::CannotAuthenticate(_) | auth::Error::InvalidUsername => {
tracing::warn!(target: "relay", "{msg}: MessageIntegrity check failed: {e}")
},
}
error_response
})?;