aromanenko-dev commented on a change in pull request #12131:
URL: https://github.com/apache/beam/pull/12131#discussion_r448477728
##########
File path:
sdks/java/io/amazon-web-services/src/test/java/org/apache/beam/sdk/io/aws/options/AwsModuleTest.java
##########
@@ -117,6 +119,17 @@ public void
testClasspathPropertiesFileCredentialsProviderSerializationDeseriali
assertEquals(credentialsFilePath, deserializedCredentialsFilePath);
}
+ @Test
+ public void testSTSCredentialsProviderWrapperSerializationDeserialization()
throws Exception {
+ String roleArn = "arn:aws:iam::000111222333:role/TestRole";
+ String roleSessionName = "roleSessionName";
+ STSAssumeRoleSessionCredentialsProvider credentialsProvider =
+ AssumeRoleSessionCredentialsProvider.getInstance(roleArn,
roleSessionName)
+ .getSessionCredentialsProvider();
+
+ assertNotNull(credentialsProvider);
Review comment:
Please, add `Serialization/Deserialization` asserts as we do for other
provider tests.
##########
File path: sdks/java/io/amazon-web-services/build.gradle
##########
@@ -18,13 +18,21 @@ import groovy.json.JsonOutput
* limitations under the License.
*/
-plugins { id 'org.apache.beam.module' }
-applyJavaNature(automaticModuleName: 'org.apache.beam.sdk.io.aws')
+plugins {
+ id 'com.github.johnrengelman.shadow'
Review comment:
Why do we need this plugin? I don't think we have to distribute shadow
jar.
##########
File path: sdks/java/io/amazon-web-services/build.gradle
##########
@@ -18,13 +18,21 @@ import groovy.json.JsonOutput
* limitations under the License.
*/
-plugins { id 'org.apache.beam.module' }
-applyJavaNature(automaticModuleName: 'org.apache.beam.sdk.io.aws')
+plugins {
+ id 'com.github.johnrengelman.shadow'
+ id 'org.apache.beam.module'
+}
+applyJavaNature(
+ automaticModuleName: 'org.apache.beam.sdk.io.aws'
+)
description = "Apache Beam :: SDKs :: Java :: IO :: Amazon Web Services"
ext.summary = "IO library to read and write Amazon Web Services services from
Beam."
dependencies {
+ shadow localGroovy()
Review comment:
I'm not sure we need to `shadow` here.
##########
File path:
sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/options/AwsModule.java
##########
@@ -132,6 +135,10 @@ public AWSCredentialsProvider deserializeWithType(
return new ProfileCredentialsProvider();
} else if
(typeName.equals(EC2ContainerCredentialsProviderWrapper.class.getSimpleName()))
{
return new EC2ContainerCredentialsProviderWrapper();
+ } else if
(typeName.equals(STSAssumeRoleSessionCredentialsProvider.class.getSimpleName()))
{
+ return AssumeRoleSessionCredentialsProvider.getInstance(
Review comment:
Can we just return `new
STSAssumeRoleSessionCredentialsProvider.Builder(asMap.get(ROLE_ARN),
asMap.get(ROLE_SESSION_NAME)).build()` here? Why do we need to create
`AssumeRoleSessionCredentialsProvider` class?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]