pub struct InterceptorChain { /* private fields */ }Expand description
A deployment’s interceptors, in the order its stack lists extensions. Each one gets the request as the previous one left it.
Implementations§
Source§impl InterceptorChain
impl InterceptorChain
pub fn new(interceptors: Vec<Arc<dyn CallInterceptor>>) -> Self
pub fn is_empty(&self) -> bool
Sourcepub fn for_object_payload(&self) -> Self
pub fn for_object_payload(&self) -> Self
The same interceptors, for a call that sends or returns an object’s bytes (an S3 or Cloud Storage object, a Lambda payload). Those bytes are never offered, whatever their content type, so the call fails before it is sent when an interceptor matches it.
Sourcepub fn intercept(
&self,
cloud: Cloud,
service: &str,
request: &mut Request,
) -> Result<Option<ResponseHook>>
pub fn intercept( &self, cloud: Cloud, service: &str, request: &mut Request, ) -> Result<Option<ResponseHook>>
Runs the interceptors that match request, which Alien built and has not sent, on it.
Returns the hook its response must pass through, or None when no interceptor matched
and the request is left as it was.
Sourcepub fn check_destination(&self, url: &Url, endpoint: &str) -> Result<()>
pub fn check_destination(&self, url: &Url, endpoint: &str) -> Result<()>
Refuses url unless it is on endpoint, the endpoint this client was configured with.
A response names URLs Alien then sends its credential to (an operation to poll, a next
page), and an interceptor can rewrite a response, so a client with interceptors signs only
for its own endpoint.