puppetserver-ca 1.6.0 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/Gemfile +7 -2
- data/lib/puppetserver/ca/action/list.rb +32 -11
- data/lib/puppetserver/ca/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c28c8d7be542d749738c32b848b4bb318498a949fb52e4bf6d44a5da878583a7
|
4
|
+
data.tar.gz: c6e09079aa3463da55cc0c185c7bddad22ff1967cd57c0d687dc000072748749
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46f81f6b946a37380c520c9611aaf4ba89155fcdaa6eefa1500cece3a57c946498ce959862e99645cc9dfcbedd8667157abf0b03fcfb37068ce27c9819b3088a
|
7
|
+
data.tar.gz: 1e37edeee98389efa59e82f2d041337ca4ba72e9a82b2fdf053e40d0f02139454d0e8d547f070dfcde9a639aba19181cbd464f61e29351a4bee30cf2aff4f37a
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -5,6 +5,11 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
|
|
5
5
|
# Specify your gem's dependencies in puppetserver-ca.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem 'pry'
|
9
|
-
gem 'pry-byebug'
|
10
8
|
gem 'hocon', '~> 1.2', require: false
|
9
|
+
gem 'rake', '~> 13.0', require: false
|
10
|
+
gem 'rspec', '~> 3.4', require: false
|
11
|
+
|
12
|
+
group(:development, optional: true) do
|
13
|
+
gem 'pry'
|
14
|
+
gem 'pry-byebug'
|
15
|
+
end
|
@@ -118,20 +118,41 @@ Options:
|
|
118
118
|
end
|
119
119
|
|
120
120
|
def output_certs(certs)
|
121
|
-
|
121
|
+
cert_column_width = certs.map { |c| c['name'].size }.max
|
122
|
+
|
122
123
|
certs.each do |cert|
|
123
|
-
|
124
|
-
padded = cert_size if cert_size > padded
|
124
|
+
@logger.inform(format_cert(cert, cert_column_width))
|
125
125
|
end
|
126
|
+
end
|
126
127
|
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
128
|
+
def format_cert(cert, cert_column_width)
|
129
|
+
[
|
130
|
+
format_cert_and_sha(cert, cert_column_width),
|
131
|
+
format_alt_names(cert),
|
132
|
+
format_authorization_extensions(cert)
|
133
|
+
].compact.join("\t")
|
134
|
+
end
|
135
|
+
|
136
|
+
def format_cert_and_sha(cert, cert_column_width)
|
137
|
+
justified_certname = cert['name'].ljust(cert_column_width + 6)
|
138
|
+
sha = cert['fingerprints']['SHA256']
|
139
|
+
" #{justified_certname} (SHA256) #{sha}"
|
140
|
+
end
|
141
|
+
|
142
|
+
def format_alt_names(cert)
|
143
|
+
# In newer versions of the CA api we return subject_alt_names
|
144
|
+
# in addition to dns_alt_names, this field includes DNS alt
|
145
|
+
# names but also IP alt names.
|
146
|
+
alt_names = cert['subject_alt_names'] || cert['dns_alt_names']
|
147
|
+
"alt names: #{alt_names}" unless alt_names.empty?
|
148
|
+
end
|
149
|
+
|
150
|
+
def format_authorization_extensions(cert)
|
151
|
+
auth_exts = cert['authorization_extensions']
|
152
|
+
return nil if auth_exts.nil? || auth_exts.empty?
|
153
|
+
|
154
|
+
values = auth_exts.map { |ext, value| "#{ext}: #{value}" }.join(', ')
|
155
|
+
"authorization extensions: [#{values}]"
|
135
156
|
end
|
136
157
|
|
137
158
|
def separate_certs(all_certs)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppetserver-ca
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|