Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
import software.amazon.awssdk.awscore.defaultsmode.DefaultsMode;
import software.amazon.awssdk.core.client.builder.SdkClientBuilder;
import software.amazon.awssdk.http.auth.spi.scheme.AuthScheme;
import software.amazon.awssdk.identity.spi.AwsCredentialsIdentity;
import software.amazon.awssdk.identity.spi.IdentityProvider;
import software.amazon.awssdk.regions.Region;
Expand Down Expand Up @@ -149,15 +148,4 @@ default BuilderT defaultsMode(DefaultsMode defaultsMode) {
* <p>If the setting is not found in any of the locations above, 'false' will be used.
*/
BuilderT fipsEnabled(Boolean fipsEndpointEnabled);

/**
* Configure this client with an additional auth scheme, or replace one already on the client.
*
* <p>By default, the SDK will only know about default auth schemes that ship with the service. If you want to modify those
* existing auth schemes or add a custom one (you select with a custom auth scheme resolver), you can add that new auth
* scheme with this method.
*/
default BuilderT putAuthScheme(AuthScheme<?> authScheme) {
throw new UnsupportedOperationException();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import static software.amazon.awssdk.awscore.client.config.AwsClientOption.SIGNING_REGION;
import static software.amazon.awssdk.core.client.config.SdkAdvancedClientOption.SIGNER;

import com.google.common.collect.ImmutableSet;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
Expand All @@ -36,7 +35,6 @@
import java.time.Duration;
import java.util.Arrays;
import java.util.Optional;
import java.util.Set;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -221,10 +219,6 @@ public void explicitAsyncHttpClientProvided_ClientIsNotManagedBySdk() {

@Test
public void clientBuilderFieldsHaveBeanEquivalents() throws Exception {
// Mutating properties might not have bean equivalents. This is probably fine, since very few customers require
// bean-equivalent methods and it's not clear what they'd expect them to be named anyway. Ignore these methods for now.
Set<String> NON_BEAN_EQUIVALENT_METHODS = ImmutableSet.of("putAuthScheme", "addPlugin");

AwsClientBuilder<TestClientBuilder, TestClient> builder = testClientBuilder();

BeanInfo beanInfo = Introspector.getBeanInfo(builder.getClass());
Expand All @@ -233,10 +227,6 @@ public void clientBuilderFieldsHaveBeanEquivalents() throws Exception {
Arrays.stream(clientBuilderMethods).filter(m -> !m.isSynthetic()).forEach(builderMethod -> {
String propertyName = builderMethod.getName();

if (NON_BEAN_EQUIVALENT_METHODS.contains(propertyName)) {
return;
}

Optional<PropertyDescriptor> propertyForMethod =
Arrays.stream(beanInfo.getPropertyDescriptors())
.filter(property -> property.getName().equals(propertyName))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.endpoints.EndpointProvider;
import software.amazon.awssdk.http.auth.spi.scheme.AuthScheme;
import software.amazon.awssdk.utils.builder.SdkBuilder;

/**
Expand Down Expand Up @@ -65,6 +66,17 @@ default B overrideConfiguration(Consumer<ClientOverrideConfiguration.Builder> ov
*/
B endpointOverride(URI endpointOverride);

/**
* Configure this client with an additional auth scheme, or replace one already on the client.
*
* <p>By default, the SDK will only know about default auth schemes that ship with the service. If you want to modify those
* existing auth schemes or add a custom one (you select with a custom auth scheme resolver), you can add that new auth
* scheme with this method.
*/
default B putAuthScheme(AuthScheme<?> authScheme) {
throw new UnsupportedOperationException();
}

/**
* Adds a plugin to the client builder. The plugins will be invoked when building the client to allow them to change the
* configuration of the built client.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public void explicitAsyncHttpClientProvided_ClientIsNotManagedBySdk() {
public void clientBuilderFieldsHaveBeanEquivalents() throws Exception {
// Mutating properties might not have bean equivalents. This is probably fine, since very few customers require
// bean-equivalent methods and it's not clear what they'd expect them to be named anyway. Ignore these methods for now.
Set<String> NON_BEAN_EQUIVALENT_METHODS = ImmutableSet.of("addPlugin");
Set<String> NON_BEAN_EQUIVALENT_METHODS = ImmutableSet.of("addPlugin", "putAuthScheme");
SdkClientBuilder<TestClientBuilder, TestClient> builder = testClientBuilder();

BeanInfo beanInfo = Introspector.getBeanInfo(builder.getClass());
Expand Down