Unverified Commit 63ce3f95 authored by John DiSanti's avatar John DiSanti Committed by GitHub
Browse files

Rename orchestrator traits to be verbs (#3065)

This PR makes the orchestrator traits more idiomatic by making them
verbs.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
parent d6a1befb
Loading
Loading
Loading
Loading
+24 −1
Original line number Diff line number Diff line
@@ -327,7 +327,7 @@ author = "Velfi"
[[aws-sdk-rust]]
message = "The future return types on traits `EndpointResolver` and `IdentityResolver` changed to new-types `EndpointFuture` and `IdentityFuture` respectively."
references = ["smithy-rs#3055"]
meta = { "breaking" = true, "tada" = true, "bug" = true }
meta = { "breaking" = true, "tada" = false, "bug" = false }
author = "jdisanti"

[[smithy-rs]]
@@ -355,3 +355,26 @@ message = "Lifetimes have been added to the `EndpointResolver` trait."
references = ["smithy-rs#3061"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" }
author = "jdisanti"

[[aws-sdk-rust]]
message = """Several traits have been renamed from noun form to verb form to be more idiomatic:
- `EndpointResolver` -> `ResolveEndpoint`
- `Interceptor` -> `Intercept`
"""
references = ["smithy-rs#3065"]
meta = { "breaking" = true, "tada" = false, "bug" = false }
author = "jdisanti"

[[smithy-rs]]
message = """Several traits have been renamed from noun form to verb form to be more idiomatic:
- `AuthSchemeOptionResolver` -> `ResolveAuthSchemeOptions`
- `EndpointResolver` -> `ResolveEndpoint`
- `IdentityResolver` -> `ResolveIdentity`
- `Signer` -> `Sign`
- `RequestSerializer` -> `SerializeRequest`
- `ResponseDeserializer` -> `DeserializeResponse`
- `Interceptor` -> `Intercept`
"""
references = ["smithy-rs#3065"]
meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "client" }
author = "jdisanti"
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ use aws_smithy_runtime::client::orchestrator::operation::Operation;
use aws_smithy_runtime::client::retries::strategy::StandardRetryStrategy;
use aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams;
use aws_smithy_runtime_api::client::endpoint::{
    EndpointFuture, EndpointResolver, EndpointResolverParams,
    EndpointFuture, EndpointResolverParams, ResolveEndpoint,
};
use aws_smithy_runtime_api::client::interceptors::context::InterceptorContext;
use aws_smithy_runtime_api::client::orchestrator::{OrchestratorError, SensitiveOutput};
@@ -523,7 +523,7 @@ struct ImdsEndpointResolver {
    mode_override: Option<EndpointMode>,
}

impl EndpointResolver for ImdsEndpointResolver {
impl ResolveEndpoint for ImdsEndpointResolver {
    fn resolve_endpoint<'a>(&'a self, _: &'a EndpointResolverParams) -> EndpointFuture<'a> {
        EndpointFuture::new(async move {
            self.endpoint_source
+5 −5
Original line number Diff line number Diff line
@@ -22,10 +22,10 @@ use aws_smithy_runtime::client::orchestrator::operation::Operation;
use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolver;
use aws_smithy_runtime_api::client::auth::{
    AuthScheme, AuthSchemeEndpointConfig, AuthSchemeId, Signer,
    AuthScheme, AuthSchemeEndpointConfig, AuthSchemeId, Sign,
};
use aws_smithy_runtime_api::client::identity::{
    Identity, IdentityFuture, IdentityResolver, SharedIdentityResolver,
    Identity, IdentityFuture, ResolveIdentity, SharedIdentityResolver,
};
use aws_smithy_runtime_api::client::orchestrator::{HttpRequest, HttpResponse, OrchestratorError};
use aws_smithy_runtime_api::client::runtime_components::{
@@ -191,7 +191,7 @@ fn parse_token_response(response: &HttpResponse, now: SystemTime) -> Result<Toke
    })
}

impl IdentityResolver for TokenResolver {
impl ResolveIdentity for TokenResolver {
    fn resolve_identity<'a>(&'a self, _config_bag: &'a ConfigBag) -> IdentityFuture<'a> {
        IdentityFuture::new(async {
            let preloaded_token = self
@@ -240,7 +240,7 @@ impl AuthScheme for TokenAuthScheme {
        identity_resolvers.identity_resolver(IMDS_TOKEN_AUTH_SCHEME)
    }

    fn signer(&self) -> &dyn Signer {
    fn signer(&self) -> &dyn Sign {
        &self.signer
    }
}
@@ -248,7 +248,7 @@ impl AuthScheme for TokenAuthScheme {
#[derive(Debug)]
struct TokenSigner;

impl Signer for TokenSigner {
impl Sign for TokenSigner {
    fn sign_http_request(
        &self,
        request: &mut HttpRequest,
+2 −2
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@

use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextMut;
use aws_smithy_runtime_api::client::interceptors::Interceptor;
use aws_smithy_runtime_api::client::interceptors::Intercept;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_types::config_bag::ConfigBag;
use http::header::ACCEPT;
@@ -17,7 +17,7 @@ use http::HeaderValue;
#[derive(Debug, Default)]
pub(crate) struct AcceptHeaderInterceptor;

impl Interceptor for AcceptHeaderInterceptor {
impl Intercept for AcceptHeaderInterceptor {
    fn name(&self) -> &'static str {
        "AcceptHeaderInterceptor"
    }
+4 −4
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ use aws_smithy_runtime_api::box_error::BoxError;
use aws_smithy_runtime_api::client::interceptors::context::{
    BeforeSerializationInterceptorContextMut, BeforeTransmitInterceptorContextMut,
};
use aws_smithy_runtime_api::client::interceptors::Interceptor;
use aws_smithy_runtime_api::client::interceptors::Intercept;
use aws_smithy_runtime_api::client::orchestrator::LoadedRequestBody;
use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents;
use aws_smithy_types::config_bag::ConfigBag;
@@ -65,7 +65,7 @@ impl<I> GlacierAccountIdAutofillInterceptor<I> {
    }
}

impl<I: GlacierAccountId + Send + Sync + 'static> Interceptor
impl<I: GlacierAccountId + Send + Sync + 'static> Intercept
    for GlacierAccountIdAutofillInterceptor<I>
{
    fn name(&self) -> &'static str {
@@ -100,7 +100,7 @@ impl GlacierApiVersionInterceptor {
    }
}

impl Interceptor for GlacierApiVersionInterceptor {
impl Intercept for GlacierApiVersionInterceptor {
    fn name(&self) -> &'static str {
        "GlacierApiVersionInterceptor"
    }
@@ -123,7 +123,7 @@ impl Interceptor for GlacierApiVersionInterceptor {
#[derive(Debug, Default)]
pub(crate) struct GlacierTreeHashHeaderInterceptor;

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