Skip to content

Commit

Permalink
Merge pull request #280 from Vlatombe/jep-227
Browse files Browse the repository at this point in the history
jep-227 downstream usage
  • Loading branch information
jglick committed Nov 1, 2023
2 parents 5eb8611 + 058e749 commit f929416
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>1307.v3757c78f17c3</version>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item owner) {
// when configuring the job, you only want those credentials that are available to ACL.SYSTEM selectable
// as we cannot select from a user's credentials unless they are the only user submitting the build
// (which we cannot assume) thus ACL.SYSTEM is correct here.
return new Model().withAll(CredentialsProvider.lookupCredentials(type(), owner, ACL.SYSTEM, Collections.emptyList()));
return new Model().withAll(CredentialsProvider.lookupCredentialsInItem(type(), owner, ACL.SYSTEM2, Collections.emptyList()));
}

private final class Model extends AbstractIdCredentialsListBoxModel<Model,C> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public FormValidation doCheckCredentialsId(StaplerRequest req, @AncestorInPath I
return FormValidation.ok();
}
}
for (FileCredentials c : CredentialsProvider.lookupCredentials(FileCredentials.class, owner, null, Collections.emptyList())) {
for (FileCredentials c : CredentialsProvider.lookupCredentialsInItem(FileCredentials.class, owner, null, Collections.emptyList())) {

Check warning on line 95 in src/main/java/org/jenkinsci/plugins/credentialsbinding/impl/ZipFileBinding.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 95 is not covered by tests
if (c.getId().equals(value)) {
InputStream is = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ public CredentialsScope getScope() {
assertTrue(key.exists());
assertEquals(keyContent, key.readToString().trim());

((DummyPrivateKey) CredentialsProvider.lookupCredentials(SSHUserPrivateKey.class, story.j.jenkins, ACL.SYSTEM, Collections.emptyList()).get(0)).usernameSecret = false;
((DummyPrivateKey) CredentialsProvider.lookupCredentialsInItemGroup(SSHUserPrivateKey.class, story.j.jenkins, ACL.SYSTEM2, Collections.emptyList()).get(0)).usernameSecret = false;
SemaphoreStep.success("basics/2", null);
b = story.j.buildAndAssertSuccess(p);
story.j.assertLogContains(username, b);
Expand Down

0 comments on commit f929416

Please sign in to comment.