@Test public void configuresServiceAndRegionWhenUsingOperationSigner() throws URISyntaxException { when(mockClient.getServiceName()).thenReturn("MockService"); SignerProviderContext ctx = SignerProviderContext.builder() .withRequest(signerAwareRequest) .build(); Signer signer = defaultSignerProvider.getSigner(ctx); FooSigner fooSigner = (FooSigner) signer; assertThat(fooSigner.getRegionName(), is(equalTo("us-east-1"))); assertThat(fooSigner.getServiceName(), is(equalTo("MockService"))); }
@Override public Signer getSigner(SignerProviderContext context) { Request<?> request = context.getRequest(); if (request == null || shouldUseDefaultSigner(request.getOriginalRequest())) { if (context.isRedirect()) { return awsClient.getSignerByURI(context.getUri()); } return defaultSigner; } SignerTypeAware signerTypeAware = (SignerTypeAware) request.getOriginalRequest(); SignerParams params = new SignerParams(awsClient.getServiceName(), getSigningRegionForRequestURI(request.getEndpoint())); return SignerFactory.createSigner(signerTypeAware.getSignerType(), params); }
DefaultSignerProvider extends SignerProvider { @Override public Signer getSigner(SignerProviderContext context) { Request<?> request = context.getRequest(); if (request == null || shouldUseDefaultSigner(request.getOriginalRequest())) { if (context.isRedirect()) { return awsClient.getSignerByURI(context.getUri()); } return defaultSigner; } SignerTypeAware signerTypeAware = (SignerTypeAware) request.getOriginalRequest(); SignerParams params = new SignerParams(awsClient.getServiceName(), getSigningRegionForRequestURI(request.getEndpoint())); return SignerFactory.createSigner(signerTypeAware.getSignerType(), params); } }
DefaultSignerProvider extends SignerProvider { @Override public Signer getSigner(SignerProviderContext context) { Request<?> request = context.getRequest(); if (request == null || shouldUseDefaultSigner(request.getOriginalRequest())) { if (context.isRedirect()) { return awsClient.getSignerByURI(context.getUri()); } return defaultSigner; } SignerTypeAware signerTypeAware = (SignerTypeAware) request.getOriginalRequest(); SignerParams params = new SignerParams(awsClient.getServiceName(), getSigningRegionForRequestURI(request.getEndpoint())); return SignerFactory.createSigner(signerTypeAware.getSignerType(), params); } DefaultSignerProvider(final AmazonWebServiceClient awsClient,
                                 final Signer defaultSigner); }
DefaultSignerProvider extends SignerProvider { @Override public Signer getSigner(SignerProviderContext context) { Request<?> request = context.getRequest(); if (request == null || shouldUseDefaultSigner(request.getOriginalRequest())) { if (context.isRedirect()) { return awsClient.getSignerByURI(context.getUri()); } return defaultSigner; } SignerTypeAware signerTypeAware = (SignerTypeAware) request.getOriginalRequest(); SignerParams params = new SignerParams(awsClient.getServiceName(), getSigningRegionForRequestURI(request.getEndpoint())); return SignerFactory.createSigner(signerTypeAware.getSignerType(), params); } DefaultSignerProvider(final AmazonWebServiceClient awsClient,
                                 final Signer defaultSigner); @Override Signer getSigner(SignerProviderContext context); }
DefaultSignerProvider extends SignerProvider { @Override public Signer getSigner(SignerProviderContext context) { Request<?> request = context.getRequest(); if (request == null || shouldUseDefaultSigner(request.getOriginalRequest())) { if (context.isRedirect()) { return awsClient.getSignerByURI(context.getUri()); } return defaultSigner; } SignerTypeAware signerTypeAware = (SignerTypeAware) request.getOriginalRequest(); SignerParams params = new SignerParams(awsClient.getServiceName(), getSigningRegionForRequestURI(request.getEndpoint())); return SignerFactory.createSigner(signerTypeAware.getSignerType(), params); } DefaultSignerProvider(final AmazonWebServiceClient awsClient,
                                 final Signer defaultSigner); @Override Signer getSigner(SignerProviderContext context);  }