conjur-cli 6.2.1 → 6.2.5
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/.github/CODEOWNERS +10 -0
- data/.github/ISSUE_TEMPLATE/bug.md +42 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +27 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +21 -0
- data/.gitleaks.toml +216 -0
- data/CHANGELOG.md +63 -22
- data/CONTRIBUTING.md +81 -0
- data/Gemfile +1 -1
- data/Jenkinsfile +69 -18
- data/LICENSE +202 -0
- data/NOTICES.txt +421 -0
- data/README.md +278 -48
- data/SECURITY.md +42 -0
- data/VERSION +1 -1
- data/bin/parse-changelog.sh +12 -0
- data/build-standalone +42 -3
- data/ci/submit-coverage +36 -0
- data/ci/test.sh +1 -1
- data/conjur-cli.gemspec +15 -12
- data/docker-compose.yml +2 -1
- data/features/step_definitions/authn_steps.rb +1 -1
- data/features/support/env.rb +3 -1
- data/jenkins.sh +1 -1
- data/lib/conjur/command/hosts.rb +1 -1
- data/lib/conjur/command/rspec/describe_command.rb +26 -7
- data/lib/conjur/command/rspec/mock_services.rb +7 -1
- data/lib/conjur/command/users.rb +5 -1
- data/lib/conjur/version.rb +1 -1
- data/push-image +46 -28
- data/spec/authn_spec.rb +4 -4
- data/spec/command/authn_spec.rb +2 -2
- data/spec/command/hosts_spec.rb +26 -3
- data/spec/command/init_spec.rb +28 -41
- data/spec/command/users_spec.rb +18 -2
- data/spec/spec_helper.rb +5 -2
- data/test.sh +1 -1
- metadata +74 -60
- data/LICENSE.md +0 -195
|
@@ -5,15 +5,34 @@ RSpec::Core::DSL.change_global_dsl do
|
|
|
5
5
|
|
|
6
6
|
before do
|
|
7
7
|
allow(cert_store).to receive(:add_file)
|
|
8
|
+
# Stub the constant OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE which is
|
|
9
|
+
# implicitly used in many places in the CLI and in conjur-api-ruby as the de facto
|
|
10
|
+
# cert store.
|
|
8
11
|
stub_const 'OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE', cert_store
|
|
12
|
+
|
|
13
|
+
# Reset the rest_client_options defaults to avoid using expired rspec doubles.
|
|
14
|
+
#
|
|
15
|
+
# Conjur.configuration is a lazy-loaded singleton. There is single CLI instance
|
|
16
|
+
# shared across this test suite. When Conjur.configuration is loaded for the first
|
|
17
|
+
# time it assumes the defaults value for Conjur.configuration.rest_client_options
|
|
18
|
+
# of:
|
|
19
|
+
# {
|
|
20
|
+
# :ssl_cert_store => OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE
|
|
21
|
+
# }
|
|
22
|
+
#
|
|
23
|
+
# Notice above that each test case stubs the constant
|
|
24
|
+
# OpenSSL::SSL::SSLContext::DEFAULT_CERT_STORE with a double. Without further
|
|
25
|
+
# modification this means the first time the CLI is run and Conjur.configuration
|
|
26
|
+
# is loaded Conjur.configuration.rest_client_options[:ssl_cert_store] it is set to
|
|
27
|
+
# the double associated with the test case at that point in time. Since
|
|
28
|
+
# Conjur.configuration is only loaded once, without modification, that double will
|
|
29
|
+
# be retained and its usage will result in a RSpec::Mocks::ExpiredTestDoubleError.
|
|
30
|
+
# To avoid this for each test case we must reset
|
|
31
|
+
# Conjur.configuration.rest_client_options[:ssl_cert_store] with the double for
|
|
32
|
+
# the current test case.
|
|
33
|
+
Conjur.configuration.rest_client_options[:ssl_cert_store] = cert_store
|
|
9
34
|
end
|
|
10
|
-
|
|
11
|
-
let(:cert_store_options) do
|
|
12
|
-
{
|
|
13
|
-
ssl_cert_store: cert_store
|
|
14
|
-
}
|
|
15
|
-
end
|
|
16
|
-
|
|
35
|
+
|
|
17
36
|
let(:invoke) do
|
|
18
37
|
Conjur::CLI.error_device = $stderr
|
|
19
38
|
# TODO: allow proper handling of description like "audit:send 'hello world'"
|
|
@@ -29,7 +29,13 @@ end
|
|
|
29
29
|
shared_context "when logged in", logged_in: true do
|
|
30
30
|
include_context "with mock authn"
|
|
31
31
|
before do
|
|
32
|
-
allow(api).to receive(:credentials)
|
|
32
|
+
allow(api).to receive(:credentials) do
|
|
33
|
+
{
|
|
34
|
+
:username => 'dknuth',
|
|
35
|
+
:headers => { :authorization => "fakeauth" },
|
|
36
|
+
}
|
|
37
|
+
end
|
|
38
|
+
|
|
33
39
|
netrc[authn_host] = [username, api_key]
|
|
34
40
|
allow(Conjur::Command).to receive_messages api: api
|
|
35
41
|
end
|
data/lib/conjur/command/users.rb
CHANGED
|
@@ -47,7 +47,11 @@ class Conjur::Command::Users < Conjur::Command
|
|
|
47
47
|
if api.username == options[:user]
|
|
48
48
|
exit_now! 'To rotate the API key of the currently logged-in user, use this command without any flags or options'
|
|
49
49
|
end
|
|
50
|
-
|
|
50
|
+
user_resource_id = [Conjur.configuration.account, "user", options[:user]].join(":")
|
|
51
|
+
unless api.resource(user_resource_id).exists?
|
|
52
|
+
exit_now! "User '#{options[:user]}' not found"
|
|
53
|
+
end
|
|
54
|
+
puts api.resource(user_resource_id).rotate_api_key
|
|
51
55
|
else
|
|
52
56
|
username, password = Conjur::Authn.read_credentials
|
|
53
57
|
new_api_key = Conjur::API.rotate_api_key username, password
|
data/lib/conjur/version.rb
CHANGED
data/push-image
CHANGED
|
@@ -1,28 +1,46 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
readonly REGISTRY="cyberark"
|
|
6
|
+
readonly INTERNAL_REGISTRY="registry2.itci.conjur.net"
|
|
7
|
+
readonly VERSION="$(cat VERSION)"
|
|
8
|
+
readonly VERSION_TAG="5-${VERSION}"
|
|
9
|
+
readonly image_name="conjur-cli"
|
|
10
|
+
readonly full_image_name="${REGISTRY}/${image_name}:latest"
|
|
11
|
+
|
|
12
|
+
readonly TAGS=(
|
|
13
|
+
"5"
|
|
14
|
+
"5-latest"
|
|
15
|
+
"$VERSION_TAG"
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
# fetching tags is required for git_description to work
|
|
19
|
+
git fetch --tags
|
|
20
|
+
git_description=$(git describe)
|
|
21
|
+
|
|
22
|
+
# if it’s not a tagged commit, VERSION will have extra junk (i.e. -g666c4b2), so we won’t publish that commit
|
|
23
|
+
# only when tag matches the VERSION, push VERSION and latest releases
|
|
24
|
+
# and x and x.y releases
|
|
25
|
+
#Ex: v5-6.2.1
|
|
26
|
+
if [ "${git_description}" = "v${VERSION}" ]; then
|
|
27
|
+
echo "Revision ${git_description} matches version ${VERSION} exactly. Pushing to Dockerhub..."
|
|
28
|
+
|
|
29
|
+
for tag in "${TAGS[@]}"; do
|
|
30
|
+
echo "Tagging and pushing ${REGISTRY}/${image_name}:${tag}"
|
|
31
|
+
|
|
32
|
+
# push to dockerhub
|
|
33
|
+
docker tag "${full_image_name}" "${REGISTRY}/${image_name}:${tag}"
|
|
34
|
+
docker push "${REGISTRY}/${image_name}:${tag}"
|
|
35
|
+
|
|
36
|
+
# push to internal registry
|
|
37
|
+
# necessary because some cyberark teams/networks can't pull from dockerhub
|
|
38
|
+
docker tag "${full_image_name}" "${INTERNAL_REGISTRY}/${image_name}:${tag}"
|
|
39
|
+
docker push "${INTERNAL_REGISTRY}/${image_name}:${tag}"
|
|
40
|
+
|
|
41
|
+
done
|
|
42
|
+
|
|
43
|
+
# push to legacy `conjurinc/cli5` tag
|
|
44
|
+
docker tag "${full_image_name}" conjurinc/cli5:latest
|
|
45
|
+
docker push conjurinc/cli5:latest
|
|
46
|
+
fi
|
data/spec/authn_spec.rb
CHANGED
|
@@ -37,11 +37,11 @@ describe Conjur::Authn do
|
|
|
37
37
|
allow(ENV).to receive(:[]).with("CONJUR_AUTHN_LOGIN").and_return "the-login"
|
|
38
38
|
allow(ENV).to receive(:[]).with("CONJUR_AUTHN_API_KEY").and_return "the-api-key"
|
|
39
39
|
end
|
|
40
|
-
|
|
40
|
+
|
|
41
41
|
context "login and API key" do
|
|
42
42
|
it "are used to authn" do
|
|
43
43
|
expect(Conjur::Authn.get_credentials).to eq([ "the-login", "the-api-key" ])
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
expect(api.username).to eq('the-login')
|
|
46
46
|
expect(api.api_key).to eq('the-api-key')
|
|
47
47
|
end
|
|
@@ -94,7 +94,7 @@ describe Conjur::Authn do
|
|
|
94
94
|
before do
|
|
95
95
|
allow(Conjur::Config).to receive(:[]).with(:netrc_path).and_return path
|
|
96
96
|
end
|
|
97
|
-
|
|
97
|
+
|
|
98
98
|
context "with specified netrc_path" do
|
|
99
99
|
let(:path) { "/a/dummy/netrc/path" }
|
|
100
100
|
it "consults Conjur::Config for netrc_path" do
|
|
@@ -102,7 +102,7 @@ describe Conjur::Authn do
|
|
|
102
102
|
expect(Conjur::Authn.netrc).to eq(netrc)
|
|
103
103
|
end
|
|
104
104
|
end
|
|
105
|
-
|
|
105
|
+
|
|
106
106
|
context "without specified netrc_path" do
|
|
107
107
|
let(:path) { nil }
|
|
108
108
|
it "uses default netrc path" do
|
data/spec/command/authn_spec.rb
CHANGED
|
@@ -10,14 +10,14 @@ describe Conjur::Command::Authn do
|
|
|
10
10
|
describe_command "#{cmd}" do
|
|
11
11
|
it "prompts for username and password and logs in the user" do
|
|
12
12
|
expect(Conjur::Authn).to receive(:ask_for_credentials).with({}).and_return [ "the-user", "the-api-key" ]
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
expect { invoke }.to write("Logged in")
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
describe_command "#{cmd} -u the-user" do
|
|
18
18
|
it "prompts for password and logs in the user" do
|
|
19
19
|
expect(Conjur::Authn).to receive(:ask_for_credentials).with({username: 'the-user'}).and_return [ "the-user", "the-api-key" ]
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
expect { invoke }.to write("Logged in")
|
|
22
22
|
end
|
|
23
23
|
end
|
data/spec/command/hosts_spec.rb
CHANGED
|
@@ -9,13 +9,21 @@ describe Conjur::Command::Hosts, logged_in: true do
|
|
|
9
9
|
expect(RestClient::Request).to receive(:execute).with({
|
|
10
10
|
method: :head,
|
|
11
11
|
url: "https://core.example.com/api/resources/#{account}/host/redis001",
|
|
12
|
-
headers: {
|
|
12
|
+
headers: {
|
|
13
|
+
authorization: "fakeauth",
|
|
14
|
+
},
|
|
15
|
+
username: "dknuth",
|
|
16
|
+
ssl_cert_store: cert_store
|
|
13
17
|
}).and_return true
|
|
14
18
|
expect(RestClient::Request).to receive(:execute).with({
|
|
15
19
|
method: :put,
|
|
16
20
|
url: "https://core.example.com/api/authn/#{account}/api_key?role=#{account}:host:redis001",
|
|
17
|
-
headers: {
|
|
18
|
-
|
|
21
|
+
headers: {
|
|
22
|
+
authorization: "fakeauth",
|
|
23
|
+
},
|
|
24
|
+
payload: '',
|
|
25
|
+
username: "dknuth",
|
|
26
|
+
ssl_cert_store: cert_store
|
|
19
27
|
}).and_return double(:response, body: 'new api key')
|
|
20
28
|
end
|
|
21
29
|
|
|
@@ -23,5 +31,20 @@ describe Conjur::Command::Hosts, logged_in: true do
|
|
|
23
31
|
invoke
|
|
24
32
|
end
|
|
25
33
|
end
|
|
34
|
+
|
|
35
|
+
describe_command 'host rotate_api_key --host non-existing' do
|
|
36
|
+
before do
|
|
37
|
+
expect(RestClient::Request).to receive(:execute).with({
|
|
38
|
+
method: :head,
|
|
39
|
+
url: "https://core.example.com/api/resources/#{account}/host/non-existing",
|
|
40
|
+
headers: {authorization: "fakeauth"},
|
|
41
|
+
username: username,
|
|
42
|
+
ssl_cert_store: cert_store
|
|
43
|
+
}).and_raise RestClient::ResourceNotFound
|
|
44
|
+
end
|
|
45
|
+
it 'rotate_api_key with non-existing --host option' do
|
|
46
|
+
expect { invoke }.to raise_error(GLI::CustomExit, /Host 'non-existing' not found/i)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
26
49
|
end
|
|
27
50
|
end
|
data/spec/command/init_spec.rb
CHANGED
|
@@ -1,49 +1,36 @@
|
|
|
1
1
|
require 'spec_helper'
|
|
2
2
|
require 'highline'
|
|
3
3
|
|
|
4
|
-
GITHUB_FP = "SHA1 Fingerprint=
|
|
4
|
+
GITHUB_FP = "SHA1 Fingerprint=84:63:B3:A9:29:12:CC:FD:1D:31:47:05:98:9B:EC:13:99:37:D0:D7"
|
|
5
5
|
GITHUB_CERT = <<EOF
|
|
6
6
|
-----BEGIN CERTIFICATE-----
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
Wnsu/m4BEC2+dIcvSykZYgIgCP5gGv6yzaazxBK2NwGdmmyuEFNSg2pARbMJlUFg
|
|
35
|
-
U5UAdgBWFAaaL9fC7NP14b1Esj7HRna5vJkRXMDvlJhV1onQ3QAAAWNBYm0tAAAE
|
|
36
|
-
AwBHMEUCIQCi7omUvYLm0b2LobtEeRAYnlIo7n6JxbYdrtYdmPUWJQIgVgw1AZ51
|
|
37
|
-
vK9ENinBg22FPxb82TvNDO05T17hxXRC2IYAdgC72d+8H4pxtZOUI5eqkntHOFeV
|
|
38
|
-
CqtS6B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l5vvCeOTkh8FZzn2Old+W+V32cYAr4+U1dJlwlXceEAAABeGq/vRoA
|
|
28
|
+
AAQDAEcwRQIhAJ7miER//DRFnDJNn6uUhgau3WMt4vVfY5dGigulOdjXAiBIVCfR
|
|
29
|
+
xjK1v4F31+sVaKzyyO7JAa0fzDQM7skQckSYWQB3ACJFRQdZVSRWlj+hL/H3bYbg
|
|
30
|
+
IyZjrcBLf13Gg1xu4g8CAAABeGq/vTkAAAQDAEgwRgIhAJgAEkoJQRivBlwo7x67
|
|
31
|
+
3oVsf1ip096WshZqmRCuL/JpAiEA3cX4rb3waLDLq4C48NSoUmcw56PwO/m2uwnQ
|
|
32
|
+
prb+yh0wCgYIKoZIzj0EAwIDRwAwRAIgK+Kv7G+/KkWkNZg3PcQFp866Z7G6soxo
|
|
33
|
+
a4etSZ+SRlYCIBSiXS20Wc+yjD111nPzvQUCfsP4+DKZ3K+2GKsERD6d
|
|
47
34
|
EOF
|
|
48
35
|
|
|
49
36
|
describe Conjur::Command::Init do
|
data/spec/command/users_spec.rb
CHANGED
|
@@ -12,7 +12,8 @@ describe Conjur::Command::Users, logged_in: true do
|
|
|
12
12
|
user: username,
|
|
13
13
|
password: api_key,
|
|
14
14
|
headers: { },
|
|
15
|
-
payload: "new-password"
|
|
15
|
+
payload: "new-password",
|
|
16
|
+
ssl_cert_store: cert_store
|
|
16
17
|
})
|
|
17
18
|
end
|
|
18
19
|
|
|
@@ -40,7 +41,8 @@ describe Conjur::Command::Users, logged_in: true do
|
|
|
40
41
|
user: username,
|
|
41
42
|
password: api_key,
|
|
42
43
|
headers: {},
|
|
43
|
-
payload: ''
|
|
44
|
+
payload: '',
|
|
45
|
+
ssl_cert_store: cert_store
|
|
44
46
|
}).and_return double(:response, body: 'new api key')
|
|
45
47
|
expect(Conjur::Authn).to receive(:save_credentials).with({
|
|
46
48
|
username: username,
|
|
@@ -52,5 +54,19 @@ describe Conjur::Command::Users, logged_in: true do
|
|
|
52
54
|
invoke
|
|
53
55
|
end
|
|
54
56
|
end
|
|
57
|
+
describe_command 'user rotate_api_key --user non-existing' do
|
|
58
|
+
before do
|
|
59
|
+
expect(RestClient::Request).to receive(:execute).with({
|
|
60
|
+
method: :head,
|
|
61
|
+
url: "https://core.example.com/api/resources/#{account}/user/non-existing",
|
|
62
|
+
headers: {authorization: "fakeauth"},
|
|
63
|
+
username: username,
|
|
64
|
+
ssl_cert_store: cert_store
|
|
65
|
+
}).and_raise RestClient::ResourceNotFound
|
|
66
|
+
end
|
|
67
|
+
it 'rotate_api_key with non-existing --user option' do
|
|
68
|
+
expect { invoke }.to raise_error(GLI::CustomExit, /User 'non-existing' not found/i)
|
|
69
|
+
end
|
|
70
|
+
end
|
|
55
71
|
end
|
|
56
72
|
end
|
data/spec/spec_helper.rb
CHANGED
data/test.sh
CHANGED
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: conjur-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.2.
|
|
4
|
+
version: 6.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
8
|
-
- Kevin Gilpin
|
|
7
|
+
- Conjur Maintainers
|
|
9
8
|
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 2021-09-29 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: activesupport
|
|
@@ -45,6 +44,20 @@ dependencies:
|
|
|
45
44
|
- - "~>"
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
46
|
version: '5.3'
|
|
47
|
+
- !ruby/object:Gem::Dependency
|
|
48
|
+
name: deep_merge
|
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - "~>"
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '1.0'
|
|
54
|
+
type: :runtime
|
|
55
|
+
prerelease: false
|
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - "~>"
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '1.0'
|
|
48
61
|
- !ruby/object:Gem::Dependency
|
|
49
62
|
name: gli
|
|
50
63
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -65,14 +78,14 @@ dependencies:
|
|
|
65
78
|
requirements:
|
|
66
79
|
- - "~>"
|
|
67
80
|
- !ruby/object:Gem::Version
|
|
68
|
-
version: '
|
|
81
|
+
version: '2.0'
|
|
69
82
|
type: :runtime
|
|
70
83
|
prerelease: false
|
|
71
84
|
version_requirements: !ruby/object:Gem::Requirement
|
|
72
85
|
requirements:
|
|
73
86
|
- - "~>"
|
|
74
87
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: '
|
|
88
|
+
version: '2.0'
|
|
76
89
|
- !ruby/object:Gem::Dependency
|
|
77
90
|
name: netrc
|
|
78
91
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -88,19 +101,19 @@ dependencies:
|
|
|
88
101
|
- !ruby/object:Gem::Version
|
|
89
102
|
version: '0.10'
|
|
90
103
|
- !ruby/object:Gem::Dependency
|
|
91
|
-
name:
|
|
104
|
+
name: table_print
|
|
92
105
|
requirement: !ruby/object:Gem::Requirement
|
|
93
106
|
requirements:
|
|
94
107
|
- - "~>"
|
|
95
108
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: '1.
|
|
109
|
+
version: '1.5'
|
|
97
110
|
type: :runtime
|
|
98
111
|
prerelease: false
|
|
99
112
|
version_requirements: !ruby/object:Gem::Requirement
|
|
100
113
|
requirements:
|
|
101
114
|
- - "~>"
|
|
102
115
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: '1.
|
|
116
|
+
version: '1.5'
|
|
104
117
|
- !ruby/object:Gem::Dependency
|
|
105
118
|
name: xdg
|
|
106
119
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -116,35 +129,7 @@ dependencies:
|
|
|
116
129
|
- !ruby/object:Gem::Version
|
|
117
130
|
version: 2.2.3
|
|
118
131
|
- !ruby/object:Gem::Dependency
|
|
119
|
-
name:
|
|
120
|
-
requirement: !ruby/object:Gem::Requirement
|
|
121
|
-
requirements:
|
|
122
|
-
- - "~>"
|
|
123
|
-
- !ruby/object:Gem::Version
|
|
124
|
-
version: '1.5'
|
|
125
|
-
type: :runtime
|
|
126
|
-
prerelease: false
|
|
127
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
128
|
-
requirements:
|
|
129
|
-
- - "~>"
|
|
130
|
-
- !ruby/object:Gem::Version
|
|
131
|
-
version: '1.5'
|
|
132
|
-
- !ruby/object:Gem::Dependency
|
|
133
|
-
name: rspec
|
|
134
|
-
requirement: !ruby/object:Gem::Requirement
|
|
135
|
-
requirements:
|
|
136
|
-
- - "~>"
|
|
137
|
-
- !ruby/object:Gem::Version
|
|
138
|
-
version: '3.0'
|
|
139
|
-
type: :development
|
|
140
|
-
prerelease: false
|
|
141
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
142
|
-
requirements:
|
|
143
|
-
- - "~>"
|
|
144
|
-
- !ruby/object:Gem::Version
|
|
145
|
-
version: '3.0'
|
|
146
|
-
- !ruby/object:Gem::Dependency
|
|
147
|
-
name: simplecov
|
|
132
|
+
name: addressable
|
|
148
133
|
requirement: !ruby/object:Gem::Requirement
|
|
149
134
|
requirements:
|
|
150
135
|
- - ">="
|
|
@@ -186,19 +171,19 @@ dependencies:
|
|
|
186
171
|
- !ruby/object:Gem::Version
|
|
187
172
|
version: '1.0'
|
|
188
173
|
- !ruby/object:Gem::Dependency
|
|
189
|
-
name:
|
|
174
|
+
name: cucumber-api
|
|
190
175
|
requirement: !ruby/object:Gem::Requirement
|
|
191
176
|
requirements:
|
|
192
|
-
- - "
|
|
177
|
+
- - ">="
|
|
193
178
|
- !ruby/object:Gem::Version
|
|
194
|
-
version: '
|
|
179
|
+
version: '0'
|
|
195
180
|
type: :development
|
|
196
181
|
prerelease: false
|
|
197
182
|
version_requirements: !ruby/object:Gem::Requirement
|
|
198
183
|
requirements:
|
|
199
|
-
- - "
|
|
184
|
+
- - ">="
|
|
200
185
|
- !ruby/object:Gem::Version
|
|
201
|
-
version: '
|
|
186
|
+
version: '0'
|
|
202
187
|
- !ruby/object:Gem::Dependency
|
|
203
188
|
name: io-grab
|
|
204
189
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -228,7 +213,7 @@ dependencies:
|
|
|
228
213
|
- !ruby/object:Gem::Version
|
|
229
214
|
version: '0'
|
|
230
215
|
- !ruby/object:Gem::Dependency
|
|
231
|
-
name:
|
|
216
|
+
name: pry-byebug
|
|
232
217
|
requirement: !ruby/object:Gem::Requirement
|
|
233
218
|
requirements:
|
|
234
219
|
- - ">="
|
|
@@ -242,37 +227,56 @@ dependencies:
|
|
|
242
227
|
- !ruby/object:Gem::Version
|
|
243
228
|
version: '0'
|
|
244
229
|
- !ruby/object:Gem::Dependency
|
|
245
|
-
name:
|
|
230
|
+
name: rake
|
|
246
231
|
requirement: !ruby/object:Gem::Requirement
|
|
247
232
|
requirements:
|
|
248
|
-
- - "
|
|
233
|
+
- - "~>"
|
|
249
234
|
- !ruby/object:Gem::Version
|
|
250
|
-
version:
|
|
235
|
+
version: 12.3.3
|
|
251
236
|
type: :development
|
|
252
237
|
prerelease: false
|
|
253
238
|
version_requirements: !ruby/object:Gem::Requirement
|
|
254
239
|
requirements:
|
|
255
|
-
- - "
|
|
240
|
+
- - "~>"
|
|
256
241
|
- !ruby/object:Gem::Version
|
|
257
|
-
version:
|
|
242
|
+
version: 12.3.3
|
|
258
243
|
- !ruby/object:Gem::Dependency
|
|
259
|
-
name:
|
|
244
|
+
name: rspec
|
|
260
245
|
requirement: !ruby/object:Gem::Requirement
|
|
261
246
|
requirements:
|
|
262
|
-
- - "
|
|
247
|
+
- - "~>"
|
|
263
248
|
- !ruby/object:Gem::Version
|
|
264
|
-
version: '0'
|
|
249
|
+
version: '3.0'
|
|
265
250
|
type: :development
|
|
266
251
|
prerelease: false
|
|
267
252
|
version_requirements: !ruby/object:Gem::Requirement
|
|
268
253
|
requirements:
|
|
269
|
-
- - "
|
|
254
|
+
- - "~>"
|
|
270
255
|
- !ruby/object:Gem::Version
|
|
271
|
-
version: '0'
|
|
256
|
+
version: '3.0'
|
|
257
|
+
- !ruby/object:Gem::Dependency
|
|
258
|
+
name: simplecov
|
|
259
|
+
requirement: !ruby/object:Gem::Requirement
|
|
260
|
+
requirements:
|
|
261
|
+
- - "~>"
|
|
262
|
+
- !ruby/object:Gem::Version
|
|
263
|
+
version: '0.17'
|
|
264
|
+
- - "<"
|
|
265
|
+
- !ruby/object:Gem::Version
|
|
266
|
+
version: '0.18'
|
|
267
|
+
type: :development
|
|
268
|
+
prerelease: false
|
|
269
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
270
|
+
requirements:
|
|
271
|
+
- - "~>"
|
|
272
|
+
- !ruby/object:Gem::Version
|
|
273
|
+
version: '0.17'
|
|
274
|
+
- - "<"
|
|
275
|
+
- !ruby/object:Gem::Version
|
|
276
|
+
version: '0.18'
|
|
272
277
|
description:
|
|
273
278
|
email:
|
|
274
|
-
-
|
|
275
|
-
- kgilpin@conjur.net
|
|
279
|
+
- conj_maintainers@cyberark.com
|
|
276
280
|
executables:
|
|
277
281
|
- _conjur
|
|
278
282
|
- conjur
|
|
@@ -280,23 +284,32 @@ extensions: []
|
|
|
280
284
|
extra_rdoc_files: []
|
|
281
285
|
files:
|
|
282
286
|
- ".dockerignore"
|
|
287
|
+
- ".github/CODEOWNERS"
|
|
288
|
+
- ".github/ISSUE_TEMPLATE/bug.md"
|
|
289
|
+
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
|
290
|
+
- ".github/PULL_REQUEST_TEMPLATE.md"
|
|
283
291
|
- ".gitignore"
|
|
292
|
+
- ".gitleaks.toml"
|
|
284
293
|
- ".kateproject"
|
|
285
294
|
- ".overcommit.yml"
|
|
286
295
|
- ".project"
|
|
287
296
|
- ".rubocop.yml"
|
|
288
297
|
- APPLIANCE_VERSION
|
|
289
298
|
- CHANGELOG.md
|
|
299
|
+
- CONTRIBUTING.md
|
|
290
300
|
- Gemfile
|
|
291
301
|
- Humanfile.md
|
|
292
302
|
- Jenkinsfile
|
|
293
|
-
- LICENSE
|
|
303
|
+
- LICENSE
|
|
304
|
+
- NOTICES.txt
|
|
294
305
|
- PUBLISH.md
|
|
295
306
|
- README.md
|
|
296
307
|
- Rakefile
|
|
308
|
+
- SECURITY.md
|
|
297
309
|
- VERSION
|
|
298
310
|
- bin/_conjur
|
|
299
311
|
- bin/conjur
|
|
312
|
+
- bin/parse-changelog.sh
|
|
300
313
|
- build-deb.sh
|
|
301
314
|
- build-standalone
|
|
302
315
|
- ci/cli-test.sh
|
|
@@ -304,6 +317,7 @@ files:
|
|
|
304
317
|
- ci/package.sh
|
|
305
318
|
- ci/publish.sh
|
|
306
319
|
- ci/secrets/publish.yml
|
|
320
|
+
- ci/submit-coverage
|
|
307
321
|
- ci/test.sh
|
|
308
322
|
- ci/wait_for_server.sh
|
|
309
323
|
- conjur-cli.gemspec
|
|
@@ -398,9 +412,9 @@ files:
|
|
|
398
412
|
- spec/spec_helper.rb
|
|
399
413
|
- standalone.entrypoint
|
|
400
414
|
- test.sh
|
|
401
|
-
homepage: https://github.com/
|
|
415
|
+
homepage: https://github.com/cyberark/conjur-cli
|
|
402
416
|
licenses:
|
|
403
|
-
-
|
|
417
|
+
- Apache 2.0
|
|
404
418
|
metadata: {}
|
|
405
419
|
post_install_message:
|
|
406
420
|
rdoc_options: []
|
|
@@ -417,7 +431,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
417
431
|
- !ruby/object:Gem::Version
|
|
418
432
|
version: '0'
|
|
419
433
|
requirements: []
|
|
420
|
-
rubygems_version: 3.
|
|
434
|
+
rubygems_version: 3.1.6
|
|
421
435
|
signing_key:
|
|
422
436
|
specification_version: 4
|
|
423
437
|
summary: Conjur command line interface
|