pub struct ServerConfig {
pub bind: SocketAddr,
pub storage_backend: StorageBackend,
pub sqlite_path: Option<PathBuf>,
pub postgres_url: Option<String>,
pub artifacts_url: Option<String>,
pub api_keys: Vec<ApiKeyConfig>,
pub jwt: Option<JwtConfig>,
pub oidc: Option<OidcConfig>,
pub cors: bool,
pub timeout_seconds: u64,
}Expand description
Server configuration.
Fields§
§bind: SocketAddrBind address (e.g., “0.0.0.0:8080”)
storage_backend: StorageBackendStorage backend type
sqlite_path: Option<PathBuf>SQLite database path (when storage_backend is Sqlite)
postgres_url: Option<String>PostgreSQL connection URL (when storage_backend is Postgres)
artifacts_url: Option<String>Artifact storage URL (e.g., s3://bucket/prefix)
api_keys: Vec<ApiKeyConfig>API keys for authentication
jwt: Option<JwtConfig>Optional JWT validation settings.
oidc: Option<OidcConfig>Optional OIDC configuration.
cors: boolEnable CORS for all origins
timeout_seconds: u64Request timeout in seconds
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn storage_backend(self, backend: StorageBackend) -> Self
pub fn storage_backend(self, backend: StorageBackend) -> Self
Sets the storage backend.
Sourcepub fn sqlite_path(self, path: impl Into<PathBuf>) -> Self
pub fn sqlite_path(self, path: impl Into<PathBuf>) -> Self
Sets the SQLite database path.
Sourcepub fn postgres_url(self, url: impl Into<String>) -> Self
pub fn postgres_url(self, url: impl Into<String>) -> Self
Sets the PostgreSQL connection URL.
Sourcepub fn artifacts_url(self, url: impl Into<String>) -> Self
pub fn artifacts_url(self, url: impl Into<String>) -> Self
Sets the artifacts storage URL.
Sourcepub fn api_key(self, key: impl Into<String>, role: Role) -> Self
pub fn api_key(self, key: impl Into<String>, role: Role) -> Self
Adds an API key with a specific role.
Sourcepub fn scoped_api_key(
self,
key: impl Into<String>,
role: Role,
project: impl Into<String>,
benchmark_regex: Option<String>,
) -> Self
pub fn scoped_api_key( self, key: impl Into<String>, role: Role, project: impl Into<String>, benchmark_regex: Option<String>, ) -> Self
Adds a scoped API key restricted to a project and optional benchmark regex.
Sourcepub fn oidc(self, config: OidcConfig) -> Self
pub fn oidc(self, config: OidcConfig) -> Self
Configures OIDC authentication.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more