1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-11-20 12:02:22 +03:00

Log more errors and setup Sentry integration

This commit is contained in:
Quentin Gliech
2023-01-30 17:28:59 +01:00
parent 694e97e96c
commit 875025467e
37 changed files with 439 additions and 16 deletions

View File

@@ -75,6 +75,12 @@ impl_from_error_for_route!(mas_policy::EvaluationError);
impl_from_error_for_route!(super::callback::IntoCallbackDestinationError);
impl_from_error_for_route!(super::callback::CallbackDestinationError);
#[tracing::instrument(
name = "handlers.oauth2.authorization_complete.get",
fields(grant.id = %grant_id),
skip_all,
err,
)]
pub(crate) async fn get(
rng: BoxRng,
clock: BoxClock,

View File

@@ -128,6 +128,12 @@ fn resolve_response_mode(
}
}
#[tracing::instrument(
name = "handlers.oauth2.authorization.get",
fields(client.id = %params.auth.client_id),
skip_all,
err,
)]
#[allow(clippy::too_many_lines)]
pub(crate) async fn get(
mut rng: BoxRng,

View File

@@ -71,6 +71,12 @@ impl IntoResponse for RouteError {
}
}
#[tracing::instrument(
name = "handlers.oauth2.consent.get",
fields(grant.id = %grant_id),
skip_all,
err,
)]
pub(crate) async fn get(
mut rng: BoxRng,
clock: BoxClock,
@@ -125,6 +131,12 @@ pub(crate) async fn get(
}
}
#[tracing::instrument(
name = "handlers.oauth2.consent.post",
fields(grant.id = %grant_id),
skip_all,
err,
)]
pub(crate) async fn post(
mut rng: BoxRng,
clock: BoxClock,

View File

@@ -26,6 +26,7 @@ use oauth2_types::{
scope,
};
#[tracing::instrument(name = "handlers.oauth2.discovery.get", skip_all)]
#[allow(clippy::too_many_lines)]
pub(crate) async fn get(
State(key_store): State<Keystore>,

View File

@@ -120,6 +120,12 @@ const INACTIVE: IntrospectionResponse = IntrospectionResponse {
const API_SCOPE: ScopeToken = ScopeToken::from_static("urn:matrix:org.matrix.msc2967.client:api:*");
#[tracing::instrument(
name = "handlers.oauth2.introspection.post",
fields(client.id = client_authorization.client_id()),
skip_all,
err,
)]
#[allow(clippy::too_many_lines)]
pub(crate) async fn post(
clock: BoxClock,

View File

@@ -15,6 +15,7 @@
use axum::{extract::State, response::IntoResponse, Json};
use mas_keystore::Keystore;
#[tracing::instrument(name = "handlers.oauth2.keys.get", skip_all)]
pub(crate) async fn get(State(key_store): State<Keystore>) -> impl IntoResponse {
let jwks = key_store.public_jwks();
Json(jwks)

View File

@@ -103,7 +103,7 @@ impl IntoResponse for RouteError {
}
}
#[tracing::instrument(skip_all, err)]
#[tracing::instrument(name = "handlers.oauth2.registration.post", skip_all, err)]
pub(crate) async fn post(
mut rng: BoxRng,
clock: BoxClock,

View File

@@ -155,7 +155,12 @@ impl_from_error_for_route!(mas_jose::claims::ClaimError);
impl_from_error_for_route!(mas_jose::claims::TokenHashError);
impl_from_error_for_route!(mas_jose::jwt::JwtSignatureError);
#[tracing::instrument(skip_all, err)]
#[tracing::instrument(
name = "handlers.oauth2.token.post",
fields(client.id = client_authorization.client_id()),
skip_all,
err,
)]
pub(crate) async fn post(
mut rng: BoxRng,
clock: BoxClock,

View File

@@ -95,6 +95,7 @@ impl IntoResponse for RouteError {
}
}
#[tracing::instrument(name = "handlers.oauth2.userinfo.get", skip_all, err)]
pub async fn get(
mut rng: BoxRng,
clock: BoxClock,

View File

@@ -35,6 +35,7 @@ fn jrd() -> mime::Mime {
"application/jrd+json".parse().unwrap()
}
#[tracing::instrument(name = "handlers.oauth2.webfinger.get", skip_all)]
pub(crate) async fn get(
Query(params): Query<Params>,
State(url_builder): State<UrlBuilder>,