Skip to content

Commit 979fd5d

Browse files
authored
Merge pull request #20 from nomisp/bugfix/proxy-configuration
Fixed proxy configuration to be able to use proxy without user and password.
2 parents eb29353 + e7e035e commit 979fd5d

File tree

5 files changed

+24
-18
lines changed

5 files changed

+24
-18
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ plugins {
2424
}
2525

2626
group = 'ch.nomisp'
27-
version = '0.4.0'
27+
version = '0.5.0'
2828

2929
repositories {
3030
// Use Maven Central for resolving dependencies.

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ asciiDocGitPublishPluginVersion=3.0.0
1313
asciidoctorjDiagramVersion=2.2.8
1414
credentialsPluginVersion=3.0
1515
pluginPublishPluginVersion=0.16.0
16-
confluencePublisherPluginVersion=0.3.0
16+
confluencePublisherPluginVersion=0.4.0
1717

1818
# Dependency versions
1919
asciidocConfluencePublisherVersion=0.22.0

src/docs/asciidoc/index/release-notes.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@
88
:sectlinks:
99
:sectnums:
1010

11+
== Release 0.5.0
12+
13+
=== New and Noteworthy/Highlights/What's New
14+
Fixed proxy configuration to be able to use a proxy without username and password.
15+
16+
=== Additional Features and Changes/Minor Features and Changes/Other Features and Changes
17+
18+
=== Changelog
19+
* Fixed reported issue concerning the proxy configuration.
20+
21+
=== Deprecations
22+
23+
=== Known problems
24+
1125
== Release 0.4.0
1226

1327
=== New and Noteworthy/Highlights/What's New

src/docs/asciidoc/index/user-guide.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,10 @@ _The values are defined in the enum: org.sahli.asciidoc.confluence.publisher.cli
113113
|The scheme (http or https) used to connect to a forward proxy (in case a forward proxy is required to access the Confluence instance).
114114

115115
*Untested*
116-
|optional (default empty)
116+
|optional (default http)
117117

118118
|proxyHost
119-
|The host of the forward proxy.
119+
|The host of the forward proxy. Mandatory if a proxy is used.
120120

121121
*Untested*
122122
|optional (default empty)
@@ -125,7 +125,7 @@ _The values are defined in the enum: org.sahli.asciidoc.confluence.publisher.cli
125125
|The port of the forward proxy.
126126

127127
*Untested*
128-
|optional (default empty)
128+
|optional (default 80)
129129

130130
|proxyUsername
131131
|The username of the forward proxy (in case the forward proxy requires basic authentication).

src/main/groovy/ch/nomisp/confluence/publisher/PublishToConfluenceTask.groovy

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@ class PublishToConfluenceTask extends DefaultTask {
114114
logger.info("Publishing to Confluence skipped ('convert only' is enabled)")
115115
} else {
116116
ConfluenceRestClient.ProxyConfiguration proxyConfiguration = null
117-
if (useProxy()) {
118-
proxyConfiguration = new ConfluenceRestClient.ProxyConfiguration(this.proxyScheme.get(),
117+
if (proxyHost.isPresent()) {
118+
proxyConfiguration = new ConfluenceRestClient.ProxyConfiguration(this.proxyScheme.getOrElse('http'),
119119
this.proxyHost.get(),
120-
this.proxyPort.get(),
121-
this.proxyUsername.get(),
122-
this.proxyPassword.get())
120+
this.proxyPort.getOrElse(80),
121+
this.proxyUsername.getOrNull(),
122+
this.proxyPassword.getOrNull())
123123
}
124124

125125
Double maxReqPerSec = maxRequestsPerSecond.getOrElse(10)
@@ -181,14 +181,6 @@ class PublishToConfluenceTask extends DefaultTask {
181181

182182
}
183183

184-
private boolean useProxy() {
185-
return proxyScheme.isPresent() &&
186-
proxyHost.isPresent() &&
187-
proxyPort.isPresent() &&
188-
proxyUsername.isPresent() &&
189-
proxyPassword.isPresent()
190-
}
191-
192184
String getOutputDir() {
193185
outputDir ?: "${project.buildDir}/docs/confluence"
194186
}

0 commit comments

Comments
 (0)