-
Notifications
You must be signed in to change notification settings - Fork 85
Feat/Support for local plugin proxy #277
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
base: master
Are you sure you want to change the base?
Changes from 7 commits
16e2452
94cd34b
eef318e
bd50cf8
2bce0d1
9ffa565
b10ce61
b06ef6f
ed32801
7af49d5
ae547e4
09bac61
9b4b793
a09c19e
be436e6
fc028d1
7f5db72
2b87fb5
b728aba
4dd5245
29db0dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| package jenkins.plugins.office365connector; | ||
|
|
||
| public class Proxy { | ||
|
|
||
| private String ip; | ||
| private Integer port; | ||
| private String username; | ||
| private String password; | ||
|
|
||
|
|
||
| public Proxy(String ip, Integer port, String username, String password) { | ||
| this.ip = ip; | ||
| this.port = port; | ||
| this.username = username; | ||
| this.password = password; | ||
| } | ||
|
|
||
| public String getIp() { | ||
| return ip; | ||
| } | ||
|
|
||
| public void setIp(String ip) { | ||
| this.ip = ip; | ||
| } | ||
|
|
||
| public int getPort() { | ||
| return port; | ||
| } | ||
|
|
||
| public void setPort(int port) { | ||
| this.port = port; | ||
| } | ||
|
|
||
| public String getUsername() { | ||
| return username; | ||
| } | ||
|
|
||
| public void setUsername(String username) { | ||
| this.username = username; | ||
| } | ||
|
|
||
| public String getPassword() { | ||
| return password; | ||
| } | ||
|
|
||
| public void setPassword(String password) { | ||
| this.password = password; | ||
| } | ||
|
|
||
| public Boolean proxyConfigured() { | ||
| try { | ||
| return (this.ip != null && this.ip != ""); | ||
|
|
||
| } catch (NullPointerException ex) { | ||
rockleez marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| return false; | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -50,6 +50,8 @@ public class Webhook extends AbstractDescribableImpl<Webhook> { | |
|
|
||
| private int timeout; | ||
|
|
||
| private Proxy pluginProxy; | ||
|
|
||
| private List<Macro> macros = Collections.emptyList(); | ||
|
|
||
| private List<FactDefinition> factDefinitions = Collections.emptyList(); | ||
|
|
@@ -62,6 +64,7 @@ public DescriptorImpl getDescriptor() { | |
| @DataBoundConstructor | ||
| public Webhook(String url) { | ||
| this.url = StringUtils.isEmpty(url) ? getDescriptor().getGlobalUrl() : url; | ||
| this.setProxyPluginConfiguration(getDescriptor().getIp(), getDescriptor().getPort(), getDescriptor().getUsername(), getDescriptor().getPassword()); | ||
rockleez marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| public String getUrl() { | ||
|
|
@@ -72,6 +75,14 @@ public String getName() { | |
| return Util.fixEmptyAndTrim(StringUtils.isEmpty(name) ? getDescriptor().getGlobalName() : name); | ||
| } | ||
|
|
||
| public Proxy getPluginProxy() { | ||
| return this.pluginProxy; | ||
| } | ||
|
|
||
| public void setProxyPluginConfiguration(String proxyIp, Integer proxyPort, String proxyUsername, String proxyPassword) { | ||
| this.pluginProxy = new Proxy(proxyIp, proxyPort, proxyUsername, proxyPassword); | ||
| } | ||
|
|
||
| @DataBoundSetter | ||
| public void setName(String name) { | ||
| this.name = Util.fixEmptyAndTrim(name); | ||
|
|
@@ -183,6 +194,12 @@ public static class DescriptorImpl extends Descriptor<Webhook> { | |
| private String globalUrl; | ||
| private String globalName; | ||
|
|
||
| private String ip; | ||
| private String username; | ||
rockleez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| private String password; | ||
|
|
||
| private Integer port; | ||
|
|
||
| public DescriptorImpl() { | ||
| load(); | ||
| } | ||
|
|
@@ -193,6 +210,42 @@ public String getDisplayName() { | |
| return "Webhook"; | ||
| } | ||
|
|
||
| public String getIp() { | ||
| return ip; | ||
| } | ||
|
|
||
| @DataBoundSetter | ||
| public void setIp(String ip) { | ||
|
||
| this.ip = ip; | ||
rockleez marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| public String getUsername() { | ||
| return username; | ||
| } | ||
|
|
||
| @DataBoundSetter | ||
| public void setUsername(String username) { | ||
| this.username = username; | ||
| } | ||
|
|
||
| public String getPassword() { | ||
| return password; | ||
| } | ||
|
|
||
| @DataBoundSetter | ||
| public void setPassword(String password) { | ||
| this.password = password; | ||
| } | ||
|
|
||
| public Integer getPort() { | ||
| return port; | ||
| } | ||
|
|
||
| @DataBoundSetter | ||
| public void setPort(Integer port) { | ||
| this.port = port; | ||
| } | ||
|
|
||
| public int getDefaultTimeout() { | ||
| return Webhook.DEFAULT_TIMEOUT; | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ | |
| This section defines for which build statuses the notification is sent. | ||
| </f:description> | ||
|
|
||
| <f:entry title="Notify Build Start" field="startNotification"> | ||
| <f:entry title="Notify Build Start" field="startNotification" > | ||
|
||
| <f:checkbox/> | ||
| </f:entry> | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,5 +7,25 @@ | |
| <f:entry title="Name" field="globalName"> | ||
| <f:textbox/> | ||
| </f:entry> | ||
| <f:advanced> | ||
| <f:section title="Proxy Config"> | ||
|
||
| <f:description> | ||
| This section defines the Office365Connector proxy settings that will apply to all webhook notifications. This | ||
| proxy configuration will be prioritized over the Jenkins global proxy config | ||
rockleez marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| </f:description> | ||
| <f:entry title="IP" field="ip"> | ||
| <f:textbox/> | ||
| </f:entry> | ||
| <f:entry title="Port" field="port"> | ||
| <f:textbox/> | ||
| </f:entry> | ||
| <f:entry title="Username" field="username"> | ||
| <f:textbox/> | ||
| </f:entry> | ||
| <f:entry title="Password" field="password"> | ||
| <f:password/> | ||
| </f:entry> | ||
| </f:section> | ||
| </f:advanced> | ||
| </f:section> | ||
| </j:jelly> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <div align="help">The IP address of the proxy server</div> | ||
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <div align="help">This field works in conjunction with the ip field to specify the HTTP proxy port.</div> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| <div align="help">This field works in conjunction with the proxy server field to specify the username used to authenticate with the proxy.</div> |
Uh oh!
There was an error while loading. Please reload this page.