[][src]Trait roughenough::config::ServerConfig

pub trait ServerConfig {
    fn interface(&self) -> &str;
fn port(&self) -> u16;
fn seed(&self) -> Vec<u8>;
fn batch_size(&self) -> u8;
fn status_interval(&self) -> Duration;
fn kms_protection(&self) -> &KmsProtection;
fn health_check_port(&self) -> Option<u16>;
fn client_stats_enabled(&self) -> bool;
fn fault_percentage(&self) -> u8; fn udp_socket_addr(&self) -> Result<SocketAddr, Error> { ... } }

Specifies parameters needed to configure a Roughenough server.

Parameters labeled "Required" must always be provided and have no default value while those labeled "Optional" provide sane default values that can be overridden.

YAML KeyEnvironment VariableNecessityDescription
interfaceROUGHENOUGH_INTERFACERequiredIP address or interface name for listening to client requests
portROUGHENOUGH_PORTRequiredUDP port to listen for requests
seedROUGHENOUGH_SEEDRequiredA 32-byte hexadecimal value used to generate the server's long-term key pair. This is a secret value and must be un-guessable, treat it with care. (If compiled with KMS support, length will vary)
batch_sizeROUGHENOUGH_BATCH_SIZEOptionalThe maximum number of requests to process in one batch. All nonces in a batch are used to build a Merkle tree, the root of which is signed. Default is 64 requests per batch.
status_intervalROUGHENOUGH_STATUS_INTERVALOptionalNumber of seconds between each logged status update. Default is 600 seconds (10 minutes).
health_check_portROUGHENOUGH_HEALTH_CHECK_PORTOptionalIf present, enable an HTTP health check responder on the provided port. Use with caution.
kms_protectionROUGHENOUGH_KMS_PROTECTIONOptionalIf compiled with KMS support, the ID of the KMS key used to protect the long-term identity.
client_statsROUGHENOUGH_CLIENT_STATSOptionalA value of on or yes will enable tracking of per-client request statistics that will be output each time server status is logged. Default is off (disabled).
fault_percentageROUGHENOUGH_FAULT_PERCENTAGEOptionalLikelihood (as a percentage) that the server will intentionally return an invalid client response. An integer range from 0 (disabled, all responses valid) to 50 (50% of responses will be invalid). Default is 0 (disabled).

Implementations of this trait obtain a valid configuration from different back-end sources. See:

Required methods

fn interface(&self) -> &str

[Required] IP address or interface name to listen for client requests

fn port(&self) -> u16

[Required] UDP port to listen for requests

fn seed(&self) -> Vec<u8>

[Required] A 32-byte hexadecimal value used to generate the server's long-term key pair. This is a secret value and must be un-guessable, treat it with care.

fn batch_size(&self) -> u8

[Optional] The maximum number of requests to process in one batch. All nonces in a batch are used to build a Merkle tree, the root of which is signed. Defaults to DEFAULT_BATCH_SIZE

fn status_interval(&self) -> Duration

[Optional] Amount of time between each logged status update. Defaults to DEFAULT_STATUS_INTERVAL

fn kms_protection(&self) -> &KmsProtection

[Optional] Method used to protect the seed for the server's long-term key pair. Defaults to "plaintext" (no encryption, seed is in the clear).

fn health_check_port(&self) -> Option<u16>

[Optional] If present, the TCP port to respond to Google-style HTTP "legacy health check". This is a very simplistic check, it emits a fixed HTTP response to all TCP connections. https://cloud.google.com/load-balancing/docs/health-checks#legacy-health-checks

fn client_stats_enabled(&self) -> bool

[Optional] A value of on or yes will enable tracking of per-client request statistics that will be output each time server status is logged. Default is off (disabled).

fn fault_percentage(&self) -> u8

[Optional] Likelihood (as a percentage) that the server will intentionally return an invalid client response. An integer range from 0 (disabled, all responses valid) to 50 (~50% of responses will be invalid). Default is 0 (disabled).

See the Roughtime spec for background and rationale.

Loading content...

Provided methods

fn udp_socket_addr(&self) -> Result<SocketAddr, Error>

Convenience function to create a SocketAddr from the provided interface and port

Loading content...

Implementors

impl ServerConfig for EnvironmentConfig[src]

impl ServerConfig for FileConfig[src]

impl ServerConfig for MemoryConfig[src]

Loading content...