Files
pruefwerk/compliance-dashboard/src/infrastructure/error.rs
T
Sharang ParnerkarandClaude Opus 4.6 daaa588fc3
CI / Format (push) Failing after 37s
CI / Clippy (push) Successful in 3m17s
CI / Security Audit (push) Has been skipped
CI / Tests (push) Has been skipped
CI / Format (pull_request) Failing after 3s
CI / Security Audit (pull_request) Has been cancelled
CI / Tests (pull_request) Has been cancelled
CI / Clippy (pull_request) Has been cancelled
Add Keycloak authentication for dashboard and API endpoints
Dashboard: OAuth2/OIDC login flow with PKCE, session-based auth middleware
protecting all server function endpoints, check-auth server function for
frontend auth state, login page gate in AppShell, user info in sidebar.

Agent API: JWT validation middleware using Keycloak JWKS endpoint,
conditionally enabled when KEYCLOAK_URL and KEYCLOAK_REALM are set.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-07 23:59:52 +01:00

38 lines
847 B
Rust

use dioxus::prelude::*;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum DashboardError {
#[error("Database error: {0}")]
Database(#[from] mongodb::error::Error),
#[error("HTTP error: {0}")]
Http(#[from] reqwest::Error),
#[error("JSON error: {0}")]
Json(#[from] serde_json::Error),
#[error("Configuration error: {0}")]
Config(String),
#[error("{0}")]
Other(String),
}
impl From<DashboardError> for ServerFnError {
fn from(err: DashboardError) -> Self {
ServerFnError::new(err.to_string())
}
}
#[cfg(feature = "server")]
impl axum::response::IntoResponse for DashboardError {
fn into_response(self) -> axum::response::Response {
(
axum::http::StatusCode::INTERNAL_SERVER_ERROR,
self.to_string(),
)
.into_response()
}
}