add UserInfoClaims, add untrusted_audiences, add tracing

This commit is contained in:
JuliDi 2025-11-24 11:18:54 +01:00
parent 6280ad62cc
commit 094e9e5ff6
No known key found for this signature in database
GPG key ID: E1E90AE563D09D63
9 changed files with 210 additions and 43 deletions

View file

@ -41,6 +41,14 @@ pub enum MiddlewareError {
#[error("claims verification: {0:?}")]
ClaimsVerification(#[from] openidconnect::ClaimsVerificationError),
#[error("user info retrieval: {0:?}")]
UserInfoRetrieval(
#[from]
openidconnect::UserInfoError<
openidconnect::HttpClientError<openidconnect::reqwest::Error>,
>,
),
#[error("url parsing: {0:?}")]
UrlParsing(#[from] openidconnect::url::ParseError),
@ -77,7 +85,7 @@ pub enum MiddlewareError {
#[derive(Debug, Error)]
pub enum HandlerError {
#[error("the redirect handler got accessed without a valid session")]
#[error("redirect handler accessed without valid session, session cookie missing?")]
RedirectedWithoutSession,
#[error("csrf token invalid")]
@ -156,24 +164,21 @@ impl IntoResponse for ExtractorError {
impl IntoResponse for Error {
fn into_response(self) -> axum_core::response::Response {
match self {
_ => (StatusCode::INTERNAL_SERVER_ERROR, "internal server error").into_response(),
}
tracing::error!(error = self.to_string());
(StatusCode::INTERNAL_SERVER_ERROR, "internal server error").into_response()
}
}
impl IntoResponse for MiddlewareError {
fn into_response(self) -> axum_core::response::Response {
match self {
_ => (StatusCode::INTERNAL_SERVER_ERROR, "internal server error").into_response(),
}
tracing::error!(error = self.to_string());
(StatusCode::INTERNAL_SERVER_ERROR, "internal server error").into_response()
}
}
impl IntoResponse for HandlerError {
fn into_response(self) -> axum_core::response::Response {
match self {
_ => (StatusCode::INTERNAL_SERVER_ERROR, "internal server error").into_response(),
}
tracing::error!(error = self.to_string());
(StatusCode::INTERNAL_SERVER_ERROR, "internal server error").into_response()
}
}