Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow defining additional Tomcat connectors
Add a new, optional class parameter `confluence::tomcat_additional_connectors` whose value is a well-formed, complex hash as described by the new type aliases `Confluence::Tomcat_connectors` and `Confluence::Tomcat_attributes`. Each hash key represents a port number, and the key's value is a hash that describes the connector's attributes and their values. Useful for defining additional HTTP ports through which to access Confluence. A typical use case is when Jira and Confluence run behind a reverse proxy and application links between Jira and Confluence must be set up. Then it is often better to allow Jira and Confluence to communicate directly instead of through the reverse proxy, but this requires a Tomcat connector that is configured for direct access instead of reverse proxy access (`proxyName`, `proxyPort`, etc). Described here: https://confluence.atlassian.com/kb/how-to-create-an-unproxied-application-link-719095740.html Contains spec tests, documentation and examples. A very similar PR was submitted to puppet-jira in voxpupuli/puppet-jira#316
- Loading branch information
Showing
8 changed files
with
195 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Confluence::Tomcat_attributes' do | ||
describe 'valid attributes' do | ||
[ | ||
{ 'URIEncoding' => 'UTF-8' }, | ||
{ 'secure' => true }, | ||
{ 'proxyPort' => 8443 }, | ||
{ | ||
'URIEncoding' => 'UTF-8', | ||
'connectionTimeout' => '20000', | ||
'protocol' => 'HTTP/1.1', | ||
'proxyName' => 'foo.example.com', | ||
'proxyPort' => '8123', | ||
'secure' => true, | ||
'scheme' => 'https' | ||
}, | ||
{} | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.to allow_value(value) } | ||
end | ||
end | ||
end | ||
|
||
describe 'invalid attributes' do | ||
context 'with garbage inputs' do | ||
[ | ||
{ %w[foo blah] => 'bar' }, | ||
{ true => 'false' }, | ||
{ 'proxyPort' => %w[8443 1234] }, | ||
{ 'schema' => { 'https' => 'false' } }, | ||
true, | ||
false, | ||
:keyword, | ||
nil, | ||
%w[yes no], | ||
'', | ||
'ネット', | ||
'55555', | ||
'0x123', | ||
'yess', | ||
'nooo' | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.not_to allow_value(value) } | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
require 'spec_helper' | ||
|
||
describe 'Confluence::Tomcat_connectors' do | ||
describe 'valid connector specifications' do | ||
[ | ||
{ | ||
8081 => { | ||
'URIEncoding' => 'UTF-8', | ||
'connectionTimeout' => '20000', | ||
'protocol' => 'HTTP/1.1', | ||
'proxyName' => 'foo.example.com', | ||
'proxyPort' => '80', | ||
'secure' => false, | ||
'scheme' => 'http' | ||
}, | ||
8443 => { | ||
'URIEncoding' => 'UTF-8', | ||
'connectionTimeout' => '20000', | ||
'protocol' => 'HTTP/1.1', | ||
'proxyName' => 'foo.example.com', | ||
'proxyPort' => '443', | ||
'secure' => true, | ||
'scheme' => 'https' | ||
} | ||
} | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.to allow_value(value) } | ||
end | ||
end | ||
end | ||
|
||
describe 'invalid connector specifications' do | ||
context 'with garbage inputs' do | ||
[ | ||
{ | ||
'8081' => { | ||
'URIEncoding' => 'UTF-8', | ||
'connectionTimeout' => '20000', | ||
'protocol' => 'HTTP/1.1', | ||
'proxyName' => 'foo.example.com', | ||
'proxyPort' => '80', | ||
'secure' => false, | ||
'scheme' => 'http' | ||
} | ||
}, | ||
{ | ||
1023 => { | ||
'URIEncoding' => 'UTF-8', | ||
'connectionTimeout' => '20000', | ||
'protocol' => 'HTTP/1.1', | ||
'proxyName' => 'foo.example.com', | ||
'proxyPort' => '80', | ||
'secure' => false, | ||
'scheme' => 'http' | ||
} | ||
}, | ||
{ %w[foo blah] => 'bar' }, | ||
{ true => 'false' }, | ||
{ 'proxyPort' => %w[8443 1234] }, | ||
{ 'schema' => { 'https' => 'false' } }, | ||
true, | ||
false, | ||
:keyword, | ||
nil, | ||
%w[yes no], | ||
'', | ||
'ネット', | ||
'55555', | ||
'0x123', | ||
'yess', | ||
'nooo' | ||
].each do |value| | ||
describe value.inspect do | ||
it { is_expected.not_to allow_value(value) } | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type Confluence::Tomcat_attributes = Hash[String[1], Scalar] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type Confluence::Tomcat_connectors = Hash[Stdlib::Port::Unprivileged, Confluence::Tomcat_attributes] |