Skip to main content

Module rest

Module rest 

Source
Expand description

REST and WebSocket API implementation.

Re-exports§

pub use audit::AuditConfig;
pub use audit::AuditEvent;
pub use audit::AuditLogger;
pub use audit::AuditOutcome;
pub use audit::JsonAuditLogger;
pub use audit::NoopAuditLogger;
pub use rbac::Permission;
pub use rbac::RbacConfig;
pub use rbac::Role;
pub use rbac::RolePermissions;

Modules§

audit
Structured audit logging for the REST API.
rbac
Role-Based Access Control (RBAC) for the REST API.
request_id
Request ID middleware.
request_logging
Structured request logging middleware.
request_validation
Request validation middleware.
security_headers
Security headers middleware.

Structs§

AuthConfig
Authentication configuration.
CorsConfig
CORS configuration for the REST API.
MetricsStream
Marker type for metrics stream.
RateLimitConfig
Rate limiting configuration.
RateLimiter
Shared rate limiter state.
TimeoutConfig
Timeout configuration for the REST API.

Enums§

RateLimitBackend
Unified rate limiting backend that supports both in-memory and Redis implementations.

Functions§

auth_middleware
Authentication middleware that checks for valid API key or JWT.
backend_rate_limit_middleware
Rate limiting middleware that works with any RateLimitBackend.
create_router
Create the REST API router with default CORS settings.
create_router_full
Create the REST API router with full configuration (CORS, auth, rate limiting, and timeout).
create_router_full_with_backend
Create the REST API router with full configuration and a specific rate limiting backend.
create_router_with_auth
Create the REST API router with custom CORS and authentication settings.
create_router_with_cors
Create the REST API router with custom CORS settings.
rate_limit_middleware
Rate limiting middleware.