Skip to content

Commit

Permalink
Update src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/imp…
Browse files Browse the repository at this point in the history
…l/BasicSSHUserPrivateKey.java

Co-authored-by: Jesse Glick <jglick@cloudbees.com>
  • Loading branch information
olamy and jglick authored Mar 23, 2024
1 parent 2a8add7 commit e673b18
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,12 @@ public synchronized List<String> getPrivateKeys() {
List<String> privateKeys = new ArrayList<>();
for (String privateKey : privateKeySource.getPrivateKeys()) {
try {
boolean accepted = false;
for (PrivateKeyReader reader : ExtensionList.lookup(PrivateKeyReader.class)) {
if(reader.accept(privateKey)) {

Check warning on line 157 in src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/impl/BasicSSHUserPrivateKey.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 157 is only partially covered, one branch is missing
privateKeys.add(reader.toOpenSSH(privateKey, passphrase));
accepted = true;
continue;

Check warning on line 159 in src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/impl/BasicSSHUserPrivateKey.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 158-159 are not covered by tests
}
}
if (accepted){
continue;
}
privateKeys.add(privateKey.endsWith("\n") ? privateKey : privateKey + "\n");

Check warning on line 162 in src/main/java/com/cloudbees/jenkins/plugins/sshcredentials/impl/BasicSSHUserPrivateKey.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 162 is only partially covered, one branch is missing

} catch (IOException e) {
Expand Down

0 comments on commit e673b18

Please sign in to comment.