ruby_easy_rsa 0.2.0.pre.3 → 0.2.0.pre.4
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/Gemfile.lock +1 -1
- data/lib/ruby_easy_rsa/commands/base.rb +1 -0
- data/lib/ruby_easy_rsa/commands/build_ca.rb +9 -40
- data/lib/ruby_easy_rsa/commands/gen_dh.rb +20 -0
- data/lib/ruby_easy_rsa/commands/init_pki.rb +19 -0
- data/lib/ruby_easy_rsa/commands/mixins/global_config.rb +25 -0
- data/lib/ruby_easy_rsa/commands/mixins/ssl_config.rb +49 -0
- data/lib/ruby_easy_rsa/commands.rb +2 -1
- data/lib/ruby_easy_rsa/version.rb +1 -1
- metadata +5 -2
- data/lib/ruby_easy_rsa/commands/initialise_pki.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc21e04c539a710e735e6507efc4eb9d86aa577adc8a248b9e000e77aeec8190
|
4
|
+
data.tar.gz: fd64c3138071e15c4e81fb2182301cef27c26e06ddbd407b32f93a9163275ea6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8222f95ff7d812a55ce2faf265ebb3524283b8f2868c8fff6ed1008d84236b6c8e717291f1aa3c89881baff8d228d7e4c8aa421956f9e1069e4f1cfa528aa02
|
7
|
+
data.tar.gz: b4e549e70b664312f4a87a1eb1c88dde834611421724ed2c9d2f8ea9699cb1115d582d95dbf4c9e2b470fbd7d088389be23f32b67c55891c7b9000ca59921449
|
data/Gemfile.lock
CHANGED
@@ -1,55 +1,24 @@
|
|
1
1
|
require 'lino'
|
2
|
+
|
2
3
|
require_relative 'base'
|
4
|
+
require_relative 'mixins/global_config'
|
5
|
+
require_relative 'mixins/ssl_config'
|
3
6
|
|
4
7
|
module RubyEasyRSA
|
5
8
|
module Commands
|
6
9
|
class BuildCA < Base
|
10
|
+
include Mixins::GlobalConfig
|
11
|
+
include Mixins::SSLConfig
|
12
|
+
|
7
13
|
def configure_command(builder, opts)
|
8
|
-
pki_directory = opts[:pki_directory]
|
9
14
|
algorithm = opts[:algorithm]
|
10
|
-
digest = opts[:digest]
|
11
|
-
key_size_in_bits = opts[:key_size_in_bits]
|
12
|
-
expires_in_days = opts[:expires_in_days]
|
13
|
-
distinguished_name_mode = opts[:distinguished_name_mode]
|
14
|
-
common_name = opts[:common_name]
|
15
|
-
country = opts[:country]
|
16
|
-
province = opts[:province]
|
17
|
-
city = opts[:city]
|
18
|
-
organisation = opts[:organisation]
|
19
|
-
organisational_unit = opts[:organisational_unit]
|
20
|
-
email = opts[:email]
|
21
15
|
batch = opts[:batch]
|
22
16
|
encrypt_key = opts[:encrypt_key].nil? ? true : opts[:encrypt_key]
|
23
17
|
sub_ca = opts[:sub_ca]
|
24
18
|
|
25
|
-
builder = builder
|
26
|
-
|
27
|
-
builder = builder.
|
28
|
-
'--use-algo', algorithm) if algorithm
|
29
|
-
builder = builder.with_option(
|
30
|
-
'--digest', digest) if digest
|
31
|
-
builder = builder.with_option(
|
32
|
-
'--days', expires_in_days) if expires_in_days
|
33
|
-
builder = builder.with_option(
|
34
|
-
'--keysize', key_size_in_bits) if key_size_in_bits
|
35
|
-
builder = builder.with_option(
|
36
|
-
'--dn-mode', distinguished_name_mode) if distinguished_name_mode
|
37
|
-
builder = builder.with_option(
|
38
|
-
'--req-cn', common_name, quoting: '"') if common_name
|
39
|
-
builder = builder.with_option(
|
40
|
-
'--req-c', country, quoting: '"') if country
|
41
|
-
builder = builder.with_option(
|
42
|
-
'--req-st', province, quoting: '"') if province
|
43
|
-
builder = builder.with_option(
|
44
|
-
'--req-city', city, quoting: '"') if city
|
45
|
-
builder = builder.with_option(
|
46
|
-
'--req-org', organisation, quoting: '"') if organisation
|
47
|
-
builder = builder.with_option(
|
48
|
-
'--req-ou', organisational_unit, quoting: '"') if organisational_unit
|
49
|
-
builder = builder.with_option(
|
50
|
-
'--req-email', email) if email
|
51
|
-
builder = builder.with_flag(
|
52
|
-
'--batch') if batch
|
19
|
+
builder = super(builder, opts)
|
20
|
+
builder = builder.with_option('--use-algo', algorithm) if algorithm
|
21
|
+
builder = builder.with_flag('--batch') if batch
|
53
22
|
builder = builder.with_subcommand('build-ca')
|
54
23
|
builder = builder.with_argument('nopass') unless encrypt_key
|
55
24
|
builder = builder.with_argument('subca') if sub_ca
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'lino'
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
require_relative 'mixins/global_config'
|
5
|
+
require_relative 'mixins/ssl_config'
|
6
|
+
|
7
|
+
module RubyEasyRSA
|
8
|
+
module Commands
|
9
|
+
class GenDH < Base
|
10
|
+
include Mixins::GlobalConfig
|
11
|
+
include Mixins::SSLConfig
|
12
|
+
|
13
|
+
def configure_command(builder, opts)
|
14
|
+
builder = super(builder, opts)
|
15
|
+
builder = builder.with_subcommand('gen-dh')
|
16
|
+
builder
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'lino'
|
2
|
+
|
3
|
+
require_relative 'base'
|
4
|
+
require_relative 'mixins/global_config'
|
5
|
+
require_relative 'mixins/ssl_config'
|
6
|
+
|
7
|
+
module RubyEasyRSA
|
8
|
+
module Commands
|
9
|
+
class InitPKI < Base
|
10
|
+
include Mixins::GlobalConfig
|
11
|
+
include Mixins::SSLConfig
|
12
|
+
|
13
|
+
def configure_command(builder, opts)
|
14
|
+
builder = super(builder, opts)
|
15
|
+
builder.with_subcommand('init-pki')
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module RubyEasyRSA
|
2
|
+
module Commands
|
3
|
+
module Mixins
|
4
|
+
module GlobalConfig
|
5
|
+
def configure_command(builder, opts)
|
6
|
+
openssl_binary = opts[:openssl_binary]
|
7
|
+
ssl_configuration = opts[:ssl_configuration]
|
8
|
+
safe_configuration = opts[:safe_configuration]
|
9
|
+
vars = opts[:vars]
|
10
|
+
|
11
|
+
builder = super(builder, opts)
|
12
|
+
builder = builder.with_environment_variable(
|
13
|
+
'EASYRSA_OPENSSL', openssl_binary) if openssl_binary
|
14
|
+
builder = builder.with_environment_variable(
|
15
|
+
'EASYRSA_SSL_CONF', ssl_configuration) if ssl_configuration
|
16
|
+
builder = builder.with_environment_variable(
|
17
|
+
'EASYRSA_SAFE_CONF', safe_configuration) if safe_configuration
|
18
|
+
builder = builder.with_option(
|
19
|
+
'--vars', vars) if vars
|
20
|
+
builder
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
module RubyEasyRSA
|
2
|
+
module Commands
|
3
|
+
module Mixins
|
4
|
+
module SSLConfig
|
5
|
+
def configure_command(builder, opts)
|
6
|
+
pki_directory = opts[:pki_directory]
|
7
|
+
digest = opts[:digest]
|
8
|
+
key_size_in_bits = opts[:key_size_in_bits]
|
9
|
+
expires_in_days = opts[:expires_in_days]
|
10
|
+
distinguished_name_mode = opts[:distinguished_name_mode]
|
11
|
+
common_name = opts[:common_name]
|
12
|
+
country = opts[:country]
|
13
|
+
province = opts[:province]
|
14
|
+
city = opts[:city]
|
15
|
+
organisation = opts[:organisation]
|
16
|
+
organisational_unit = opts[:organisational_unit]
|
17
|
+
email = opts[:email]
|
18
|
+
|
19
|
+
builder = super(builder, opts)
|
20
|
+
builder = builder.with_option(
|
21
|
+
'--pki-dir', pki_directory) if pki_directory
|
22
|
+
builder = builder.with_option(
|
23
|
+
'--digest', digest) if digest
|
24
|
+
builder = builder.with_option(
|
25
|
+
'--days', expires_in_days) if expires_in_days
|
26
|
+
builder = builder.with_option(
|
27
|
+
'--keysize', key_size_in_bits) if key_size_in_bits
|
28
|
+
builder = builder.with_option(
|
29
|
+
'--dn-mode', distinguished_name_mode) if distinguished_name_mode
|
30
|
+
builder = builder.with_option(
|
31
|
+
'--req-cn', common_name, quoting: '"') if common_name
|
32
|
+
builder = builder.with_option(
|
33
|
+
'--req-c', country, quoting: '"') if country
|
34
|
+
builder = builder.with_option(
|
35
|
+
'--req-st', province, quoting: '"') if province
|
36
|
+
builder = builder.with_option(
|
37
|
+
'--req-city', city, quoting: '"') if city
|
38
|
+
builder = builder.with_option(
|
39
|
+
'--req-org', organisation, quoting: '"') if organisation
|
40
|
+
builder = builder.with_option(
|
41
|
+
'--req-ou', organisational_unit, quoting: '"') if organisational_unit
|
42
|
+
builder = builder.with_option(
|
43
|
+
'--req-email', email) if email
|
44
|
+
builder
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby_easy_rsa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.pre.
|
4
|
+
version: 0.2.0.pre.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toby Clemson
|
@@ -159,7 +159,10 @@ files:
|
|
159
159
|
- lib/ruby_easy_rsa/commands.rb
|
160
160
|
- lib/ruby_easy_rsa/commands/base.rb
|
161
161
|
- lib/ruby_easy_rsa/commands/build_ca.rb
|
162
|
-
- lib/ruby_easy_rsa/commands/
|
162
|
+
- lib/ruby_easy_rsa/commands/gen_dh.rb
|
163
|
+
- lib/ruby_easy_rsa/commands/init_pki.rb
|
164
|
+
- lib/ruby_easy_rsa/commands/mixins/global_config.rb
|
165
|
+
- lib/ruby_easy_rsa/commands/mixins/ssl_config.rb
|
163
166
|
- lib/ruby_easy_rsa/version.rb
|
164
167
|
- ruby_easy_rsa.gemspec
|
165
168
|
- scripts/ci/common/configure-git.sh
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'lino'
|
2
|
-
require_relative 'base'
|
3
|
-
|
4
|
-
module RubyEasyRSA
|
5
|
-
module Commands
|
6
|
-
class InitialisePKI < Base
|
7
|
-
def configure_command(builder, opts)
|
8
|
-
pki_directory = opts[:pki_directory]
|
9
|
-
|
10
|
-
builder = builder.with_option('--pki-dir', pki_directory) if pki_directory
|
11
|
-
builder.with_subcommand('init-pki')
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|