pub struct HealthRouter<S> {
pub inner: S,
pub ready_check: Option<ReadyCheck>,
pub metrics_handle: Option<PrometheusHandle>,
pub cors_manager: Option<Arc<CorsManager>>,
pub sigv4a_gate: Option<Arc<SigV4aGate>>,
pub region: String,
}Expand description
inner service と health/ready/metrics + CORS preflight handler + SigV4a verify gate を合成する hyper Service。
Fields§
§inner: S§ready_check: Option<ReadyCheck>§metrics_handle: Option<PrometheusHandle>§cors_manager: Option<Arc<CorsManager>>v0.7 #44: optional CORS bucket-config manager. When attached,
OPTIONS requests carrying Origin + Access-Control-Request-Method
are intercepted before reaching the s3s service and answered
directly with Access-Control-Allow-* headers (or 403 if no rule
matches). When None, OPTIONS falls through to the inner service
(s3s typically returns 405 since no S3 handler maps to OPTIONS).
sigv4a_gate: Option<Arc<SigV4aGate>>v0.7 #47: optional SigV4a verify gate. When attached, requests
whose Authorization header begins with AWS4-ECDSA-P256-SHA256
(or that carry X-Amz-Region-Set) are verified at the HTTP
layer using the configured ECDSA-P-256 credential store; on
failure the listener returns 403 directly. When None, the
gate is a no-op so plain SigV4 deployments are unaffected.
region: Stringv0.7 #47: region name used when checking
X-Amz-Region-Set membership during SigV4a verification. The
listener is single-region in this milestone — operators that
front S4 with a Multi-Region Access Point set this to the
canonical “this listener’s region” string. Defaults to
"us-east-1" (the AWS-default region when none is configured).
Implementations§
Source§impl<S> HealthRouter<S>
impl<S> HealthRouter<S>
pub fn new(inner: S, ready_check: Option<ReadyCheck>) -> Self
pub fn with_metrics(self, handle: PrometheusHandle) -> Self
Sourcepub fn with_cors_manager(self, mgr: Arc<CorsManager>) -> Self
pub fn with_cors_manager(self, mgr: Arc<CorsManager>) -> Self
v0.7 #44: attach an Arc<CorsManager> so OPTIONS preflight
requests are handled at the HTTP layer instead of falling through
to s3s.
Sourcepub fn with_sigv4a_gate(self, gate: Arc<SigV4aGate>) -> Self
pub fn with_sigv4a_gate(self, gate: Arc<SigV4aGate>) -> Self
v0.7 #47: attach an Arc<SigV4aGate> so AWS4-ECDSA-P256-SHA256
requests are verified at the HTTP layer instead of being
rejected by s3s’ SigV4 verifier as “unknown algorithm”.
Sourcepub fn with_region(self, region: impl Into<String>) -> Self
pub fn with_region(self, region: impl Into<String>) -> Self
v0.7 #47: override the listener’s “served region” string used
to check X-Amz-Region-Set membership during SigV4a
verification. Defaults to "us-east-1".
Trait Implementations§
Source§impl<S: Clone> Clone for HealthRouter<S>
impl<S: Clone> Clone for HealthRouter<S>
Source§fn clone(&self) -> HealthRouter<S>
fn clone(&self) -> HealthRouter<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more