File tree Expand file tree Collapse file tree
main/java/org/jenkinsci/plugins/github_branch_source
test/java/org/jenkinsci/plugins/github_branch_source Expand file tree Collapse file tree Original file line number Diff line number Diff line change 8888 <dependency >
8989 <groupId >com.github.tomakehurst</groupId >
9090 <artifactId >wiremock-jre8-standalone</artifactId >
91- <version >2.25 .1</version >
91+ <version >2.27 .1</version >
9292 <scope >test</scope >
9393 </dependency >
9494 <dependency >
Original file line number Diff line number Diff line change @@ -67,7 +67,9 @@ private static PrivateKey getPrivateKeyFromString(final String key) throws Gener
6767 );
6868 }
6969
70- String privateKeyContent = key .replaceAll ("\\ n" , "" )
70+ String privateKeyContent = key
71+ .replaceAll ("\\ n" , "" )
72+ .replaceAll ("\\ r" , "" )
7173 .replace ("-----BEGIN PRIVATE KEY-----" , "" )
7274 .replace ("-----END PRIVATE KEY-----" , "" );
7375
Original file line number Diff line number Diff line change @@ -24,8 +24,10 @@ public class JwtHelperTest {
2424
2525 // https://stackoverflow.com/a/22176759/4951015
2626 public static final String PKCS8_PRIVATE_KEY = "-----BEGIN PRIVATE KEY-----\n " +
27- "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD7vHsVwyDV8cj7\n " +
28- "5yR4WWl6rlgf/e5zmeBgtm0PCgnitcSbD5FU33301DPY5a7AtqVBOwEnE14L9XS7\n " +
27+ // Windows line ending
28+ "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD7vHsVwyDV8cj7\r \n " +
29+ // This should also work
30+ "5yR4WWl6rlgf/e5zmeBgtm0PCgnitcSbD5FU33301DPY5a7AtqVBOwEnE14L9XS7\r " +
2931 "ov61U+x1m4aQmqR/dPQaA2ayh2cYPszWNQMp42ArDIfg7DhSrvsRJKHsbPXlPjqe\n " +
3032 "c0udLqhSLVIO9frNLf+dAsLsgYk8O39PKGb33akGG7tWTe0J+akNQjgbS7vOi8sS\n " +
3133 "NLwHIdYfz/Am+6Xmm+J4yVs6+Xt3kOeLdFBkz8H/HGsJq854MbIAK/HuId1MOPS0\n " +
You can’t perform that action at this time.
0 commit comments