pub struct DashboardServer { /* private fields */ }
Expand description
Security dashboard HTTP server
Implementations§
Source§impl DashboardServer
impl DashboardServer
Sourcepub fn new(config: DashboardConfig, monitor: Arc<SecurityMonitor>) -> Self
pub fn new(config: DashboardConfig, monitor: Arc<SecurityMonitor>) -> Self
Create a new dashboard server
Sourcepub fn with_default_config(monitor: Arc<SecurityMonitor>) -> Self
pub fn with_default_config(monitor: Arc<SecurityMonitor>) -> Self
Create with default configuration
Sourcepub async fn start(&self) -> Result<(), DashboardError>
pub async fn start(&self) -> Result<(), DashboardError>
Start the dashboard server
Sourcepub async fn handle_dashboard_request(
&self,
auth_token: Option<&str>,
) -> Result<SecurityDashboard, DashboardError>
pub async fn handle_dashboard_request( &self, auth_token: Option<&str>, ) -> Result<SecurityDashboard, DashboardError>
Handle dashboard data request
Sourcepub async fn handle_events_request(
&self,
request: DashboardRequest,
auth_token: Option<&str>,
) -> Result<EventsResponse, DashboardError>
pub async fn handle_events_request( &self, request: DashboardRequest, auth_token: Option<&str>, ) -> Result<EventsResponse, DashboardError>
Handle events request
Sourcepub async fn handle_metrics_request(
&self,
request: DashboardRequest,
auth_token: Option<&str>,
) -> Result<MetricsResponse, DashboardError>
pub async fn handle_metrics_request( &self, request: DashboardRequest, auth_token: Option<&str>, ) -> Result<MetricsResponse, DashboardError>
Handle metrics request
Sourcepub async fn handle_alerts_request(
&self,
auth_token: Option<&str>,
) -> Result<AlertsResponse, DashboardError>
pub async fn handle_alerts_request( &self, auth_token: Option<&str>, ) -> Result<AlertsResponse, DashboardError>
Handle alerts request
Sourcepub fn generate_dashboard_html(&self) -> String
pub fn generate_dashboard_html(&self) -> String
Generate HTML dashboard page
Sourcepub fn authenticate_bearer_token(
&self,
auth_header: Option<&str>,
) -> Result<(), DashboardError>
pub fn authenticate_bearer_token( &self, auth_header: Option<&str>, ) -> Result<(), DashboardError>
Authenticate request with Bearer token
Sourcepub fn authenticate_api_key(
&self,
api_key: Option<&str>,
) -> Result<(), DashboardError>
pub fn authenticate_api_key( &self, api_key: Option<&str>, ) -> Result<(), DashboardError>
Authenticate request with API key
Sourcepub fn generate_access_token(&self) -> String
pub fn generate_access_token(&self) -> String
Generate a new access token for dashboard access
Auto Trait Implementations§
impl Freeze for DashboardServer
impl !RefUnwindSafe for DashboardServer
impl Send for DashboardServer
impl Sync for DashboardServer
impl Unpin for DashboardServer
impl !UnwindSafe for DashboardServer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more