ruby_easy_rsa 0.10.0.pre.5 → 0.10.0.pre.8
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 +2 -0
- data/Gemfile.lock +37 -2
- data/LICENSE.txt +1 -1
- data/Rakefile +83 -46
- data/lib/ruby_easy_rsa/commands/base.rb +16 -18
- data/lib/ruby_easy_rsa/commands/build_ca.rb +3 -2
- data/lib/ruby_easy_rsa/commands/build_client_full.rb +3 -2
- data/lib/ruby_easy_rsa/commands/build_client_server_full.rb +3 -2
- data/lib/ruby_easy_rsa/commands/build_server_full.rb +3 -2
- data/lib/ruby_easy_rsa/commands/export_p12.rb +2 -0
- data/lib/ruby_easy_rsa/commands/export_p7.rb +2 -0
- data/lib/ruby_easy_rsa/commands/gen_crl.rb +3 -2
- data/lib/ruby_easy_rsa/commands/gen_dh.rb +3 -2
- data/lib/ruby_easy_rsa/commands/gen_req.rb +3 -2
- data/lib/ruby_easy_rsa/commands/import_req.rb +3 -2
- data/lib/ruby_easy_rsa/commands/init_pki.rb +2 -0
- data/lib/ruby_easy_rsa/commands/mixins/algorithm_config.rb +29 -8
- data/lib/ruby_easy_rsa/commands/mixins/copy_extensions_config.rb +13 -3
- data/lib/ruby_easy_rsa/commands/mixins/encrypt_key_config.rb +17 -3
- data/lib/ruby_easy_rsa/commands/mixins/extra_extensions_config.rb +26 -8
- data/lib/ruby_easy_rsa/commands/mixins/global_config.rb +94 -29
- data/lib/ruby_easy_rsa/commands/mixins/inline_credentials_file_config.rb +15 -3
- data/lib/ruby_easy_rsa/commands/mixins/netscape_extensions_config.rb +32 -9
- data/lib/ruby_easy_rsa/commands/mixins/ssl_config.rb +114 -35
- data/lib/ruby_easy_rsa/commands/mixins/sub_ca_config.rb +15 -4
- data/lib/ruby_easy_rsa/commands/renew.rb +3 -2
- data/lib/ruby_easy_rsa/commands/revoke.rb +2 -0
- data/lib/ruby_easy_rsa/commands/set_ec_pass.rb +2 -0
- data/lib/ruby_easy_rsa/commands/set_rsa_pass.rb +2 -0
- data/lib/ruby_easy_rsa/commands/show_ca.rb +2 -0
- data/lib/ruby_easy_rsa/commands/show_cert.rb +2 -0
- data/lib/ruby_easy_rsa/commands/show_req.rb +2 -0
- data/lib/ruby_easy_rsa/commands/sign_req.rb +3 -2
- data/lib/ruby_easy_rsa/commands/update_db.rb +3 -2
- data/lib/ruby_easy_rsa/commands/upgrade.rb +3 -2
- data/lib/ruby_easy_rsa/commands.rb +3 -2
- data/lib/ruby_easy_rsa/version.rb +3 -1
- data/lib/ruby_easy_rsa.rb +6 -0
- data/ruby_easy_rsa.gemspec +55 -0
- metadata +64 -6
@@ -1,19 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RubyEasyRSA
|
2
4
|
module Commands
|
3
5
|
module Mixins
|
4
6
|
module ExtraExtensionsConfig
|
7
|
+
# rubocop:disable Style/RedundantAssignment
|
5
8
|
def configure_command(builder, opts)
|
6
|
-
extra_extensions = opts[:extra_extensions]
|
7
|
-
subject_alternative_name = opts[:subject_alternative_name]
|
8
|
-
|
9
9
|
builder = super(builder, opts)
|
10
|
-
builder = builder
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
) if subject_alternative_name
|
10
|
+
builder = with_extra_extensions(builder, opts[:extra_extensions])
|
11
|
+
builder = with_subject_alternative_name(
|
12
|
+
builder, opts[:subject_alternative_name]
|
13
|
+
)
|
15
14
|
builder
|
16
15
|
end
|
16
|
+
# rubocop:enable Style/RedundantAssignment
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def with_extra_extensions(builder, extra_extensions)
|
21
|
+
return builder unless extra_extensions
|
22
|
+
|
23
|
+
builder.with_environment_variable(
|
24
|
+
'EASYRSA_EXTRA_EXT', extra_extensions
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
def with_subject_alternative_name(builder, subject_alternative_name)
|
29
|
+
return builder unless subject_alternative_name
|
30
|
+
|
31
|
+
builder.with_option(
|
32
|
+
'--subject-alt-name', subject_alternative_name, quoting: '"'
|
33
|
+
)
|
34
|
+
end
|
17
35
|
end
|
18
36
|
end
|
19
37
|
end
|
@@ -1,40 +1,105 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RubyEasyRSA
|
2
4
|
module Commands
|
3
5
|
module Mixins
|
4
6
|
module GlobalConfig
|
7
|
+
# rubocop:disable Style/RedundantAssignment
|
8
|
+
# rubocop:disable Metrics/MethodLength
|
9
|
+
# rubocop:disable Metrics/AbcSize
|
5
10
|
def configure_command(builder, opts)
|
6
|
-
extensions_directory = opts[:extensions_directory]
|
7
|
-
openssl_binary = opts[:openssl_binary]
|
8
|
-
ssl_configuration = opts[:ssl_configuration]
|
9
|
-
safe_configuration = opts[:safe_configuration]
|
10
|
-
vars = opts[:vars]
|
11
|
-
batch = opts[:batch]
|
12
|
-
pki_directory = opts[:pki_directory]
|
13
|
-
input_password = opts[:input_password]
|
14
|
-
output_password = opts[:output_password]
|
15
|
-
|
16
11
|
builder = super(builder, opts)
|
17
|
-
builder = builder
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
builder = builder
|
22
|
-
|
23
|
-
builder = builder
|
24
|
-
|
25
|
-
builder = builder
|
26
|
-
|
27
|
-
builder = builder
|
28
|
-
'--batch') if batch
|
29
|
-
builder = builder.with_option(
|
30
|
-
'--pki-dir', pki_directory) if pki_directory
|
31
|
-
builder = builder.with_option(
|
32
|
-
'--passin', input_password) if input_password
|
33
|
-
builder = builder.with_option(
|
34
|
-
'--passout', output_password) if output_password
|
12
|
+
builder = with_openssl_binary(builder, opts[:openssl_binary])
|
13
|
+
builder = with_extensions_directory(
|
14
|
+
builder, opts[:extensions_directory]
|
15
|
+
)
|
16
|
+
builder = with_ssl_configuration(builder, opts[:ssl_configuration])
|
17
|
+
builder = with_safe_configuration(builder, opts[:safe_configuration])
|
18
|
+
builder = with_vars(builder, opts[:vars])
|
19
|
+
builder = with_batch(builder, opts[:batch])
|
20
|
+
builder = with_pki_directory(builder, opts[:pki_directory])
|
21
|
+
builder = with_input_password(builder, opts[:input_password])
|
22
|
+
builder = with_output_password(builder, opts[:output_password])
|
35
23
|
builder
|
36
24
|
end
|
25
|
+
# rubocop:enable Metrics/AbcSize
|
26
|
+
# rubocop:enable Metrics/MethodLength
|
27
|
+
# rubocop:enable Style/RedundantAssignment
|
28
|
+
|
29
|
+
private
|
30
|
+
|
31
|
+
def with_openssl_binary(builder, openssl_binary)
|
32
|
+
return builder unless openssl_binary
|
33
|
+
|
34
|
+
builder.with_environment_variable(
|
35
|
+
'EASYRSA_OPENSSL', openssl_binary
|
36
|
+
)
|
37
|
+
end
|
38
|
+
|
39
|
+
def with_extensions_directory(builder, extensions_directory)
|
40
|
+
return builder unless extensions_directory
|
41
|
+
|
42
|
+
builder.with_environment_variable(
|
43
|
+
'EASYRSA_EXT_DIR', extensions_directory
|
44
|
+
)
|
45
|
+
end
|
46
|
+
|
47
|
+
def with_ssl_configuration(builder, ssl_configuration)
|
48
|
+
return builder unless ssl_configuration
|
49
|
+
|
50
|
+
builder.with_environment_variable(
|
51
|
+
'EASYRSA_SSL_CONF', ssl_configuration
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
55
|
+
def with_safe_configuration(builder, safe_configuration)
|
56
|
+
return builder unless safe_configuration
|
57
|
+
|
58
|
+
builder.with_environment_variable(
|
59
|
+
'EASYRSA_SAFE_CONF', safe_configuration
|
60
|
+
)
|
61
|
+
end
|
62
|
+
|
63
|
+
def with_vars(builder, vars)
|
64
|
+
return builder unless vars
|
65
|
+
|
66
|
+
builder.with_option(
|
67
|
+
'--vars', vars
|
68
|
+
)
|
69
|
+
end
|
70
|
+
|
71
|
+
def with_batch(builder, batch)
|
72
|
+
return builder unless batch
|
73
|
+
|
74
|
+
builder.with_flag(
|
75
|
+
'--batch'
|
76
|
+
)
|
77
|
+
end
|
78
|
+
|
79
|
+
def with_pki_directory(builder, pki_directory)
|
80
|
+
return builder unless pki_directory
|
81
|
+
|
82
|
+
builder.with_option(
|
83
|
+
'--pki-dir', pki_directory
|
84
|
+
)
|
85
|
+
end
|
86
|
+
|
87
|
+
def with_input_password(builder, input_password)
|
88
|
+
return builder unless input_password
|
89
|
+
|
90
|
+
builder.with_option(
|
91
|
+
'--passin', input_password
|
92
|
+
)
|
93
|
+
end
|
94
|
+
|
95
|
+
def with_output_password(builder, output_password)
|
96
|
+
return builder unless output_password
|
97
|
+
|
98
|
+
builder.with_option(
|
99
|
+
'--passout', output_password
|
100
|
+
)
|
101
|
+
end
|
37
102
|
end
|
38
103
|
end
|
39
104
|
end
|
40
|
-
end
|
105
|
+
end
|
@@ -1,14 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RubyEasyRSA
|
2
4
|
module Commands
|
3
5
|
module Mixins
|
4
6
|
module InlineCredentialsFileConfig
|
7
|
+
# rubocop:disable Style/RedundantAssignment
|
5
8
|
def configure_command(builder, opts)
|
6
|
-
inline_credentials_file = opts[:inline_credentials_file]
|
7
|
-
|
8
9
|
builder = super(builder, opts)
|
9
|
-
builder =
|
10
|
+
builder = with_inline_credentials_file(
|
11
|
+
builder, opts[:inline_credentials_file]
|
12
|
+
)
|
10
13
|
builder
|
11
14
|
end
|
15
|
+
# rubocop:enable Style/RedundantAssignment
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def with_inline_credentials_file(builder, inline_credentials_file)
|
20
|
+
return builder unless inline_credentials_file
|
21
|
+
|
22
|
+
builder.with_argument('inline')
|
23
|
+
end
|
12
24
|
end
|
13
25
|
end
|
14
26
|
end
|
@@ -1,20 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RubyEasyRSA
|
2
4
|
module Commands
|
3
5
|
module Mixins
|
4
6
|
module NetscapeExtensionsConfig
|
7
|
+
# rubocop:disable Style/RedundantAssignment
|
5
8
|
def configure_command(builder, opts)
|
6
|
-
netscape_extensions_support = opts[:netscape_extensions_support]
|
7
|
-
netscape_extensions_comment = opts[:netscape_extensions_comment]
|
8
|
-
|
9
9
|
builder = super(builder, opts)
|
10
|
-
builder =
|
11
|
-
|
12
|
-
)
|
13
|
-
builder =
|
14
|
-
|
15
|
-
)
|
10
|
+
builder = with_netscape_extensions_support(
|
11
|
+
builder, opts[:netscape_extensions_support]
|
12
|
+
)
|
13
|
+
builder = with_netscape_extensions_comment(
|
14
|
+
builder, opts[:netscape_extensions_comment]
|
15
|
+
)
|
16
16
|
builder
|
17
17
|
end
|
18
|
+
# rubocop:enable Style/RedundantAssignment
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def with_netscape_extensions_support(
|
23
|
+
builder, netscape_extensions_support
|
24
|
+
)
|
25
|
+
return builder if netscape_extensions_support.nil?
|
26
|
+
|
27
|
+
builder.with_option(
|
28
|
+
'--ns-cert', netscape_extensions_support ? 'yes' : 'no'
|
29
|
+
)
|
30
|
+
end
|
31
|
+
|
32
|
+
def with_netscape_extensions_comment(
|
33
|
+
builder, netscape_extensions_comment
|
34
|
+
)
|
35
|
+
return builder unless netscape_extensions_comment
|
36
|
+
|
37
|
+
builder.with_option(
|
38
|
+
'--ns-comment', netscape_extensions_comment, quoting: '"'
|
39
|
+
)
|
40
|
+
end
|
18
41
|
end
|
19
42
|
end
|
20
43
|
end
|
@@ -1,46 +1,125 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RubyEasyRSA
|
2
4
|
module Commands
|
3
5
|
module Mixins
|
4
6
|
module SSLConfig
|
7
|
+
# rubocop:disable Style/RedundantAssignment
|
8
|
+
# rubocop:disable Metrics/MethodLength
|
9
|
+
# rubocop:disable Metrics/AbcSize
|
5
10
|
def configure_command(builder, opts)
|
6
|
-
digest = opts[:digest]
|
7
|
-
key_size_in_bits = opts[:key_size_in_bits]
|
8
|
-
expires_in_days = opts[:expires_in_days]
|
9
|
-
distinguished_name_mode = opts[:distinguished_name_mode]
|
10
|
-
common_name = opts[:common_name]
|
11
|
-
country = opts[:country]
|
12
|
-
province = opts[:province]
|
13
|
-
city = opts[:city]
|
14
|
-
organisation = opts[:organisation]
|
15
|
-
organisational_unit = opts[:organisational_unit]
|
16
|
-
email = opts[:email]
|
17
|
-
|
18
11
|
builder = super(builder, opts)
|
19
|
-
builder = builder
|
20
|
-
|
21
|
-
builder = builder
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
builder = builder
|
26
|
-
|
27
|
-
builder = builder
|
28
|
-
|
29
|
-
builder = builder
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
builder = builder
|
34
|
-
'--req-city', city, quoting: '"') if city
|
35
|
-
builder = builder.with_option(
|
36
|
-
'--req-org', organisation, quoting: '"') if organisation
|
37
|
-
builder = builder.with_option(
|
38
|
-
'--req-ou', organisational_unit, quoting: '"') if organisational_unit
|
39
|
-
builder = builder.with_option(
|
40
|
-
'--req-email', email) if email
|
12
|
+
builder = with_digest(builder, opts[:digest])
|
13
|
+
builder = with_expires_in_days(builder, opts[:expires_in_days])
|
14
|
+
builder = with_key_size_in_bits(builder, opts[:key_size_in_bits])
|
15
|
+
builder = with_distinguished_name_mode(
|
16
|
+
builder, opts[:distinguished_name_mode]
|
17
|
+
)
|
18
|
+
builder = with_common_name(builder, opts[:common_name])
|
19
|
+
builder = with_country(builder, opts[:country])
|
20
|
+
builder = with_province(builder, opts[:province])
|
21
|
+
builder = with_city(builder, opts[:city])
|
22
|
+
builder = with_organisation(builder, opts[:organisation])
|
23
|
+
builder = with_organisational_unit(
|
24
|
+
builder, opts[:organisational_unit]
|
25
|
+
)
|
26
|
+
builder = with_email(builder, opts[:email])
|
41
27
|
builder
|
42
28
|
end
|
29
|
+
# rubocop:enable Metrics/AbcSize
|
30
|
+
# rubocop:enable Metrics/MethodLength
|
31
|
+
# rubocop:enable Style/RedundantAssignment
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def with_digest(builder, digest)
|
36
|
+
return builder unless digest
|
37
|
+
|
38
|
+
builder.with_option(
|
39
|
+
'--digest', digest
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
def with_expires_in_days(builder, expires_in_days)
|
44
|
+
return builder unless expires_in_days
|
45
|
+
|
46
|
+
builder.with_option(
|
47
|
+
'--days', expires_in_days
|
48
|
+
)
|
49
|
+
end
|
50
|
+
|
51
|
+
def with_key_size_in_bits(builder, key_size_in_bits)
|
52
|
+
return builder unless key_size_in_bits
|
53
|
+
|
54
|
+
builder.with_option(
|
55
|
+
'--keysize', key_size_in_bits
|
56
|
+
)
|
57
|
+
end
|
58
|
+
|
59
|
+
def with_distinguished_name_mode(builder, distinguished_name_mode)
|
60
|
+
return builder unless distinguished_name_mode
|
61
|
+
|
62
|
+
builder.with_option(
|
63
|
+
'--dn-mode', distinguished_name_mode
|
64
|
+
)
|
65
|
+
end
|
66
|
+
|
67
|
+
def with_common_name(builder, common_name)
|
68
|
+
return builder unless common_name
|
69
|
+
|
70
|
+
builder.with_option(
|
71
|
+
'--req-cn', common_name, quoting: '"'
|
72
|
+
)
|
73
|
+
end
|
74
|
+
|
75
|
+
def with_country(builder, country)
|
76
|
+
return builder unless country
|
77
|
+
|
78
|
+
builder.with_option(
|
79
|
+
'--req-c', country, quoting: '"'
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
83
|
+
def with_province(builder, province)
|
84
|
+
return builder unless province
|
85
|
+
|
86
|
+
builder.with_option(
|
87
|
+
'--req-st', province, quoting: '"'
|
88
|
+
)
|
89
|
+
end
|
90
|
+
|
91
|
+
def with_city(builder, city)
|
92
|
+
return builder unless city
|
93
|
+
|
94
|
+
builder.with_option(
|
95
|
+
'--req-city', city, quoting: '"'
|
96
|
+
)
|
97
|
+
end
|
98
|
+
|
99
|
+
def with_organisation(builder, organisation)
|
100
|
+
return builder unless organisation
|
101
|
+
|
102
|
+
builder.with_option(
|
103
|
+
'--req-org', organisation, quoting: '"'
|
104
|
+
)
|
105
|
+
end
|
106
|
+
|
107
|
+
def with_organisational_unit(builder, organisational_unit)
|
108
|
+
return builder unless organisational_unit
|
109
|
+
|
110
|
+
builder.with_option(
|
111
|
+
'--req-ou', organisational_unit, quoting: '"'
|
112
|
+
)
|
113
|
+
end
|
114
|
+
|
115
|
+
def with_email(builder, email)
|
116
|
+
return builder unless email
|
117
|
+
|
118
|
+
builder.with_option(
|
119
|
+
'--req-email', email
|
120
|
+
)
|
121
|
+
end
|
43
122
|
end
|
44
123
|
end
|
45
124
|
end
|
46
|
-
end
|
125
|
+
end
|
@@ -1,15 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module RubyEasyRSA
|
2
4
|
module Commands
|
3
5
|
module Mixins
|
4
6
|
module SubCAConfig
|
7
|
+
# rubocop:disable Style/RedundantAssignment
|
5
8
|
def configure_command(builder, opts)
|
6
|
-
sub_ca_length = opts[:sub_ca_length]
|
7
|
-
|
8
9
|
builder = super(builder, opts)
|
9
|
-
builder = builder
|
10
|
-
'--subca-len', sub_ca_length) if sub_ca_length
|
10
|
+
builder = with_sub_ca_length(builder, opts[:sub_ca_length])
|
11
11
|
builder
|
12
12
|
end
|
13
|
+
# rubocop:enable Style/RedundantAssignment
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
def with_sub_ca_length(builder, sub_ca_length)
|
18
|
+
return builder unless sub_ca_length
|
19
|
+
|
20
|
+
builder.with_option(
|
21
|
+
'--subca-len', sub_ca_length
|
22
|
+
)
|
23
|
+
end
|
13
24
|
end
|
14
25
|
end
|
15
26
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'lino'
|
2
4
|
|
3
5
|
require_relative 'base'
|
@@ -17,8 +19,7 @@ module RubyEasyRSA
|
|
17
19
|
|
18
20
|
builder = builder.with_subcommand('renew')
|
19
21
|
builder = builder.with_argument(filename_base)
|
20
|
-
|
21
|
-
builder
|
22
|
+
super(builder, opts)
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'lino'
|
2
4
|
|
3
5
|
require_relative 'base'
|
@@ -27,8 +29,7 @@ module RubyEasyRSA
|
|
27
29
|
builder = super(builder, opts)
|
28
30
|
builder = builder.with_subcommand('sign-req')
|
29
31
|
builder = builder.with_argument(type)
|
30
|
-
builder
|
31
|
-
builder
|
32
|
+
builder.with_argument(filename_base)
|
32
33
|
end
|
33
34
|
end
|
34
35
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'lino'
|
2
4
|
|
3
5
|
require_relative 'base'
|
@@ -12,8 +14,7 @@ module RubyEasyRSA
|
|
12
14
|
|
13
15
|
def configure_command(builder, opts)
|
14
16
|
builder = builder.with_subcommand('update-db')
|
15
|
-
|
16
|
-
builder
|
17
|
+
super(builder, opts)
|
17
18
|
end
|
18
19
|
end
|
19
20
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'lino'
|
2
4
|
|
3
5
|
require_relative 'base'
|
@@ -15,8 +17,7 @@ module RubyEasyRSA
|
|
15
17
|
|
16
18
|
builder = super(builder, opts)
|
17
19
|
builder = builder.with_subcommand('upgrade')
|
18
|
-
builder
|
19
|
-
builder
|
20
|
+
builder.with_argument(type)
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require_relative 'commands/init_pki'
|
2
4
|
require_relative 'commands/build_ca'
|
3
5
|
require_relative 'commands/gen_dh'
|
@@ -22,6 +24,5 @@ require_relative 'commands/upgrade'
|
|
22
24
|
|
23
25
|
module RubyEasyRSA
|
24
26
|
module Commands
|
25
|
-
|
26
27
|
end
|
27
|
-
end
|
28
|
+
end
|
data/lib/ruby_easy_rsa.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'ruby_easy_rsa/version'
|
2
4
|
require 'ruby_easy_rsa/commands'
|
3
5
|
|
@@ -91,13 +93,17 @@ module RubyEasyRSA
|
|
91
93
|
Commands::ExportP12.new.execute(opts)
|
92
94
|
end
|
93
95
|
|
96
|
+
# rubocop:disable Naming/AccessorMethodName
|
94
97
|
def set_rsa_pass(opts = {})
|
95
98
|
Commands::SetRSAPass.new.execute(opts)
|
96
99
|
end
|
100
|
+
# rubocop:enable Naming/AccessorMethodName
|
97
101
|
|
102
|
+
# rubocop:disable Naming/AccessorMethodName
|
98
103
|
def set_ec_pass(opts = {})
|
99
104
|
Commands::SetECPass.new.execute(opts)
|
100
105
|
end
|
106
|
+
# rubocop:enable Naming/AccessorMethodName
|
101
107
|
|
102
108
|
def upgrade(opts = {})
|
103
109
|
Commands::Upgrade.new.execute(opts)
|
@@ -0,0 +1,55 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require 'ruby_easy_rsa/version'
|
6
|
+
|
7
|
+
files = %w[
|
8
|
+
bin
|
9
|
+
lib
|
10
|
+
CODE_OF_CONDUCT.md
|
11
|
+
ruby_easy_rsa.gemspec
|
12
|
+
Gemfile
|
13
|
+
LICENSE.txt
|
14
|
+
Rakefile
|
15
|
+
README.md
|
16
|
+
]
|
17
|
+
|
18
|
+
Gem::Specification.new do |spec|
|
19
|
+
spec.name = 'ruby_easy_rsa'
|
20
|
+
spec.version = RubyEasyRSA::VERSION
|
21
|
+
spec.authors = ['InfraBlocks Maintainers']
|
22
|
+
spec.email = ['maintainers@infrablocks.io']
|
23
|
+
|
24
|
+
spec.summary = 'A simple Ruby wrapper for invoking EasyRSA commands.'
|
25
|
+
spec.description = 'Wraps the EasyRSA scripts so that they can be ' \
|
26
|
+
'invoked from a Ruby script or Rakefile.'
|
27
|
+
spec.homepage = 'https://github.com/infrablocks/ruby_easy_rsa'
|
28
|
+
spec.license = 'MIT'
|
29
|
+
|
30
|
+
spec.files = `git ls-files -z`.split("\x0").select do |f|
|
31
|
+
f.match(/^(#{files.map { |g| Regexp.escape(g) }.join('|')})/)
|
32
|
+
end
|
33
|
+
spec.bindir = 'exe'
|
34
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
35
|
+
spec.require_paths = ['lib']
|
36
|
+
|
37
|
+
spec.required_ruby_version = '>= 2.7'
|
38
|
+
|
39
|
+
spec.add_dependency 'lino', '~> 3.0'
|
40
|
+
|
41
|
+
spec.add_development_dependency 'bundler'
|
42
|
+
spec.add_development_dependency 'gem-release'
|
43
|
+
spec.add_development_dependency 'rake'
|
44
|
+
spec.add_development_dependency 'rake_circle_ci'
|
45
|
+
spec.add_development_dependency 'rake_github'
|
46
|
+
spec.add_development_dependency 'rake_gpg'
|
47
|
+
spec.add_development_dependency 'rake_ssh'
|
48
|
+
spec.add_development_dependency 'rspec'
|
49
|
+
spec.add_development_dependency 'rubocop'
|
50
|
+
spec.add_development_dependency 'rubocop-rake'
|
51
|
+
spec.add_development_dependency 'rubocop-rspec'
|
52
|
+
spec.add_development_dependency 'simplecov'
|
53
|
+
|
54
|
+
spec.metadata['rubygems_mfa_required'] = 'false'
|
55
|
+
end
|