NIFI-10987: Added default implementation of AWS SDK V2 credentials in AWSCredentialsProviderService

Signed-off-by: Joe Gresock <jgresock@gmail.com>

This closes #6787.
This commit is contained in:
Peter Turcsanyi 2022-12-15 20:57:44 +01:00 committed by Joe Gresock
parent 1e23e5146f
commit ae5d23db47
No known key found for this signature in database
GPG Key ID: 37F5B9B6E258C8B7
1 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,7 @@ import org.apache.nifi.annotation.documentation.CapabilityDescription;
import org.apache.nifi.annotation.documentation.Tags;
import org.apache.nifi.processor.exception.ProcessException;
import org.apache.nifi.processors.aws.credentials.provider.AwsCredentialsProviderService;
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
/**
* AWSCredentialsProviderService interface to support getting AWSCredentialsProvider used for instantiating
@ -40,4 +41,13 @@ public interface AWSCredentialsProviderService extends AwsCredentialsProviderSer
* @see <a href="http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/auth/AWSCredentialsProvider.html">AWSCredentialsProvider</a>
*/
AWSCredentialsProvider getCredentialsProvider() throws ProcessException;
/**
* Default implementation of {@link AwsCredentialsProviderService#getAwsCredentialsProvider()} throwing UnsupportedOperationException.
* @return always throws UnsupportedOperationException
*/
@Override
default AwsCredentialsProvider getAwsCredentialsProvider() {
throw new UnsupportedOperationException("AWS Java SDK v2 credentials are not supported by this service");
}
}