pub struct HttpConfig {
pub port: u16,
pub hostname: String,
pub api_token_id: Option<String>,
pub rate_limit_per_second: Option<u32>,
pub cors_allowed_origins: Option<Vec<String>>,
pub http_workers: Option<usize>,
pub jwks_enabled: bool,
}Fields§
§port: u16The KMS HTTP server port
hostname: StringThe KMS HTTP server hostname
api_token_id: Option<String>An optional API token to use for authentication on the HTTP server.
rate_limit_per_second: Option<u32>Maximum number of requests per second per IP address allowed by the rate limiter.
When set, the server enforces this limit to mitigate DoS and brute-force attacks.
Requests exceeding the limit receive HTTP 429 Too Many Requests.
Leave unset (default) to disable rate limiting.
cors_allowed_origins: Option<Vec<String>>Comma-separated list of origins allowed to make cross-origin requests to the KMIP API.
Required for any Web UI deployment: the browser Fetch API sends an Origin header on
every POST request — even when the page is served by the KMS itself — and actix-cors
rejects it unless the exact origin appears in this list.
The value must match byte-for-byte what the user types in the browser address bar
(scheme + hostname + port). The server bind address (0.0.0.0) and the server IP
are not equivalent to a DNS hostname. The Docker image pre-populates loopback
addresses; add any custom hostname explicitly. Example: http://kms.example.com:9998.
http_workers: Option<usize>Number of actix-web HTTP worker threads.
Defaults to the number of logical CPUs. On I/O-heavy workloads (e.g. PostgreSQL backend)
setting this to 2 * <number of CPU cores> improves throughput by keeping more Tokio
threads busy while others are waiting on network I/O.
Can also be set via the TOKIO_WORKER_THREADS environment variable (Tokio runtime),
but this flag controls only the actix-web application workers.
jwks_enabled: boolEnable the GET /.well-known/jwks.json endpoint.
When set, the server exposes all public keys with the Verify usage mask as a
RFC 7517 JSON Web Key Set. Defaults to false; set to true to enable public key
discovery for JWT verification.
Implementations§
Trait Implementations§
Source§impl Args for HttpConfig
impl Args for HttpConfig
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl Clone for HttpConfig
impl Clone for HttpConfig
Source§fn clone(&self) -> HttpConfig
fn clone(&self) -> HttpConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl ConfigFallback for HttpConfig
impl ConfigFallback for HttpConfig
Source§impl Debug for HttpConfig
impl Debug for HttpConfig
Source§impl Default for HttpConfig
impl Default for HttpConfig
Source§impl<'de> Deserialize<'de> for HttpConfigwhere
HttpConfig: Default,
impl<'de> Deserialize<'de> for HttpConfigwhere
HttpConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for HttpConfig
impl Display for HttpConfig
Source§impl FromArgMatches for HttpConfig
impl FromArgMatches for HttpConfig
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Auto Trait Implementations§
impl Freeze for HttpConfig
impl RefUnwindSafe for HttpConfig
impl Send for HttpConfig
impl Sync for HttpConfig
impl Unpin for HttpConfig
impl UnsafeUnpin for HttpConfig
impl UnwindSafe for HttpConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request