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

jep-227 downstream usage #446

Merged
merged 2 commits into from
Nov 2, 2023
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
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>1307.v3757c78f17c3</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/hudson/plugins/sshslaves/SSHConnector.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
if (_context == null || !_context.hasPermission(Computer.CONFIGURE)) {
return FormValidation.ok(); // no need to alarm a user that cannot configure
}
for (ListBoxModel.Option o : CredentialsProvider.listCredentials(StandardUsernameCredentials.class, context, ACL.SYSTEM,
for (ListBoxModel.Option o : CredentialsProvider.listCredentialsInItemGroup(StandardUsernameCredentials.class, context, ACL.SYSTEM2,

Check warning on line 319 in src/main/java/hudson/plugins/sshslaves/SSHConnector.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 319 is only partially covered, one branch is missing
Collections.singletonList(SSHLauncher.SSH_SCHEME),
SSHAuthenticator.matcher(Connection.class))) {
if (StringUtils.equals(value, o.value)) {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/hudson/plugins/sshslaves/SSHLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ public SSHLauncher(@NonNull String host, int port, String credentialsId) {
public static StandardUsernameCredentials lookupSystemCredentials(String credentialsId) {
return CredentialsMatchers.firstOrNull(
CredentialsProvider
.lookupCredentials(StandardUsernameCredentials.class, Jenkins.get(), ACL.SYSTEM,
SSH_SCHEME),
.lookupCredentialsInItemGroup(StandardUsernameCredentials.class, Jenkins.get(), ACL.SYSTEM2,
List.of(SSH_SCHEME)),
CredentialsMatchers.withId(credentialsId)
);
}
Expand Down Expand Up @@ -1276,7 +1276,7 @@ public FormValidation doCheckCredentialsId(@AncestorInPath ItemGroup context,
try {
int portValue = Integer.parseInt(port);
for (ListBoxModel.Option o : CredentialsProvider
.listCredentials(StandardUsernameCredentials.class, context, ACL.SYSTEM,
.listCredentialsInItemGroup(StandardUsernameCredentials.class, context, ACL.SYSTEM2,
Collections.singletonList(
new HostnamePortRequirement(host, portValue)
),
Expand Down
Loading