httpd_configmap_generator 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -1
- data/Gemfile +4 -0
- data/README-active-directory.md +11 -15
- data/README-ipa.md +7 -12
- data/README-saml.md +5 -10
- data/README.md +16 -20
- data/bin/httpd_configmap_generator +35 -49
- data/lib/httpd_configmap_generator/ipa.rb +1 -1
- data/lib/httpd_configmap_generator/saml.rb +1 -1
- data/lib/httpd_configmap_generator/version.rb +1 -1
- metadata +2 -3
- data/lib/httpd_configmap_generator/options.rb +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97e1e062ab6b1f55d36ffe1de318f82892c78d8e
|
4
|
+
data.tar.gz: 7a88bb96641736bb254238122b722547b61c5ec2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2476f19b3e2ec40ce2a14cee8946850db609d2dbd5e215129fed1981d807cf34985bf13bc37c31277c0214ce3f97b10761ec4d13b17fb6ac757909acf9777d8
|
7
|
+
data.tar.gz: 2b34b65675ab369a0821723e08259d06efa1619b168a3e80d019f696eb091dd8301e910454d14afe06611b6202afbdbfd884fe91360ffdbf128c0f584ed8dc05
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -2,3 +2,7 @@ source "https://rubygems.org"
|
|
2
2
|
|
3
3
|
# Leverage the httpd_configmap_generator.gemspec
|
4
4
|
gemspec
|
5
|
+
|
6
|
+
# Load other additional Gemfiles
|
7
|
+
# Developers can create a file ending in .rb under bundler.d/ to specify additional development dependencies
|
8
|
+
Dir.glob(File.join(__dir__, 'bundler.d/*.rb')).each { |f| eval_gemfile(File.expand_path(f, __dir__)) }
|
data/README-active-directory.md
CHANGED
@@ -8,21 +8,17 @@ by joining an Active Directory domain.
|
|
8
8
|
|
9
9
|
```
|
10
10
|
$ httpd_configmap_generator active-directory --help
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
-
|
17
|
-
-
|
18
|
-
-
|
19
|
-
-
|
20
|
-
-
|
21
|
-
-
|
22
|
-
-f, --force Force configuration if configured already
|
23
|
-
-d, --debug Enable debugging
|
24
|
-
-r, --ad-realm=<s> Active Directory Realm (default: )
|
25
|
-
-e, --help Show this message
|
11
|
+
Options:
|
12
|
+
-h, --host=<s> Application Domain
|
13
|
+
-o, --output=<s> Configuration map file to create
|
14
|
+
-a, --ad-domain=<s> Active Directory Domain
|
15
|
+
-u, --ad-user=<s> Active Directory User
|
16
|
+
-p, --ad-password=<s> Active Directory Password
|
17
|
+
-f, --force Force configuration if configured already
|
18
|
+
-d, --debug Enable debugging
|
19
|
+
-r, --ad-realm=<s> Active Directory Realm
|
20
|
+
-s, --ad-server=<s> Active Directory Server
|
21
|
+
-e, --help Show this message
|
26
22
|
```
|
27
23
|
|
28
24
|
### Example:
|
data/README-ipa.md
CHANGED
@@ -8,21 +8,16 @@ for an IPA server.
|
|
8
8
|
|
9
9
|
```
|
10
10
|
$ httpd_configmap_generator ipa --help
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
-V, --version Version of the httpd_configmap_generator command
|
17
|
-
-h, --host=<s> Application Domain (default: )
|
18
|
-
-o, --output=<s> Configuration map file to create (default: )
|
19
|
-
-i, --ipa-server=<s> IPA Server Fqdn (default: )
|
20
|
-
-p, --ipa-password=<s> IPA Server Password (default: )
|
11
|
+
Options:
|
12
|
+
-h, --host=<s> Application Domain
|
13
|
+
-o, --output=<s> Configuration map file to create
|
14
|
+
-i, --ipa-server=<s> IPA Server FQDN
|
15
|
+
-p, --ipa-password=<s> IPA Server Password
|
21
16
|
-f, --force Force configuration if configured already
|
22
17
|
-d, --debug Enable debugging
|
23
18
|
-a, --ipa-principal=<s> IPA Server Principal (default: admin)
|
24
|
-
-m, --ipa-domain=<s> Domain of IPA Server
|
25
|
-
-r, --ipa-realm=<s> Realm of IPA Server
|
19
|
+
-m, --ipa-domain=<s> Domain of IPA Server
|
20
|
+
-r, --ipa-realm=<s> Realm of IPA Server
|
26
21
|
-e, --help Show this message
|
27
22
|
```
|
28
23
|
|
data/README-saml.md
CHANGED
@@ -6,19 +6,14 @@ This documents how to run the httpd\_configmap\_generator tool to configure the
|
|
6
6
|
|
7
7
|
```
|
8
8
|
$ httpd_configmap_generator saml --help
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
httpd_configmap_generator options are:
|
14
|
-
-V, --version Version of the httpd_configmap_generator command
|
15
|
-
-h, --host=<s> Application Domain (default: )
|
16
|
-
-o, --output=<s> Configuration map file to create (default: )
|
9
|
+
Options:
|
10
|
+
-h, --host=<s> Application Domain
|
11
|
+
-o, --output=<s> Configuration map file to create
|
17
12
|
-f, --force Force configuration if configured already
|
18
13
|
-d, --debug Enable debugging
|
19
14
|
-k, --keycloak-add-metadata Download and add the Keycloak metadata file
|
20
|
-
-e, --keycloak-server=<s> Keycloak Server
|
21
|
-
-y, --keycloak-realm=<s> Keycloak Realm for this client
|
15
|
+
-e, --keycloak-server=<s> Keycloak Server FQDN or IP
|
16
|
+
-y, --keycloak-realm=<s> Keycloak Realm for this client
|
22
17
|
-l, --help Show this message
|
23
18
|
```
|
24
19
|
|
data/README.md
CHANGED
@@ -23,10 +23,16 @@ gem install httpd_configmap_generator
|
|
23
23
|
Generating an auth-config map can be done by running the httpd\_configmap\_generator tool
|
24
24
|
|
25
25
|
```
|
26
|
-
$ httpd_configmap_generator
|
26
|
+
$ httpd_configmap_generator --help
|
27
|
+
httpd_configmap_generator 0.1.1 - External Authentication Configuration script
|
27
28
|
|
28
29
|
Usage: httpd_configmap_generator auth_type | update | export [--help | options]
|
29
|
-
|
30
|
+
|
31
|
+
supported auth_type: active-directory, ipa, saml
|
32
|
+
|
33
|
+
httpd_configmap_generator options are:
|
34
|
+
-V, --version Version of the httpd_configmap_generator command
|
35
|
+
-h, --help Show this message
|
30
36
|
```
|
31
37
|
|
32
38
|
Showing the usage for each authentication type or sub-command as follows:
|
@@ -53,17 +59,12 @@ map as per the following usage:
|
|
53
59
|
|
54
60
|
```
|
55
61
|
$ httpd_configmap_generator update --help
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
httpd_configmap_generator options are:
|
61
|
-
-V, --version Version of the httpd_configmap_generator command
|
62
|
-
-i, --input=<s> Input config map file (default: )
|
63
|
-
-o, --output=<s> Output config map file (default: )
|
62
|
+
Options:
|
63
|
+
-i, --input=<s> Input config map file
|
64
|
+
-o, --output=<s> Output config map file
|
64
65
|
-f, --force Force configuration if configured already
|
65
66
|
-d, --debug Enable debugging
|
66
|
-
-a, --add-file=<s> Add file to config map
|
67
|
+
-a, --add-file=<s> Add file to config map
|
67
68
|
-h, --help Show this message
|
68
69
|
```
|
69
70
|
|
@@ -143,15 +144,10 @@ map as per the following usage:
|
|
143
144
|
|
144
145
|
```
|
145
146
|
$ httpd_configmap_generator export --help
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
httpd_configmap_generator options are:
|
151
|
-
-V, --version Version of the httpd_configmap_generator command
|
152
|
-
-i, --input=<s> Input config map file (default: )
|
153
|
-
-l, --file=<s> Config map file to export (default: )
|
154
|
-
-o, --output=<s> The output file being exported (default: )
|
147
|
+
Options:
|
148
|
+
-i, --input=<s> Input config map file
|
149
|
+
-l, --file=<s> Config map file to export
|
150
|
+
-o, --output=<s> The output file being exported
|
155
151
|
-f, --force Force configuration if configured already
|
156
152
|
-d, --debug Enable debugging
|
157
153
|
-h, --help Show this message
|
@@ -7,7 +7,7 @@
|
|
7
7
|
# -o filename: for the generated auth-config map.
|
8
8
|
#
|
9
9
|
|
10
|
-
require "bundler/setup"
|
10
|
+
Dir.chdir(__dir__) { require "bundler/setup" }
|
11
11
|
require "trollop"
|
12
12
|
require "httpd_configmap_generator"
|
13
13
|
|
@@ -20,62 +20,63 @@ end
|
|
20
20
|
|
21
21
|
module HttpdConfigmapGenerator
|
22
22
|
class Cli
|
23
|
-
|
24
|
-
|
23
|
+
SUB_COMMANDS = [HttpdConfigmapGenerator.supported_auth_types] | %w(update export)
|
24
|
+
|
25
|
+
def run
|
26
|
+
Trollop.options do
|
25
27
|
version("#{CMD} #{HttpdConfigmapGenerator::VERSION} - External Authentication Configuration script")
|
26
28
|
banner <<-EOS
|
27
29
|
#{version}
|
28
30
|
|
29
31
|
Usage: #{CMD} auth_type | update | export [--help | options]
|
30
32
|
|
33
|
+
supported auth_type: #{HttpdConfigmapGenerator.supported_auth_types.join(', ')}
|
34
|
+
|
31
35
|
#{CMD} options are:
|
32
36
|
EOS
|
33
37
|
opt :version, "Version of the #{CMD} command",
|
34
38
|
:default => false, :short => "-V"
|
35
|
-
|
36
|
-
opt key, key_options[:description], HttpdConfigmapGenerator::Cli.options_for(key_options, true)
|
37
|
-
end
|
38
|
-
auth_config.optional_options.each do |key, key_options|
|
39
|
-
opt key, key_options[:description], HttpdConfigmapGenerator::Cli.options_for(key_options)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
opts
|
43
|
-
end
|
44
|
-
|
45
|
-
def run_configure(auth_type)
|
46
|
-
begin
|
47
|
-
auth_config = HttpdConfigmapGenerator.new_config(auth_type)
|
48
|
-
rescue => err
|
49
|
-
error_msg(err.to_s)
|
39
|
+
stop_on(SUB_COMMANDS)
|
50
40
|
end
|
51
41
|
|
52
|
-
|
53
|
-
|
42
|
+
auth_type = ARGV.shift
|
43
|
+
Trollop.die "Must specify an authentication type" if auth_type.nil?
|
54
44
|
|
55
|
-
def run_update
|
56
45
|
begin
|
57
|
-
auth_config =
|
46
|
+
auth_config =
|
47
|
+
case auth_type
|
48
|
+
when "update" then HttpdConfigmapGenerator::Update.new
|
49
|
+
when "export" then HttpdConfigmapGenerator::Export.new
|
50
|
+
else HttpdConfigmapGenerator.new_config(auth_type)
|
51
|
+
end
|
58
52
|
rescue => err
|
59
53
|
error_msg(err.to_s)
|
60
54
|
end
|
61
55
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
error_msg(err.to_s)
|
56
|
+
params = Trollop.options do
|
57
|
+
auth_config.required_options.each do |key, key_options|
|
58
|
+
opt key, key_options[:description], HttpdConfigmapGenerator::Cli.options_for(key_options, true)
|
59
|
+
end
|
60
|
+
auth_config.optional_options.each do |key, key_options|
|
61
|
+
opt key, key_options[:description], HttpdConfigmapGenerator::Cli.options_for(key_options)
|
62
|
+
end
|
70
63
|
end
|
71
64
|
|
72
|
-
|
65
|
+
case auth_type
|
66
|
+
when "update" then auth_config.update(params)
|
67
|
+
when "export" then auth_config.export(params)
|
68
|
+
else auth_config.run_configure(params)
|
69
|
+
end
|
73
70
|
end
|
74
71
|
|
75
72
|
def self.options_for(key_options, required = false)
|
76
73
|
options = {}
|
77
|
-
|
78
|
-
|
74
|
+
if key_options[:default].nil?
|
75
|
+
options[:type] = key_options[:type] || :string
|
76
|
+
else
|
77
|
+
options[:default] = key_options[:default]
|
78
|
+
end
|
79
|
+
options[:required] = required
|
79
80
|
options[:short] = key_options[:short] if key_options[:short]
|
80
81
|
options[:multi] = key_options[:multi] if key_options[:multi]
|
81
82
|
options
|
@@ -83,19 +84,4 @@ Usage: #{CMD} auth_type | update | export [--help | options]
|
|
83
84
|
end
|
84
85
|
end
|
85
86
|
|
86
|
-
|
87
|
-
error_msg("
|
88
|
-
Usage: #{CMD} auth_type | update | export [--help | options]
|
89
|
-
Supported auth_type: #{HttpdConfigmapGenerator.supported_auth_types.join(', ')}
|
90
|
-
")
|
91
|
-
else
|
92
|
-
auth_type = ARGV.shift
|
93
|
-
case auth_type
|
94
|
-
when "update"
|
95
|
-
HttpdConfigmapGenerator::Cli.new.run_update
|
96
|
-
when "export"
|
97
|
-
HttpdConfigmapGenerator::Cli.new.run_export
|
98
|
-
else
|
99
|
-
HttpdConfigmapGenerator::Cli.new.run_configure(auth_type)
|
100
|
-
end
|
101
|
-
end
|
87
|
+
HttpdConfigmapGenerator::Cli.new.run
|
@@ -17,7 +17,7 @@ module HttpdConfigmapGenerator
|
|
17
17
|
super.merge(
|
18
18
|
:keycloak_add_metadata => { :description => "Download and add the Keycloak metadata file",
|
19
19
|
:default => false },
|
20
|
-
:keycloak_server => { :description => "Keycloak Server
|
20
|
+
:keycloak_server => { :description => "Keycloak Server FQDN or IP" },
|
21
21
|
:keycloak_realm => { :description => "Keycloak Realm for this client"}
|
22
22
|
)
|
23
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpd_configmap_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Httpd Auth Config Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-10-
|
11
|
+
date: 2017-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: codeclimate-test-reporter
|
@@ -172,7 +172,6 @@ files:
|
|
172
172
|
- lib/httpd_configmap_generator/base/sssd.rb
|
173
173
|
- lib/httpd_configmap_generator/export.rb
|
174
174
|
- lib/httpd_configmap_generator/ipa.rb
|
175
|
-
- lib/httpd_configmap_generator/options.rb
|
176
175
|
- lib/httpd_configmap_generator/saml.rb
|
177
176
|
- lib/httpd_configmap_generator/update.rb
|
178
177
|
- lib/httpd_configmap_generator/version.rb
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module HttpdConfigmapGenerator
|
2
|
-
def self.required_options
|
3
|
-
{
|
4
|
-
:host => { :description => "Application Domain" }
|
5
|
-
}
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.optional_options
|
9
|
-
{
|
10
|
-
:force => { :description => "Force configuration if configured already", :default => false }
|
11
|
-
}
|
12
|
-
end
|
13
|
-
end
|