digicert-cli 0.1.0 → 0.2.0

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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.hound.yml +3 -0
  3. data/.rubocop.yml +637 -0
  4. data/.travis.yml +0 -1
  5. data/Gemfile +0 -2
  6. data/LICENSE.txt +21 -0
  7. data/README.md +218 -21
  8. data/bin/digicert +1 -2
  9. data/digicert-cli.gemspec +3 -12
  10. data/lib/digicert/cli.rb +33 -9
  11. data/lib/digicert/cli/auth.rb +6 -3
  12. data/lib/digicert/cli/base.rb +19 -0
  13. data/lib/digicert/cli/certificate.rb +75 -0
  14. data/lib/digicert/cli/certificate_downloader.rb +51 -0
  15. data/lib/digicert/cli/command.rb +14 -48
  16. data/lib/digicert/cli/commands/certificate.rb +37 -0
  17. data/lib/digicert/cli/commands/csr.rb +31 -0
  18. data/lib/digicert/cli/commands/order.rb +45 -0
  19. data/lib/digicert/cli/csr.rb +48 -0
  20. data/lib/digicert/cli/filter_builder.rb +54 -0
  21. data/lib/digicert/cli/order.rb +9 -23
  22. data/lib/digicert/cli/order_reissuer.rb +60 -11
  23. data/lib/digicert/cli/order_retriever.rb +48 -0
  24. data/lib/digicert/cli/rcfile.rb +48 -0
  25. data/lib/digicert/cli/util.rb +5 -1
  26. data/lib/digicert/cli/version.rb +23 -1
  27. data/spec/acceptance/certificate_spec.rb +66 -0
  28. data/spec/acceptance/config_spec.rb +16 -0
  29. data/spec/acceptance/csr_spec.rb +51 -0
  30. data/spec/acceptance/order_spec.rb +6 -21
  31. data/spec/acceptance/reissuing_order_spec.rb +33 -0
  32. data/spec/digicert/cli/certificate_downloader_spec.rb +30 -0
  33. data/spec/digicert/cli/certificate_spec.rb +104 -0
  34. data/spec/digicert/cli/csr_spec.rb +47 -0
  35. data/spec/digicert/cli/filter_builder_spec.rb +25 -0
  36. data/spec/digicert/cli/order_reissuer_spec.rb +74 -0
  37. data/spec/digicert/cli/order_retriever_spec.rb +23 -0
  38. data/spec/digicert/{order_spec.rb → cli/order_spec.rb} +2 -2
  39. data/spec/digicert/cli/rcfile_spec.rb +18 -0
  40. data/spec/digicert/cli_spec.rb +6 -5
  41. data/spec/fixtures/.digicertrc +2 -0
  42. data/spec/fixtures/rsa4096.csr +51 -0
  43. data/spec/fixtures/rsa4096.key +51 -0
  44. data/spec/spec_helper.rb +8 -1
  45. data/spec/support/disable-logging.rb +12 -0
  46. metadata +70 -22
  47. data/.sample.env +0 -1
  48. data/bin/console +0 -14
  49. data/legacy_cli.sh +0 -301
  50. data/lib/digicert/cli/command/order.rb +0 -50
  51. data/lib/digicert/cli/order_filterer.rb +0 -43
  52. data/spec/digicert/command_spec.rb +0 -16
  53. data/spec/digicert/order_filterer_spec.rb +0 -50
  54. data/spec/digicert/order_reissuer_spec.rb +0 -19
