pub struct Configuration {
pub admin_socket_addr: SocketAddr,
pub payload_limit_bytes: u32,
pub allowed_app_ids: AllowedAppIds,
pub allowed_fns: HashMap<AppId, AllowedFns>,
pub max_app_connections: u32,
pub zome_call_timeout: Duration,
}Expand description
Main configuration structure for the HTTP Gateway.
Fields§
§admin_socket_addr: SocketAddrWebSocket URL for admin connections and management interfaces
payload_limit_bytes: u32Maximum size in bytes that request payloads can be
allowed_app_ids: AllowedAppIdsControls which applications are permitted to connect to the gateway
allowed_fns: HashMap<AppId, AllowedFns>Maps application IDs to their allowed function configurations
max_app_connections: u32Maximum number of app connections that the gateway will maintain concurrently.
zome_call_timeout: DurationTimeout for zome calls
Implementations§
Source§impl Configuration
impl Configuration
Sourcepub fn try_new(
admin_socket_addr: SocketAddr,
payload_limit_bytes: &str,
allowed_app_ids: &str,
allowed_fns: HashMap<AppId, AllowedFns>,
max_app_connections: &str,
zome_call_timeout: &str,
) -> ConfigParseResult<Self>
pub fn try_new( admin_socket_addr: SocketAddr, payload_limit_bytes: &str, allowed_app_ids: &str, allowed_fns: HashMap<AppId, AllowedFns>, max_app_connections: &str, zome_call_timeout: &str, ) -> ConfigParseResult<Self>
Creates a new Configuration by parsing and validating the provided string inputs.
This constructor ensures that all components of the configuration are properly parsed and validated, including:
- The payload limit bytes can be parsed as a number
- The allowed app IDs are correctly parsed from a comma-separated string
- Every app ID listed has a corresponding entry in the allowed_fns map
- The max app connections can be parsed as a number
- The zome call timeout can be parsed as a number
Source§impl Configuration
impl Configuration
Sourcepub fn is_app_allowed(&self, app_id: &str) -> bool
pub fn is_app_allowed(&self, app_id: &str) -> bool
Check if the app_id is in the allowed list
Sourcepub fn get_allowed_functions(&self, app_id: &str) -> Option<&AllowedFns>
pub fn get_allowed_functions(&self, app_id: &str) -> Option<&AllowedFns>
Get the allowed functions for a given app_id
Trait Implementations§
Source§impl Clone for Configuration
impl Clone for Configuration
Source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
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 moreAuto Trait Implementations§
impl Freeze for Configuration
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnwindSafe for Configuration
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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