conjur-cli 4.21.0 → 4.21.1
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/CHANGELOG.md +4 -0
- data/lib/conjur/command/bootstrap.rb +6 -6
- data/lib/conjur/command/init.rb +19 -9
- data/lib/conjur/version.rb +1 -1
- data/spec/command/init_spec.rb +1 -16
- data/spec/spec_helper.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 42c5699c45672978a67be3e037c53b212fb232d3
|
|
4
|
+
data.tar.gz: 4288dda53317d3fe79ea7d255d12cf21681a2abf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 48ef1a3766bcabca227c830c2801ded50ba83870e53d01e559a663fea813d078c42cb69c1316a227b000db10790ce8a2f91d1d31b98cf67002a83211e23d0e80
|
|
7
|
+
data.tar.gz: 43c0a98e20cc612567e74929856428dd7004615d5f33fb5c2176d7c0328fd6827c5ac87f4997be839f2f566593908deafdc8ccb898de4889bf2ba419633b3a7a
|
data/CHANGELOG.md
CHANGED
|
@@ -53,12 +53,12 @@ class Conjur::Command::Bootstrap < Conjur::Command
|
|
|
53
53
|
puts "Adminship granted"
|
|
54
54
|
end
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
if (attic = api.user("attic")).exists?
|
|
57
|
+
puts "User 'attic' exists"
|
|
58
|
+
else
|
|
59
|
+
puts "Creating user 'attic'"
|
|
60
|
+
attic = api.create_user("attic")
|
|
61
|
+
end
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
end
|
data/lib/conjur/command/init.rb
CHANGED
|
@@ -61,14 +61,6 @@ class Conjur::Command::Init < Conjur::Command
|
|
|
61
61
|
Conjur.configuration.core_url = "https://#{hostname}/api"
|
|
62
62
|
end
|
|
63
63
|
|
|
64
|
-
account = options[:account]
|
|
65
|
-
account ||= if hostname
|
|
66
|
-
account = Conjur::Core::API.info['account'] or raise "Expecting 'account' in Core info"
|
|
67
|
-
else
|
|
68
|
-
# using .to_s to overcome https://github.com/JEG2/highline/issues/69
|
|
69
|
-
highline.ask("Enter your organization account name: ").to_s
|
|
70
|
-
end
|
|
71
|
-
|
|
72
64
|
if (certificate = options[:certificate]).blank?
|
|
73
65
|
unless hostname.blank?
|
|
74
66
|
connect_hostname = if hostname.include?(':')
|
|
@@ -86,6 +78,16 @@ class Conjur::Command::Init < Conjur::Command
|
|
|
86
78
|
exit_now! "You decided not to trust the certificate" unless highline.ask("Trust this certificate (yes/no): ").strip == "yes"
|
|
87
79
|
end
|
|
88
80
|
end
|
|
81
|
+
|
|
82
|
+
configure_cert_store certificate
|
|
83
|
+
|
|
84
|
+
account = options[:account]
|
|
85
|
+
account ||= if hostname
|
|
86
|
+
account = Conjur::Core::API.info['account'] or raise "Expecting 'account' in Core info"
|
|
87
|
+
else
|
|
88
|
+
# using .to_s to overcome https://github.com/JEG2/highline/issues/69
|
|
89
|
+
highline.ask("Enter your organization account name: ").to_s
|
|
90
|
+
end
|
|
89
91
|
|
|
90
92
|
exit_now! "account is required" if account.blank?
|
|
91
93
|
|
|
@@ -120,7 +122,15 @@ class Conjur::Command::Init < Conjur::Command
|
|
|
120
122
|
puts "Wrote configuration to #{config_file}"
|
|
121
123
|
end
|
|
122
124
|
end
|
|
123
|
-
|
|
125
|
+
|
|
126
|
+
def self.configure_cert_store certificate
|
|
127
|
+
unless certificate.blank?
|
|
128
|
+
cert_file = Tempfile.new("conjur_cert")
|
|
129
|
+
File.write cert_file.path, certificate
|
|
130
|
+
OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE.add_file cert_file.path
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
124
134
|
def self.get_certificate connect_hostname
|
|
125
135
|
include OpenSSL::SSL
|
|
126
136
|
host, port = connect_hostname.split ':'
|
data/lib/conjur/version.rb
CHANGED
data/spec/command/init_spec.rb
CHANGED
|
@@ -83,25 +83,10 @@ describe Conjur::Command::Init do
|
|
|
83
83
|
end
|
|
84
84
|
end
|
|
85
85
|
|
|
86
|
-
# KEG: These tests have a nasty habit of hanging
|
|
87
|
-
# describe_command 'init -a the-account -h google.com' do
|
|
88
|
-
# it "writes the config and cert" do
|
|
89
|
-
# HighLine.any_instance.stub(:ask).and_return "yes"
|
|
90
|
-
# File.should_receive(:open).twice
|
|
91
|
-
# invoke
|
|
92
|
-
# end
|
|
93
|
-
# end
|
|
94
|
-
# describe_command 'init -a the-account -h https://google.com' do
|
|
95
|
-
# it "writes the config and cert" do
|
|
96
|
-
# HighLine.any_instance.stub(:ask).and_return "yes"
|
|
97
|
-
# File.should_receive(:open).twice
|
|
98
|
-
# invoke
|
|
99
|
-
# end
|
|
100
|
-
# end
|
|
101
|
-
|
|
102
86
|
describe_command 'init -a the-account -h localhost -c the-cert' do
|
|
103
87
|
it "writes config and cert files" do
|
|
104
88
|
expect(File).to receive(:open).twice
|
|
89
|
+
expect(Conjur::Command::Init).to receive(:configure_cert_store).with "the-cert"
|
|
105
90
|
invoke
|
|
106
91
|
end
|
|
107
92
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: conjur-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.21.
|
|
4
|
+
version: 4.21.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rafal Rzepecki
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2015-04-
|
|
12
|
+
date: 2015-04-13 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: activesupport
|