@@ -0,0 +1,47 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe Digicert::CLI::CSR do
4
+ describe "#fetch" do
5
+ it "fetches the csr for an existing order" do
6
+ order_id = 123456
7
+ stub_digicert_order_fetch_api(order_id)
8
+
9
+ csr = Digicert::CLI::CSR.new(order_id: order_id).fetch
10
+
11
+ expect(csr).not_to be_nil
12
+ expect(csr).to eq("------ [CSR HERE] ------")
13
+ end
14
+ end
15
+
16
+ describe "#generate" do
17
+ context "with existing order details" do
18
+ it "generates a new csr for an existing order" do
19
+ order_id = 123456
20
+ key_file = "./spec/fixtures/rsa4096.key"
21
+ stub_digicert_order_fetch_api(order_id)
22
+
23
+ csr = Digicert::CLI::CSR.new(order_id: order_id, key: key_file).generate
24
+
25
+ expect(csr.start_with?("-----BEGIN CERTIFICATE REQUEST")).to be_truthy
26
+ expect(csr.end_with?("--END CERTIFICATE REQUEST-----\n")).to be_truthy
27
+ end
28
+ end
29
+
30
+ context "with custom details" do
31
+ it "generates a new csr using the provided details" do
32
+ order_id = 123456
33
+ common_name = "ribosetest.com"
34
+ key_file = "./spec/fixtures/rsa4096.key"
35
+ san = ["site1.ribosetest.com", "site2.ribosetest.com"]
36
+ stub_digicert_order_fetch_api(order_id)
37
+
38
+ csr = Digicert::CLI::CSR.new(
39
+ order_id: order_id, common_name: common_name, san: san, key: key_file,
40
+ ).generate
41
+
42
+ expect(csr.start_with?("-----BEGIN CERTIFICATE REQUEST")).to be_truthy
43
+ expect(csr.end_with?("--END CERTIFICATE REQUEST-----\n")).to be_truthy
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,25 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe Digicert::CLI::FilterBuilder do
4
+ describe ".build" do
5
+ context "normal filter options" do
6
+ it "builds filters only with valid attributes" do
7
+ options = { status: "pending", invalid: "invalid", search: "" }
8
+ filters = Digicert::CLI::FilterBuilder.build(options)
9
+
10
+ expect(filters).to eq("status" => "pending")
11
+ end
12
+ end
13
+
14
+ context "filter values as an array" do
15
+ it "builds the valid filters properly" do
16
+ options = { status: "pending,active", search: "s" }
17
+ filters = Digicert::CLI::FilterBuilder.build(options)
18
+
19
+ expect(filters).to eq(
20
+ "status" => { "0" => "pending", "1" => "active" }, "search" => "s",
21
+ )
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,74 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe Digicert::CLI::OrderReissuer do
4
+ describe "#create" do
5
+ context "with only order id passed" do
6
+ it "sends create message to digicert order reissuer" do
7
+ order_id = 123_456
8
+ allow(Digicert::OrderReissuer).to receive(:create)
9
+
10
+ Digicert::CLI::OrderReissuer.new(order_id: order_id).create
11
+
12
+ expect(
13
+ Digicert::OrderReissuer,
14
+ ).to have_received(:create).with(order_id: order_id)
15
+ end
16
+ end
17
+
18
+ context "with order id and new csr" do
19
+ it "sends create message to reissuer with new details" do
20
+ order_id = 123_456
21
+ csr_file = "./spec/fixtures/rsa4096.csr"
22
+ allow(Digicert::OrderReissuer).to receive(:create)
23
+
24
+ Digicert::CLI::OrderReissuer.new(
25
+ order_id: order_id, crt: csr_file,
26
+ ).create
27
+
28
+ expect(Digicert::OrderReissuer).to have_received(:create).with(
29
+ order_id: order_id, certificate: { csr: File.read(csr_file) },
30
+ )
31
+ end
32
+ end
33
+
34
+ context "with order id and --fetch option" do
35
+ it "reissue order and fetch the updated order" do
36
+ order_id = 456_789
37
+
38
+ mock_order_fetch_and_download_requests(order)
39
+ stub_digicert_order_reissue_api(order_id, order_attributes(order))
40
+ allow(Digicert::CLI::CertificateDownloader).to receive(:download)
41
+
42
+ Digicert::CLI::OrderReissuer.create(
43
+ order_id: order_id, output: "/tmp", number_of_times: 1, wait_time: 1,
44
+ )
45
+
46
+ expect(Digicert::CLI::CertificateDownloader).
47
+ to have_received(:download).
48
+ with(hash_including(certificate_id: order.certificate.id))
49
+ end
50
+ end
51
+ end
52
+
53
+ def mock_order_fetch_and_download_requests(order)
54
+ allow(Digicert::Order).to receive(:fetch).and_return(order)
55
+ allow(Digicert::CLI::OrderRetriever).to receive(:fetch).and_return(order)
56
+ end
57
+
58
+ def order(order_id = 123_456)
59
+ stub_digicert_order_fetch_api(order_id)
60
+ @order ||= Digicert::Order.fetch(order_id)
61
+ end
62
+
63
+ def order_attributes(order)
64
+ {
65
+ certificate: {
66
+ common_name: order.certificate.common_name,
67
+ dns_names: order.certificate.dns_names,
68
+ csr: order.certificate.csr,
69
+ signature_hash: order.certificate.signature_hash,
70
+ server_platform: { id: 45 },
71
+ },
72
+ }
73
+ end
74
+ end
@@ -0,0 +1,23 @@
1
+ require "spec_helper"
2
+ require "digicert/cli/order_retriever"
3
+
4
+ RSpec.describe Digicert::CLI::OrderRetriever do
5
+ describe ".fetch" do
6
+ context "with number_of_times option specfied" do
7
+ it "tries to retrieve the order by specfied number of times" do
8
+ allow(Digicert::Order).to receive(:fetch).and_return(order)
9
+
10
+ Digicert::CLI::OrderRetriever.fetch(
11
+ order.id, number_of_times: 2, wait_time: 1
12
+ )
13
+
14
+ expect(Digicert::Order).to have_received(:fetch).twice
15
+ end
16
+ end
17
+ end
18
+
19
+ def order(order_id = 123_456)
20
+ stub_digicert_order_fetch_api(order_id)
21
+ @order ||= Digicert::Order.fetch(order_id)
22
+ end
23
+ end
@@ -32,8 +32,8 @@ RSpec.describe Digicert::CLI::Order do
32
32
  common_name = "digicert.com"
