[ 
https://issues.apache.org/jira/browse/BEAM-10335?focusedWorklogId=453509&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-453509
 ]

ASF GitHub Bot logged work on BEAM-10335:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 01/Jul/20 16:31
            Start Date: 01/Jul/20 16:31
    Worklog Time Spent: 10m 
      Work Description: 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]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 453509)
    Time Spent: 0.5h  (was: 20m)

> Add STS Assume role credentials provider to AwsModule
> -----------------------------------------------------
>
>                 Key: BEAM-10335
>                 URL: https://issues.apache.org/jira/browse/BEAM-10335
>             Project: Beam
>          Issue Type: Improvement
>          Components: io-java-aws
>    Affects Versions: 2.22.0
>            Reporter: Julius Almeida
>            Assignee: Julius Almeida
>            Priority: P2
>              Labels: starter
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> In order to perform multi account s3 write, we need to assume role.
> Current implementation of AwsModule has no options to serialize & deserialize 
> credentials provided by STSAssumeRoleSessionCredentialsProvider.
> Need to add support for STSAssumeRoleSessionCredentialsProvider in AwsModule.
> AwsModule.class : 
> [https://github.com/apache/beam/blob/master/sdks/java/io/amazon-web-services/src/main/java/org/apache/beam/sdk/io/aws/options/AwsModule.java]
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to