google-ssl-cert 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +3 -0
- data/CHANGELOG.md +7 -0
- data/Gemfile +6 -0
- data/Guardfile +19 -0
- data/LICENSE.txt +1 -0
- data/README.md +153 -0
- data/Rakefile +14 -0
- data/docs/google-secrets-cheatsheet.md +6 -0
- data/exe/google-ssl-cert +14 -0
- data/google-ssl-cert.gemspec +43 -0
- data/lib/google-ssl-cert.rb +1 -0
- data/lib/google_ssl_cert/autoloader.rb +22 -0
- data/lib/google_ssl_cert/base.rb +14 -0
- data/lib/google_ssl_cert/cert.rb +85 -0
- data/lib/google_ssl_cert/cli/base.rb +12 -0
- data/lib/google_ssl_cert/cli/create.rb +67 -0
- data/lib/google_ssl_cert/cli/help/completion.md +20 -0
- data/lib/google_ssl_cert/cli/help/completion_script.md +3 -0
- data/lib/google_ssl_cert/cli/help/create.md +31 -0
- data/lib/google_ssl_cert/cli/help/prune.md +30 -0
- data/lib/google_ssl_cert/cli/help/secret/get.md +4 -0
- data/lib/google_ssl_cert/cli/help/secret/save.md +4 -0
- data/lib/google_ssl_cert/cli/help.rb +11 -0
- data/lib/google_ssl_cert/cli/prune.rb +88 -0
- data/lib/google_ssl_cert/cli/secret.rb +15 -0
- data/lib/google_ssl_cert/cli.rb +62 -0
- data/lib/google_ssl_cert/command.rb +89 -0
- data/lib/google_ssl_cert/completer/script.rb +8 -0
- data/lib/google_ssl_cert/completer/script.sh +10 -0
- data/lib/google_ssl_cert/completer.rb +159 -0
- data/lib/google_ssl_cert/global.rb +12 -0
- data/lib/google_ssl_cert/google_services.rb +30 -0
- data/lib/google_ssl_cert/helpers/global.rb +7 -0
- data/lib/google_ssl_cert/helpers/project_number.rb +15 -0
- data/lib/google_ssl_cert/logger.rb +28 -0
- data/lib/google_ssl_cert/logging.rb +9 -0
- data/lib/google_ssl_cert/name.rb +19 -0
- data/lib/google_ssl_cert/secret.rb +86 -0
- data/lib/google_ssl_cert/version.rb +3 -0
- data/lib/google_ssl_cert.rb +13 -0
- data/spec/cli_spec.rb +26 -0
- data/spec/spec_helper.rb +29 -0
- metadata +272 -0
data/spec/cli_spec.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
describe GoogleSslCert::CLI do
|
2
|
+
before(:all) do
|
3
|
+
@args = "--from Tung"
|
4
|
+
end
|
5
|
+
|
6
|
+
describe "google-ssl-cert" do
|
7
|
+
it "hello" do
|
8
|
+
out = execute("exe/google-ssl-cert hello world #{@args}")
|
9
|
+
expect(out).to include("from: Tung\nHello world")
|
10
|
+
end
|
11
|
+
|
12
|
+
commands = {
|
13
|
+
"hell" => "hello",
|
14
|
+
"hello" => "name",
|
15
|
+
"hello -" => "--from",
|
16
|
+
"hello name" => "--from",
|
17
|
+
"hello name --" => "--from",
|
18
|
+
}
|
19
|
+
commands.each do |command, expected_word|
|
20
|
+
it "completion #{command}" do
|
21
|
+
out = execute("exe/google-ssl-cert completion #{command}")
|
22
|
+
expect(out).to include(expected_word) # only checking for one word for simplicity
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
ENV["GOOGLE_SSL_CERT_TEST"] = "1"
|
2
|
+
|
3
|
+
# CodeClimate test coverage: https://docs.codeclimate.com/docs/configuring-test-coverage
|
4
|
+
# require 'simplecov'
|
5
|
+
# SimpleCov.start
|
6
|
+
|
7
|
+
require "pp"
|
8
|
+
require "byebug"
|
9
|
+
root = File.expand_path("../", File.dirname(__FILE__))
|
10
|
+
require "#{root}/lib/google-ssl-cert"
|
11
|
+
|
12
|
+
module Helper
|
13
|
+
def execute(cmd)
|
14
|
+
puts "Running: #{cmd}" if show_command?
|
15
|
+
out = `#{cmd}`
|
16
|
+
puts out if show_command?
|
17
|
+
out
|
18
|
+
end
|
19
|
+
|
20
|
+
# Added SHOW_COMMAND because DEBUG is also used by other libraries like
|
21
|
+
# bundler and it shows its internal debugging logging also.
|
22
|
+
def show_command?
|
23
|
+
ENV['DEBUG'] || ENV['SHOW_COMMAND']
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
RSpec.configure do |c|
|
28
|
+
c.include Helper
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,272 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: google-ssl-cert
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Tung Nguyen
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-10-23 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: google-cloud-compute-v1
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: google-cloud-resource_manager
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: google-cloud-secret_manager
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: memoist
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rainbow
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: thor
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: zeitwerk
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: bundler
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: byebug
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: cli_markdown
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: rake
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: rspec
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - ">="
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - ">="
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
description:
|
196
|
+
email:
|
197
|
+
- tongueroo@gmail.com
|
198
|
+
executables:
|
199
|
+
- google-ssl-cert
|
200
|
+
extensions: []
|
201
|
+
extra_rdoc_files: []
|
202
|
+
files:
|
203
|
+
- ".gitignore"
|
204
|
+
- ".rspec"
|
205
|
+
- CHANGELOG.md
|
206
|
+
- Gemfile
|
207
|
+
- Guardfile
|
208
|
+
- LICENSE.txt
|
209
|
+
- README.md
|
210
|
+
- Rakefile
|
211
|
+
- docs/google-secrets-cheatsheet.md
|
212
|
+
- exe/google-ssl-cert
|
213
|
+
- google-ssl-cert.gemspec
|
214
|
+
- lib/google-ssl-cert.rb
|
215
|
+
- lib/google_ssl_cert.rb
|
216
|
+
- lib/google_ssl_cert/autoloader.rb
|
217
|
+
- lib/google_ssl_cert/base.rb
|
218
|
+
- lib/google_ssl_cert/cert.rb
|
219
|
+
- lib/google_ssl_cert/cli.rb
|
220
|
+
- lib/google_ssl_cert/cli/base.rb
|
221
|
+
- lib/google_ssl_cert/cli/create.rb
|
222
|
+
- lib/google_ssl_cert/cli/help.rb
|
223
|
+
- lib/google_ssl_cert/cli/help/completion.md
|
224
|
+
- lib/google_ssl_cert/cli/help/completion_script.md
|
225
|
+
- lib/google_ssl_cert/cli/help/create.md
|
226
|
+
- lib/google_ssl_cert/cli/help/prune.md
|
227
|
+
- lib/google_ssl_cert/cli/help/secret/get.md
|
228
|
+
- lib/google_ssl_cert/cli/help/secret/save.md
|
229
|
+
- lib/google_ssl_cert/cli/prune.rb
|
230
|
+
- lib/google_ssl_cert/cli/secret.rb
|
231
|
+
- lib/google_ssl_cert/command.rb
|
232
|
+
- lib/google_ssl_cert/completer.rb
|
233
|
+
- lib/google_ssl_cert/completer/script.rb
|
234
|
+
- lib/google_ssl_cert/completer/script.sh
|
235
|
+
- lib/google_ssl_cert/global.rb
|
236
|
+
- lib/google_ssl_cert/google_services.rb
|
237
|
+
- lib/google_ssl_cert/helpers/global.rb
|
238
|
+
- lib/google_ssl_cert/helpers/project_number.rb
|
239
|
+
- lib/google_ssl_cert/logger.rb
|
240
|
+
- lib/google_ssl_cert/logging.rb
|
241
|
+
- lib/google_ssl_cert/name.rb
|
242
|
+
- lib/google_ssl_cert/secret.rb
|
243
|
+
- lib/google_ssl_cert/version.rb
|
244
|
+
- spec/cli_spec.rb
|
245
|
+
- spec/spec_helper.rb
|
246
|
+
homepage: https://github.com/boltopspro/google-ssl-cert
|
247
|
+
licenses:
|
248
|
+
- Apache-2.0
|
249
|
+
metadata:
|
250
|
+
homepage_uri: https://github.com/boltopspro/google-ssl-cert
|
251
|
+
post_install_message:
|
252
|
+
rdoc_options: []
|
253
|
+
require_paths:
|
254
|
+
- lib
|
255
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
256
|
+
requirements:
|
257
|
+
- - ">="
|
258
|
+
- !ruby/object:Gem::Version
|
259
|
+
version: '0'
|
260
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - ">="
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '0'
|
265
|
+
requirements: []
|
266
|
+
rubygems_version: 3.1.6
|
267
|
+
signing_key:
|
268
|
+
specification_version: 4
|
269
|
+
summary: Google SSL Cert Tool
|
270
|
+
test_files:
|
271
|
+
- spec/cli_spec.rb
|
272
|
+
- spec/spec_helper.rb
|