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: 4 additions & 4 deletions src/main/java/hudson/plugins/git/UserRemoteConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ public FormValidation doCheckCredentialsId(@AncestorInPath Item project,
return FormValidation.ok();
}
for (ListBoxModel.Option o : CredentialsProvider
.listCredentials(StandardUsernameCredentials.class, project, project instanceof Queue.Task
? Tasks.getAuthenticationOf((Queue.Task) project)
: ACL.SYSTEM,
.listCredentialsInItem(StandardUsernameCredentials.class, project, project instanceof Queue.Task
? Tasks.getAuthenticationOf2((Queue.Task) project)
: ACL.SYSTEM2,
GitURIRequirementsBuilder.fromUri(url).build(),
GitClient.CREDENTIALS_MATCHER)) {
if (Objects.equals(value, o.value)) {
Expand Down Expand Up @@ -259,7 +259,7 @@ public FormValidation doCheckRefspec(@QueryParameter String name,

private static StandardCredentials lookupCredentials(@CheckForNull Item project, String credentialId, String uri) {
return (credentialId == null) ? null : CredentialsMatchers.firstOrNull(
CredentialsProvider.lookupCredentials(StandardCredentials.class, project, ACL.SYSTEM,
CredentialsProvider.lookupCredentialsInItem(StandardCredentials.class, project, ACL.SYSTEM2,
GitURIRequirementsBuilder.fromUri(uri).build()),
CredentialsMatchers.withId(credentialId));
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -1288,8 +1288,8 @@ private StandardUsernameCredentials getCredentials(@CheckForNull Item context) {
}
return CredentialsMatchers
.firstOrNull(
CredentialsProvider.lookupCredentials(StandardUsernameCredentials.class, context,
ACL.SYSTEM, URIRequirementBuilder.fromUri(getRemote()).build()),
CredentialsProvider.lookupCredentialsInItem(StandardUsernameCredentials.class, context,
ACL.SYSTEM2, URIRequirementBuilder.fromUri(getRemote()).build()),
CredentialsMatchers.allOf(CredentialsMatchers.withId(credentialsId),
GitClient.CREDENTIALS_MATCHER));
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/jenkins/plugins/git/GitSCMFileSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,10 @@ public SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, @CheckForNull
String credentialsId = config.getCredentialsId();
if (credentialsId != null) {
StandardCredentials credential = CredentialsMatchers.firstOrNull(
CredentialsProvider.lookupCredentials(
CredentialsProvider.lookupCredentialsInItem(
StandardUsernameCredentials.class,
owner,
ACL.SYSTEM,
ACL.SYSTEM2,
URIRequirementBuilder.fromUri(remote).build()
),
CredentialsMatchers.allOf(
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/jenkins/plugins/git/GitSCMSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,12 @@ public FormValidation doCheckCredentialsId(@AncestorInPath Item context,
return FormValidation.ok();
}

for (ListBoxModel.Option o : CredentialsProvider.listCredentials(
for (ListBoxModel.Option o : CredentialsProvider.listCredentialsInItem(
StandardUsernameCredentials.class,
context,
context instanceof Queue.Task
? Tasks.getAuthenticationOf((Queue.Task) context)
: ACL.SYSTEM,
? Tasks.getAuthenticationOf2((Queue.Task) context)
: ACL.SYSTEM2,
URIRequirementBuilder.fromUri(remote).build(),
GitClient.CREDENTIALS_MATCHER)) {
if (Objects.equals(value, o.value)) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/jenkins/plugins/git/GitSCMTelescope.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ public final SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, SCMRevis
String credentialsId = config.getCredentialsId();
if (credentialsId != null) {
List<StandardUsernameCredentials> urlCredentials = CredentialsProvider
.lookupCredentials(StandardUsernameCredentials.class, owner,
.lookupCredentialsInItem(StandardUsernameCredentials.class, owner,
owner instanceof Queue.Task
? Tasks.getAuthenticationOf((Queue.Task) owner)
: ACL.SYSTEM, URIRequirementBuilder.fromUri(remote).build());
? Tasks.getAuthenticationOf2((Queue.Task) owner)
: ACL.SYSTEM2, URIRequirementBuilder.fromUri(remote).build());
credentials = CredentialsMatchers.firstOrNull(
urlCredentials,
CredentialsMatchers
Expand Down