Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete aliyun-java-sdk-sts-internal & Replace AssumeRoleWithServiceId… #537

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions connectors/aliyun/rocketmq-connect-eventbridge/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
<eventbridge-client.version>1.3.6</eventbridge-client.version>
<aliyun-java-sdk-sts.version>3.1.0</aliyun-java-sdk-sts.version>
<aliyun-java-sdk-core.version>4.6.0</aliyun-java-sdk-core.version>
<aliyun-java-sdk-sts-internal.version>3.0.0</aliyun-java-sdk-sts-internal.version>
<gson.version>2.9.0</gson.version>
</properties>

Expand Down Expand Up @@ -208,11 +207,6 @@
<artifactId>aliyun-java-sdk-sts</artifactId>
<version>${aliyun-java-sdk-sts.version}</version>
</dependency>
<dependency>
<groupId>com.aliyun</groupId>
<artifactId>aliyun-java-sdk-sts-internal</artifactId>
<version>${aliyun-java-sdk-sts-internal.version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import com.aliyuncs.IAcsClient;
import com.aliyuncs.http.FormatType;
import com.aliyuncs.profile.DefaultProfile;
import com.aliyuncs.sts.model.v20150401.AssumeRoleWithServiceIdentityRequest;
import com.aliyuncs.sts.model.v20150401.AssumeRoleWithServiceIdentityResponse;
import com.aliyuncs.sts.model.v20150401.AssumeRoleRequest;
import com.aliyuncs.sts.model.v20150401.AssumeRoleResponse;
import io.openmessaging.KeyValue;
import io.openmessaging.connector.api.component.task.sink.SinkTask;
import io.openmessaging.connector.api.component.task.sink.SinkTaskContext;
Expand Down Expand Up @@ -105,13 +105,12 @@ public void start(SinkTaskContext sinkTaskContext) {
DefaultProfile.addEndpoint("", "", "Sts", stsEndpoint);
DefaultProfile profile = DefaultProfile.getProfile("", accessKeyId, accessKeySecret);
IAcsClient client = new DefaultAcsClient(profile);
AssumeRoleWithServiceIdentityRequest request = new AssumeRoleWithServiceIdentityRequest();
AssumeRoleRequest request = new AssumeRoleRequest();
request.setRoleArn(roleArn);
request.setRoleSessionName(roleSessionName);
request.setAssumeRoleFor(roleSessionName);
request.setAcceptFormat(FormatType.JSON);
request.setDurationSeconds(3600L);
final AssumeRoleWithServiceIdentityResponse response = client.getAcsResponse(request);
final AssumeRoleResponse response = client.getAcsResponse(request);
authConfig.accessKeyId = response.getCredentials().getAccessKeyId();
authConfig.accessKeySecret = response.getCredentials().getAccessKeySecret();
authConfig.securityToken = response.getCredentials().getSecurityToken();
Expand Down