Skip to main content

coven_storage/providers/
s3_publication.rs

1//! Check publication authority at the SDK's final transmit boundary.
2use crate::PublicationRequest;
3use aws_sdk_s3::config::{
4    interceptors::BeforeTransmitInterceptorContextRef, ConfigBag, Intercept, RuntimeComponents,
5};
6use aws_smithy_runtime_api::box_error::BoxError;
7impl Intercept for PublicationRequest {
8    fn name(&self) -> &'static str {
9        "PublicationRequest"
10    }
11    fn read_before_transmit(
12        &self,
13        _: &BeforeTransmitInterceptorContextRef<'_>,
14        _: &RuntimeComponents,
15        _: &mut ConfigBag,
16    ) -> Result<(), BoxError> {
17        self.check().map_err(|error| Box::new(error) as BoxError)
18    }
19}
20
21#[cfg(test)]
22#[path = "s3_publication_tests.rs"]
23mod tests;