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 moreAuto Trait Implementations§
impl<S> !RefUnwindSafe for HealthRouter<S>
impl<S> !UnwindSafe for HealthRouter<S>
impl<S> Freeze for HealthRouter<S>where
S: Freeze,
impl<S> Send for HealthRouter<S>where
S: Send,
impl<S> Sync for HealthRouter<S>where
S: Sync,
impl<S> Unpin for HealthRouter<S>where
S: Unpin,
impl<S> UnsafeUnpin for HealthRouter<S>where
S: UnsafeUnpin,
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,
Source§impl<T, B1, B2> HttpService<B1> for T
impl<T, B1, B2> HttpService<B1> for T
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>
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>
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