log client/remote IP address on various routes tracing calls
this uses InsecureClientIp as this is purely for informational and logging purposes Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use axum_client_ip::InsecureClientIp;
|
||||
use ruma::{
|
||||
api::{
|
||||
client::error::ErrorKind,
|
||||
@@ -11,8 +12,9 @@ use crate::{services, Error, Result, Ruma};
|
||||
/// # `POST /_matrix/federation/v1/publicRooms`
|
||||
///
|
||||
/// Lists the public rooms on this server.
|
||||
#[tracing::instrument(skip_all, fields(%client_ip))]
|
||||
pub(crate) async fn get_public_rooms_filtered_route(
|
||||
body: Ruma<get_public_rooms_filtered::v1::Request>,
|
||||
InsecureClientIp(client_ip): InsecureClientIp, body: Ruma<get_public_rooms_filtered::v1::Request>,
|
||||
) -> Result<get_public_rooms_filtered::v1::Response> {
|
||||
if !services()
|
||||
.globals
|
||||
@@ -42,8 +44,9 @@ pub(crate) async fn get_public_rooms_filtered_route(
|
||||
/// # `GET /_matrix/federation/v1/publicRooms`
|
||||
///
|
||||
/// Lists the public rooms on this server.
|
||||
#[tracing::instrument(skip_all, fields(%client_ip))]
|
||||
pub(crate) async fn get_public_rooms_route(
|
||||
body: Ruma<get_public_rooms::v1::Request>,
|
||||
InsecureClientIp(client_ip): InsecureClientIp, body: Ruma<get_public_rooms::v1::Request>,
|
||||
) -> Result<get_public_rooms::v1::Response> {
|
||||
if !services()
|
||||
.globals
|
||||
|
||||
Reference in New Issue
Block a user