Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions payjoin-directory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use hyper_util::rt::TokioIo;
use payjoin::directory::{ShortId, ShortIdError, ENCAPSULATED_MESSAGE_BYTES};
use tokio::net::TcpListener;
use tokio::sync::Mutex;
use tracing::{debug, error, trace};
use tracing::{debug, error, trace, warn};

use crate::db::DbPool;
pub mod key_config;
Expand Down Expand Up @@ -287,14 +287,14 @@ impl HandlerError {
HandlerError::OhttpKeyRejection(e) => {
const OHTTP_KEY_REJECTION_RES_JSON: &str = r#"{"type":"https://iana.org/assignments/http-problem-types#ohttp-key", "title": "key identifier unknown"}"#;

error!("Bad request: Key configuration rejected: {}", e);
warn!("Bad request: Key configuration rejected: {}", e);
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be ERROR ? Need to dig a bit further to understand when this error would occur

Copy link
Copy Markdown
Collaborator

@spacebear21 spacebear21 Apr 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would occur if a client is using the wrong ohttp keys, e.g. #615

This shouldn't happen so much since #614 is now deployed.

I think it should WARN

*res.status_mut() = StatusCode::BAD_REQUEST;
res.headers_mut()
.insert(CONTENT_TYPE, HeaderValue::from_static("application/problem+json"));
*res.body_mut() = full(OHTTP_KEY_REJECTION_RES_JSON);
}
HandlerError::BadRequest(e) => {
error!("Bad request: {}", e);
warn!("Bad request: {}", e);
*res.status_mut() = StatusCode::BAD_REQUEST
}
};
Expand Down