Unverified Commit 911aa716 authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Add names to interceptors (#2878)

This PR adds a `name` function to the `Interceptor` trait so that
interceptor errors are easier to narrow down.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent 79be3105
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,10 @@ use http::HeaderValue;
pub(crate) struct AcceptHeaderInterceptor;

impl Interceptor for AcceptHeaderInterceptor {
    fn name(&self) -> &'static str {
        "AcceptHeaderInterceptor"
    }

    fn modify_before_signing(
        &self,
        context: &mut BeforeTransmitInterceptorContextMut<'_>,
+12 −0
Original line number Diff line number Diff line
@@ -68,6 +68,10 @@ impl<I> GlacierAccountIdAutofillInterceptor<I> {
impl<I: GlacierAccountId + Send + Sync + 'static> Interceptor
    for GlacierAccountIdAutofillInterceptor<I>
{
    fn name(&self) -> &'static str {
        "GlacierAccountIdAutofillInterceptor"
    }

    fn modify_before_serialization(
        &self,
        context: &mut BeforeSerializationInterceptorContextMut<'_>,
@@ -97,6 +101,10 @@ impl GlacierApiVersionInterceptor {
}

impl Interceptor for GlacierApiVersionInterceptor {
    fn name(&self) -> &'static str {
        "GlacierApiVersionInterceptor"
    }

    fn modify_before_signing(
        &self,
        context: &mut BeforeTransmitInterceptorContextMut<'_>,
@@ -116,6 +124,10 @@ impl Interceptor for GlacierApiVersionInterceptor {
pub(crate) struct GlacierTreeHashHeaderInterceptor;

impl Interceptor for GlacierTreeHashHeaderInterceptor {
    fn name(&self) -> &'static str {
        "GlacierTreeHashHeaderInterceptor"
    }

    fn modify_before_serialization(
        &self,
        _context: &mut BeforeSerializationInterceptorContextMut<'_>,
+4 −0
Original line number Diff line number Diff line
@@ -79,6 +79,10 @@ impl<AP> Interceptor for RequestChecksumInterceptor<AP>
where
    AP: Fn(&Input) -> Result<Option<ChecksumAlgorithm>, BoxError> + Send + Sync,
{
    fn name(&self) -> &'static str {
        "RequestChecksumInterceptor"
    }

    fn read_before_serialization(
        &self,
        context: &BeforeSerializationInterceptorContextRef<'_>,
+4 −0
Original line number Diff line number Diff line
@@ -56,6 +56,10 @@ impl<VE> Interceptor for ResponseChecksumInterceptor<VE>
where
    VE: Fn(&Input) -> bool + Send + Sync,
{
    fn name(&self) -> &'static str {
        "ResponseChecksumInterceptor"
    }

    fn read_before_serialization(
        &self,
        context: &BeforeSerializationInterceptorContextRef<'_>,
+4 −0
Original line number Diff line number Diff line
@@ -47,6 +47,10 @@ impl SigV4PresigningInterceptor {
}

impl Interceptor for SigV4PresigningInterceptor {
    fn name(&self) -> &'static str {
        "SigV4PresigningInterceptor"
    }

    fn modify_before_serialization(
        &self,
        _context: &mut BeforeSerializationInterceptorContextMut<'_>,
Loading