33
33
  stub_digicert_order_list_api
34
34
 
35
- order_id= Digicert::CLI::Order.new(
36
- common_name: common_name, quiet: true
35
+ order_id = Digicert::CLI::Order.new(
36
+ common_name: common_name, quiet: true,
37
37
  ).find
38
38
 
39
39
  expect(order_id).to be_a(Integer)
@@ -0,0 +1,18 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe Digicert::CLI::RCFile do
4
+ describe ".set_key" do
5
+ it "writes the api key to the configuration file" do
6
+ secret_api_key = "super_secret_key"
7
+ allow(File).to receive(:expand_path).and_return(fixtures_path)
8
+
9
+ Digicert::CLI::RCFile.set_key(secret_api_key)
10
+
11
+ expect(Digicert::CLI::RCFile.api_key).to eq(secret_api_key)
12
+ end
13
+ end
14
+
15
+ def fixtures_path
16
+ File.expand_path("../../../fixtures", __FILE__)
17
+ end
18
+ end
@@ -2,14 +2,15 @@ require "spec_helper"
2
2
 
3
3
  RSpec.describe Digicert::CLI do
4
4
  describe ".start" do
5
- it "sends run message to command handler" do
5
+ it "sends start message to command handler" do
6
6
  shell_command = %w(order find -n order_id)
7
- allow(Digicert::CLI::Command).to receive(:run)
7
+ allow(Digicert::CLI::Command).to receive(:start)
8
8
 
9
- Digicert::CLI.start(*shell_command)
9
+ Digicert::CLI.start(shell_command)
10
10
 
11
- expect(Digicert::CLI::Command).to have_received(:run).
12
- with(shell_command.shift, shell_command.shift, shell_command)
11
+ expect(
12
+ Digicert::CLI::Command,
13
+ ).to have_received(:start).with(shell_command)
13
14
  end
14
15
  end
15
16
  end
@@ -0,0 +1,2 @@
1
+ ---
2
+ :api_key: super_secret_key
@@ -0,0 +1,51 @@
1
+ -----BEGIN RSA PRIVATE KEY-----
2
+ MIIJKgIBAAKCAgEA519E1L4i5v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HpTkWu4MZgDU7oX86
46
+ tkdVtM8SIoBodlwyfG+bOWYebyNi3044y8VEK7Jrt+koIS4tz9rP7u2dDGfGSGTq
47
+ DwKue6Iyv2zbozL+a0Ojf5hK+nErqB9map3qVljf1RgR72WYcQORNVeYk0eyUc6x
48
+ jTzepiWrA5KjyiGIRoRtABmHiT2L//sJ/4PiZ0Rq42rlo0lylBCB8wVLqC64RR8l
49
+ /Yi8yfHggUtNnIiXzWJYAJtgn5DC5LZEcyjLmI0EUOIv66MuZmlyvl+nt6U/+Z/B
50
+ x28HsgOJm/ybHlEZ6sUzLX/T2qeLWbII05IqFs4YLMKqPUpvL9JOC2D2hI3ylA==
51
+ -----END RSA PRIVATE KEY-----
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,9 @@
1
1
  require "webmock/rspec"
2
- require "bundler/setup"
3
2
  require "digicert/cli"
4
3
  require "digicert/rspec"
5
4
 
5
+ Dir["./spec/support/**/*.rb"].sort.each { |file| require file }
6
+
6
7
  RSpec.configure do |config|
7
8
  # Enable flags like --only-failures and --next-failure
8
9
  config.example_status_persistence_file_path = ".rspec_status"
@@ -10,4 +11,10 @@ RSpec.configure do |config|
10
11
  config.expect_with :rspec do |c|
11
12
  c.syntax = :expect
12
13
  end
14
+
15
+ config.before :all do
16
+ Digicert.configure do |digicert_config|
17
+ digicert_config.api_key = ENV["DIGICERT_API_KEY"] || "SECRET_KEY"
18
+ end
19
+ end
13
20
  end
@@ -0,0 +1,12 @@
1
+ module Digicert
2
+ module CLI
3
+ module Util
4
+ # In the test console, printing process related messages creates
5
+ # some unnecessary noices, this module method will temporarily
6
+ # disabled those extra noices from the log.
7
+ #
8
+ def self.say(_message)
9
+ end
10
+ end
11
+ end
12
+ end
metadata CHANGED
@@ -1,57 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: digicert-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-20 00:00:00.000000000 Z
11
+ date: 2017-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: terminal-table
14
+ name: thor
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: 0.19.4
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: 0.19.4
27
27
  - !ruby/object:Gem::Dependency
28
- name: bundler
28
+ name: digicert
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.14'
34
- type: :development
33
+ version: 0.1.2
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.14'
40
+ version: 0.1.2
41
+ - !ruby/object:Gem::Dependency
42
+ name: openssl
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 2.0.3
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 2.0.3
41
55
  - !ruby/object:Gem::Dependency
42
- name: dotenv
56
+ name: terminal-table
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
59
  - - ">="
46
60
  - !ruby/object:Gem::Version
47
61
  version: '0'
48
- type: :development
62
+ type: :runtime
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
66
  - - ">="
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.14'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.14'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: rake
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -103,33 +131,53 @@ extensions: []
103
131
  extra_rdoc_files: []
104
132
  files:
105
133
  - ".gitignore"
106
- - ".sample.env"
134
+ - ".hound.yml"
135
+ - ".rubocop.yml"
107
136
  - ".travis.yml"
108
137
  - Gemfile
138
+ - LICENSE.txt
109
139
  - README.md
110
140
  - Rakefile
111
- - bin/console
112
141
  - bin/digicert
113
142
  - bin/rspec
114
143
  - bin/setup
115
144
  - digicert-cli.gemspec
116
- - legacy_cli.sh
117
145
  - lib/digicert/cli.rb
118
146
  - lib/digicert/cli/auth.rb
147
+ - lib/digicert/cli/base.rb
148
+ - lib/digicert/cli/certificate.rb
149
+ - lib/digicert/cli/certificate_downloader.rb
119
150
  - lib/digicert/cli/command.rb
120
- - lib/digicert/cli/command/order.rb
151
+ - lib/digicert/cli/commands/certificate.rb
152
+ - lib/digicert/cli/commands/csr.rb
153
+ - lib/digicert/cli/commands/order.rb
154
+ - lib/digicert/cli/csr.rb
155
+ - lib/digicert/cli/filter_builder.rb
121
156
  - lib/digicert/cli/order.rb
122
- - lib/digicert/cli/order_filterer.rb
123
157
  - lib/digicert/cli/order_reissuer.rb
158
+ - lib/digicert/cli/order_retriever.rb
159
+ - lib/digicert/cli/rcfile.rb
124
160
  - lib/digicert/cli/util.rb
125
161
  - lib/digicert/cli/version.rb
162
+ - spec/acceptance/certificate_spec.rb
163
+ - spec/acceptance/config_spec.rb
164
+ - spec/acceptance/csr_spec.rb
126
165
  - spec/acceptance/order_spec.rb
166
+ - spec/acceptance/reissuing_order_spec.rb
167
+ - spec/digicert/cli/certificate_downloader_spec.rb
168
+ - spec/digicert/cli/certificate_spec.rb
169
+ - spec/digicert/cli/csr_spec.rb
170
+ - spec/digicert/cli/filter_builder_spec.rb
171
+ - spec/digicert/cli/order_reissuer_spec.rb
172
+ - spec/digicert/cli/order_retriever_spec.rb
173
+ - spec/digicert/cli/order_spec.rb
174
+ - spec/digicert/cli/rcfile_spec.rb
127
175
  - spec/digicert/cli_spec.rb
128
- - spec/digicert/command_spec.rb
129
- - spec/digicert/order_filterer_spec.rb
130
- - spec/digicert/order_reissuer_spec.rb
131
- - spec/digicert/order_spec.rb
176
+ - spec/fixtures/.digicertrc
177
+ - spec/fixtures/rsa4096.csr
178
+ - spec/fixtures/rsa4096.key
132
179
  - spec/spec_helper.rb
180
+ - spec/support/disable-logging.rb
133
181
  homepage: https://www.ribose.com
134
182
  licenses: []
135
183
  metadata: {}