Skip to content

Commit

Permalink
Support pipe and new line in the 'No proxy host'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan770 committed Sep 19, 2024
1 parent 87aba78 commit 0b02a04
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ If you're using a JFrog platform that's situated behind an HTTP/S proxy, you sho
under `Manage Jenkins` > `Manage Plugins` > `Advanced`.

To exclude the JFrog platform from going through a configured proxy, provide your JFrog platform's host details in
the `No Proxy Host` section. This should be a list of comma-separated hosts.
the `No Proxy Host` section.
Notice that the JFrog CLI is typically downloaded from releases.jfrog.io. You may need to add that to your list as well.

## Jenkins Configuration as Code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import io.jenkins.plugins.jfrog.configuration.JenkinsProxyConfiguration;
import org.apache.commons.lang3.StringUtils;


/**
* Configures JFrog CLI environment variables for the job.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,18 @@
* @author nathana
**/
@RunWith(Parameterized.class)
public class CliEnvConfiguratorNoProxyTest {
public class NoProxyExtractorTest {
private final String noProxyList;
private final String expectedResult;

public CliEnvConfiguratorNoProxyTest(String noProxyList, String expectedResult) {
public NoProxyExtractorTest(String noProxyList, String expectedResult) {
this.noProxyList = noProxyList;
this.expectedResult = expectedResult;
}

@Parameterized.Parameters
public static Collection<Object[]> dataProvider() {
return Arrays.asList(
// Positive tests
new Object[]{"artifactory.jfrog.io", "artifactory.jfrog.io"},
new Object[]{"artifactory.jfrog.io \n artifactory1.jfrog.io ", "artifactory.jfrog.io;artifactory1.jfrog.io"},
new Object[]{" artifactory.jfrog.io \n \r artifactory1.jfrog.io;artifactory2.jfrog.io \n artifactory3.jfrog.io | artifactory4.jfrog.io \n artifactory5.jfrog.io ", "artifactory.jfrog.io;artifactory1.jfrog.io;artifactory2.jfrog.io;artifactory3.jfrog.io;artifactory4.jfrog.io;artifactory5.jfrog.io"},
Expand All @@ -41,7 +40,7 @@ public static Collection<Object[]> dataProvider() {
}

@Test
public void testValidateCliVersion() {
public void testNoProxyExtractor() {
assertEquals(expectedResult, noProxyExtractor(noProxyList));
}
}

0 comments on commit 0b02a04

Please sign in to comment.