Skip to content
Merged
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
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,16 @@
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-${jenkins.baseline}.x</artifactId>
<version>5543.vfd758c7c868d</version>
<version>5804.v80587a_38d937</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<!-- TODO until in BOM -->
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>1480.v2246fd131e83</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketCommit;
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.BitbucketApiUtils;
import com.cloudbees.jenkins.plugins.bitbucket.impl.util.DateUtils;
import com.cloudbees.plugins.credentials.CredentialsMatchers;
import com.cloudbees.plugins.credentials.CredentialsProvider;
import com.cloudbees.plugins.credentials.common.StandardCredentials;
import com.cloudbees.plugins.credentials.domains.URIRequirementBuilder;
Expand Down Expand Up @@ -234,20 +233,16 @@
if (scanCredentialsId == null) {
return null;
} else {
return CredentialsMatchers.firstOrNull(
CredentialsProvider.lookupCredentialsInItem(
var c = CredentialsProvider.findCredentialByIdInItem(
scanCredentialsId,
StandardCredentials.class,
context,
context instanceof Queue.Task task
? task.getDefaultAuthentication2()
: ACL.SYSTEM2,
URIRequirementBuilder.fromUri(serverURL).build()
),
CredentialsMatchers.allOf(
CredentialsMatchers.withId(scanCredentialsId),
AuthenticationTokens.matcher(BitbucketAuthenticator.authenticationContext(serverURL))
)
);
return c != null && AuthenticationTokens.matcher(BitbucketAuthenticator.authenticationContext(serverURL)).matches(c) ? c : null;

Check warning on line 245 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/filesystem/BitbucketSCMFileSystem.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 236-245 are not covered by tests
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,13 @@
: ACL.SYSTEM2;
List<DomainRequirement> domainRequirements = URIRequirementBuilder.fromUri(serverURL).build();

return CredentialsMatchers.firstOrNull(
CredentialsProvider.lookupCredentialsInItem(
return CredentialsProvider.findCredentialByIdInItem(
credentialsId,
type,
item,
authentication,
domainRequirements
),
CredentialsMatchers.withId(credentialsId));
);
}
return null;
}
Expand All @@ -161,13 +160,12 @@
if (StringUtils.isNotBlank(credentialsId)) {
List<DomainRequirement> domainRequirements = URIRequirementBuilder.fromUri(serverURL).build();

return CredentialsMatchers.firstOrNull(
CredentialsProvider.lookupCredentialsInItemGroup(
return CredentialsProvider.findCredentialByIdInItemGroup(
credentialsId,
type,
itemGroup,
null,
domainRequirements),
CredentialsMatchers.withId(credentialsId));
domainRequirements);
}
return null;
}
Expand All @@ -188,13 +186,12 @@
: ACL.SYSTEM2;
List<DomainRequirement> domainRequirements = URIRequirementBuilder.fromUri(serverURL).build();

StandardCertificateCredentials certificateCredentials = CredentialsMatchers.firstOrNull(
CredentialsProvider.lookupCredentialsInItem(
StandardCertificateCredentials certificateCredentials = CredentialsProvider.findCredentialByIdInItem(

Check warning on line 189 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/util/BitbucketCredentialsUtils.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 189 is not covered by tests
credentialsId,
StandardCertificateCredentials.class,
context,
authentication,
domainRequirements),
CredentialsMatchers.withId(credentialsId));
domainRequirements);
if (certificateCredentials != null) {
return FormValidation.warning("A certificate was selected. You will likely need to configure Checkout over SSH.");
}
Expand Down
Loading