You've already forked authentication-service
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:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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>,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user