Skip to content

Commit

Permalink
Adapt to removal of STS module (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
basil authored Dec 18, 2024
1 parent c08280b commit 3a5c7de
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
20 changes: 17 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,33 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.jenkins.plugins.aws-java-sdk2</groupId>
<artifactId>aws-java-sdk2-core</artifactId>
<version>2.29.34-9.v117ff2a_65538</version>
</dependency>
<!-- TODO until in BOM -->
<dependency>
<groupId>io.jenkins.plugins.aws-java-sdk2</groupId>
<artifactId>aws-java-sdk2-ec2</artifactId>
<version>2.29.34-9.v117ff2a_65538</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>aws-credentials</artifactId>
<version>239.v6681a_0ea_46ef</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.jenkins.plugins.aws-java-sdk2</groupId>
<artifactId>aws-java-sdk2-sts</artifactId>
<artifactId>aws-java-sdk2-core</artifactId>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>aws-credentials</artifactId>
<!-- TODO until in BOM -->
<version>238.v8fb_588a_2b_e67</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
import java.util.Objects;
import java.util.Optional;
import jenkins.model.Jenkins;
import jenkins.util.SetContextClassLoader;
import org.apache.commons.lang.StringUtils;
import org.jenkinsci.Symbol;
import org.kohsuke.accmod.Restricted;
Expand Down Expand Up @@ -183,8 +182,7 @@ private Credentials getSessionCredentials(AwsCredentialsProvider credentialsProv
* in case of error.
*/
private AwsSessionCredentials sessionCredentialsFromInstanceProfile() throws IOException {
try (SetContextClassLoader sccl = new SetContextClassLoader(CredentialsAwsGlobalConfiguration.class);
DefaultCredentialsProvider credentialsProvider = DefaultCredentialsProvider.create()) {
try (DefaultCredentialsProvider credentialsProvider = DefaultCredentialsProvider.create()) {

Check warning on line 185 in src/main/java/io/jenkins/plugins/aws/global_configuration/CredentialsAwsGlobalConfiguration.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 185 is not covered by tests
AwsCredentials awsCredentials = credentialsProvider.resolveCredentials();

// Assume we are using session credentials
Expand Down

0 comments on commit 3a5c7de

Please sign in to comment.