[
https://issues.apache.org/jira/browse/BEAM-8958?focusedWorklogId=670251&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-670251
]
ASF GitHub Bot logged work on BEAM-8958:
----------------------------------------
Author: ASF GitHub Bot
Created on: 26/Oct/21 17:30
Start Date: 26/Oct/21 17:30
Worklog Time Spent: 10m
Work Description: aromanenko-dev commented on a change in pull request
#15788:
URL: https://github.com/apache/beam/pull/15788#discussion_r736737458
##########
File path:
sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/KinesisIO.java
##########
@@ -53,7 +56,7 @@
* p.apply(KinesisIO.read()
* .withStreamName("streamName")
* .withInitialPositionInStream(InitialPositionInStream.LATEST)
- * .withAWSClientsProvider("AWS_KEY", _"AWS_SECRET", STREAM_REGION)
+ * .withAWSClientsProvider(DefaultCredentialsProvider.create(),
STREAM_REGION)
Review comment:
I'd suggest to keep an example with a key/secret as it was and just to
add another one with a custom AWS credentials provider.
##########
File path:
sdks/java/io/amazon-web-services2/src/main/java/org/apache/beam/sdk/io/aws2/kinesis/KinesisIO.java
##########
@@ -338,8 +341,33 @@ public Read withAWSClientsProvider(String awsAccessKey,
String awsSecretKey, Reg
*/
public Read withAWSClientsProvider(
String awsAccessKey, String awsSecretKey, Region region, String
serviceEndpoint) {
+ AwsCredentialsProvider awsCredentialsProvider =
+
StaticCredentialsProvider.create(AwsBasicCredentials.create(awsAccessKey,
awsSecretKey));
+ return withAWSClientsProvider(awsCredentialsProvider, region,
serviceEndpoint);
+ }
+
+ /**
+ * Specify {@link AwsCredentialsProvider} and region to be used to read
from Kinesis. If you
+ * need more sophisticated credential protocol, then you should look at
{@link
+ * Read#withAWSClientsProvider(AWSClientsProvider)}.
+ */
+ public Read withAWSClientsProvider(
Review comment:
Please, add the unit test for all new public methods.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 670251)
Time Spent: 50m (was: 40m)
> Use default credentials provider with BasicKinesisProvider
> ----------------------------------------------------------
>
> Key: BEAM-8958
> URL: https://issues.apache.org/jira/browse/BEAM-8958
> Project: Beam
> Issue Type: Improvement
> Components: io-java-kinesis
> Reporter: Alexey Romanenko
> Assignee: Moritz Mack
> Priority: P3
> Time Spent: 50m
> Remaining Estimate: 0h
>
> For the moment, only {{AWSStaticCredentialsProvider}} with
> {{BasicAWSCredentials}} is used as default credentials provider for
> KinesisIO. It would be helpful and more secure to provide a way of using
> other credentials providers as well without implementing own
> \{{BasicAWSCredentials}}.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)