conjur-cli 2.1.9 → 2.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +7 -0
- data/Gemfile +3 -2
- data/Rakefile +13 -14
- data/bin/jsonfield +50 -0
- data/conjur.gemspec +5 -1
- data/features/jsonfield.feature +49 -0
- data/features/support/env.rb +4 -0
- data/lib/conjur/cli.rb +16 -17
- data/lib/conjur/command/authn.rb +6 -3
- data/lib/conjur/command/field.rb +3 -3
- data/lib/conjur/command/hosts.rb +1 -1
- data/lib/conjur/command/resources.rb +4 -0
- data/lib/conjur/command/roles.rb +8 -11
- data/lib/conjur/version.rb +1 -1
- data/spec/command/authn_spec.rb +6 -20
- data/spec/command/roles_spec.rb +41 -0
- data/spec/spec_helper.rb +45 -1
- data/spec/write_expectation.rb +1 -0
- metadata +84 -7
- data/.rvmrc +0 -1
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -3,8 +3,9 @@ source 'https://rubygems.org'
|
|
3
3
|
# Specify your gem's dependencies in conjur.gemspec
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
|
7
|
-
gem 'conjur-api',
|
6
|
+
# when developing in parallel, you might want to uncomment the following:
|
7
|
+
# gem 'conjur-api', git: 'https://github.com/inscitiv/api-ruby.git', branch: 'master'
|
8
|
+
|
8
9
|
gem 'conjur-asset-cmi-study', git: 'https://inscitiv-ops-dev:Me5aswes@github.com/inscitiv/conjur-asset-cmi-study', branch: 'master'
|
9
10
|
gem 'conjur-asset-environment', git: 'https://inscitiv-ops-dev:Me5aswes@github.com/inscitiv/conjur-asset-environment', branch: 'master'
|
10
11
|
gem 'conjur-asset-deployment', git: 'https://inscitiv-ops-dev:Me5aswes@github.com/inscitiv/conjur-asset-deployment', branch: 'master'
|
data/Rakefile
CHANGED
@@ -1,20 +1,19 @@
|
|
1
1
|
#!/usr/bin/env rake
|
2
2
|
require "bundler/gem_tasks"
|
3
|
+
require 'ci/reporter/rake/rspec'
|
4
|
+
require 'ci/reporter/rake/cucumber'
|
5
|
+
require 'cucumber'
|
6
|
+
require 'cucumber/rake/task'
|
7
|
+
require 'rspec/core/rake_task'
|
3
8
|
|
4
|
-
|
5
|
-
|
6
|
-
RSpec::Core::RakeTask.new(:spec)
|
7
|
-
rescue LoadError
|
8
|
-
$stderr.puts "RSpec Rake tasks not available in environment #{ENV['RACK_ENV']}"
|
9
|
-
end
|
9
|
+
RSpec::Core::RakeTask.new :spec
|
10
|
+
Cucumber::Rake::Task.new :features
|
10
11
|
|
11
|
-
task :jenkins do
|
12
|
-
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
Rake::Task["ci:setup:rspec"].invoke
|
17
|
-
Rake::Task["spec"].invoke
|
12
|
+
task :jenkins => ['ci:setup:rspec', :spec, 'ci:setup:cucumber_report_cleanup'] do
|
13
|
+
Cucumber::Rake::Task.new do |t|
|
14
|
+
t.cucumber_opts = "--format CI::Reporter::Cucumber"
|
15
|
+
end.runner.run
|
16
|
+
File.write('build_number', ENV['BUILD_NUMBER']) if ENV['BUILD_NUMBER']
|
18
17
|
end
|
19
18
|
|
20
|
-
task default: :spec
|
19
|
+
task default: [:spec, :features]
|
data/bin/jsonfield
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'methadone'
|
5
|
+
|
6
|
+
class JsonField
|
7
|
+
include Methadone::Main
|
8
|
+
include Methadone::CLILogging
|
9
|
+
|
10
|
+
description "parse JSON and extract a field value"
|
11
|
+
arg :json_path, "path to object to extract, eg. 'headers.0' or 'document.author.name'"
|
12
|
+
arg :json, :optional, "data to parse (reads from stdin if not given)"
|
13
|
+
|
14
|
+
main do |path, input = nil|
|
15
|
+
input ||= STDIN.read
|
16
|
+
data = JSON.parse input
|
17
|
+
result = data.extract_field *(path.split '.', -1)
|
18
|
+
puts result
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class Hash
|
23
|
+
def extract_field head = nil, *tail
|
24
|
+
return self unless head
|
25
|
+
field_not_found! head unless has_key? head
|
26
|
+
self[head].extract_field *tail
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
class Array
|
31
|
+
def extract_field head = nil, *tail
|
32
|
+
return self unless head
|
33
|
+
index = Integer(head) rescue field_not_found!(head)
|
34
|
+
field_not_found! index if index >= size
|
35
|
+
self[index].extract_field *tail
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
class Object
|
40
|
+
def extract_field head = nil, *tail
|
41
|
+
field_not_found! head if head
|
42
|
+
self
|
43
|
+
end
|
44
|
+
|
45
|
+
def field_not_found! field
|
46
|
+
raise Methadone::Error.new(2, "No field #{field} in #{inspect}")
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
JsonField.go!
|
data/conjur.gemspec
CHANGED
@@ -14,13 +14,17 @@ Gem::Specification.new do |gem|
|
|
14
14
|
gem.require_paths = ["lib"]
|
15
15
|
gem.version = Conjur::VERSION
|
16
16
|
|
17
|
-
gem.add_dependency 'conjur-api'
|
17
|
+
gem.add_dependency 'conjur-api', '~> 2.4'
|
18
18
|
gem.add_dependency 'gli'
|
19
19
|
gem.add_dependency 'highline'
|
20
20
|
gem.add_dependency 'netrc'
|
21
|
+
gem.add_dependency 'methadone'
|
21
22
|
|
22
23
|
gem.add_runtime_dependency 'cas_rest_client'
|
23
24
|
|
24
25
|
gem.add_development_dependency 'rspec'
|
25
26
|
gem.add_development_dependency 'simplecov'
|
27
|
+
gem.add_development_dependency 'aruba'
|
28
|
+
gem.add_development_dependency 'ci_reporter', '~> 1.8'
|
29
|
+
gem.add_development_dependency 'rake', '~> 10.0'
|
26
30
|
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
Feature: Extracting JSON fields
|
2
|
+
|
3
|
+
In order to use conjur output in shell scripts
|
4
|
+
As a Conjur user
|
5
|
+
I want to extract fields from JSON data
|
6
|
+
|
7
|
+
Scenario: An array element
|
8
|
+
When I successfully run `jsonfield 2 '[1, 2, 3]'`
|
9
|
+
Then the output should contain "3"
|
10
|
+
|
11
|
+
Scenario: An out of bounds array element
|
12
|
+
When I run `jsonfield 3 '[1, 2, 3]'`
|
13
|
+
Then the output should contain "No field 3"
|
14
|
+
And the exit status should be 2
|
15
|
+
|
16
|
+
Scenario: A hash element
|
17
|
+
When I successfully run `jsonfield a '{"a": 4}'`
|
18
|
+
Then the output should contain "4"
|
19
|
+
|
20
|
+
Scenario: A non-existent hash element
|
21
|
+
When I run `jsonfield b '{"a": 4}'`
|
22
|
+
Then the output should contain "No field b"
|
23
|
+
And the exit status should be 2
|
24
|
+
|
25
|
+
Scenario: Nested elements
|
26
|
+
When I successfully run `jsonfield 0.a.1.b '[{"a": [42, {"b": "foo", "d": null}, 33], "bar": true}]'`
|
27
|
+
Then the output should contain "foo"
|
28
|
+
|
29
|
+
Scenario: Standard input
|
30
|
+
Given a file named "test.json" with:
|
31
|
+
"""
|
32
|
+
{
|
33
|
+
"a": [
|
34
|
+
42,
|
35
|
+
{
|
36
|
+
"b": "foo",
|
37
|
+
"d": null
|
38
|
+
},
|
39
|
+
33
|
40
|
+
],
|
41
|
+
"bar": true
|
42
|
+
}
|
43
|
+
"""
|
44
|
+
When I run `cat test.json | jsonfield 0.a.1.b`
|
45
|
+
Then the output should contain "foo"
|
46
|
+
|
47
|
+
Scenario: An element with hyphen in key
|
48
|
+
When I successfully run `jsonfield variables.db-password '{"variables": {"db-password": "foo"}}'`
|
49
|
+
Then the output should contain "foo"
|
data/lib/conjur/cli.rb
CHANGED
@@ -19,24 +19,25 @@ module Conjur
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
load_config
|
23
|
-
|
24
|
-
ENV['CONJUR_ENV'] = Config[:env] || "production"
|
25
|
-
ENV['CONJUR_STACK'] = Config[:stack] if Config[:stack]
|
26
|
-
ENV['CONJUR_STACK'] ||= 'v3' if ENV['CONJUR_ENV'] == 'production'
|
27
|
-
ENV['CONJUR_ACCOUNT'] = Config[:account] or raise "Missing configuration setting: account. Please set it in ~/.conjurrc"
|
28
|
-
|
29
|
-
Conjur::Config.plugins.each do |plugin|
|
30
|
-
require "conjur-asset-#{plugin}"
|
31
|
-
end
|
32
22
|
|
33
23
|
commands_from 'conjur/command'
|
34
24
|
|
35
|
-
if Conjur.log
|
36
|
-
Conjur.log << "Using host #{Conjur::Authn::API.host}\n"
|
37
|
-
end
|
38
|
-
|
39
25
|
pre do |global,command,options,args|
|
26
|
+
load_config
|
27
|
+
|
28
|
+
ENV['CONJUR_ENV'] = Config[:env] || "production"
|
29
|
+
ENV['CONJUR_STACK'] = Config[:stack] if Config[:stack]
|
30
|
+
ENV['CONJUR_STACK'] ||= 'v3' if ENV['CONJUR_ENV'] == 'production'
|
31
|
+
ENV['CONJUR_ACCOUNT'] = Config[:account] or raise "Missing configuration setting: account. Please set it in ~/.conjurrc"
|
32
|
+
|
33
|
+
Conjur::Config.plugins.each do |plugin|
|
34
|
+
require "conjur-asset-#{plugin}"
|
35
|
+
end
|
36
|
+
|
37
|
+
if Conjur.log
|
38
|
+
Conjur.log << "Using host #{Conjur::Authn::API.host}\n"
|
39
|
+
end
|
40
|
+
|
40
41
|
require 'active_support/core_ext'
|
41
42
|
options.delete_if{|k,v| v.blank?}
|
42
43
|
options.symbolize_keys!
|
@@ -57,9 +58,7 @@ module Conjur
|
|
57
58
|
end
|
58
59
|
|
59
60
|
on_error do |exception|
|
60
|
-
if exception.is_a?(
|
61
|
-
# pass
|
62
|
-
elsif exception.is_a?(RestClient::Exception)
|
61
|
+
if exception.is_a?(RestClient::Exception)
|
63
62
|
begin
|
64
63
|
body = JSON.parse(exception.response.body)
|
65
64
|
$stderr.puts body['error']
|
data/lib/conjur/command/authn.rb
CHANGED
@@ -54,9 +54,12 @@ DESC
|
|
54
54
|
|
55
55
|
desc "Prints out the current logged in username"
|
56
56
|
command :whoami do |c|
|
57
|
-
c.action do
|
58
|
-
|
59
|
-
|
57
|
+
c.action do
|
58
|
+
if creds = Conjur::Authn.read_credentials
|
59
|
+
puts({account: Conjur::Core::API.conjur_account, username: creds[0]}.to_json)
|
60
|
+
else
|
61
|
+
exit_now! 'Not logged in.', -1
|
62
|
+
end
|
60
63
|
end
|
61
64
|
end
|
62
65
|
end
|
data/lib/conjur/command/field.rb
CHANGED
@@ -3,13 +3,13 @@ require 'conjur/command'
|
|
3
3
|
class Conjur::Command::Field < Conjur::Command
|
4
4
|
self.prefix = :field
|
5
5
|
|
6
|
-
desc "
|
7
|
-
arg_name "pattern (value | STDIN)"
|
6
|
+
desc "(Deprecated. See standalone jsonfield command instead.)"
|
8
7
|
command :select do |c|
|
9
8
|
c.action do |global_options,options,args|
|
10
9
|
pattern = require_arg(args, 'pattern')
|
11
10
|
value = args.shift || STDIN.read
|
12
|
-
|
11
|
+
|
12
|
+
warn "field:select is deprecated. Please use jsonfield command instead."
|
13
13
|
require 'json'
|
14
14
|
json = JSON.parse(value)
|
15
15
|
class << json
|
data/lib/conjur/command/hosts.rb
CHANGED
@@ -27,7 +27,7 @@ class Conjur::Command::Hosts < Conjur::Command
|
|
27
27
|
enrollment_url = api.host(id).enrollment_url
|
28
28
|
puts enrollment_url
|
29
29
|
$stderr.puts "On the target host, please execute the following command:"
|
30
|
-
$stderr.puts "
|
30
|
+
$stderr.puts "curl -L #{enrollment_url} | bash"
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
@@ -15,6 +15,7 @@ class Conjur::Command::Resources < Conjur::Command
|
|
15
15
|
id = require_arg(args, "resource-id")
|
16
16
|
resource = api.resource([ conjur_account, kind, id ].join(':'))
|
17
17
|
resource.create(options)
|
18
|
+
display resource.attributes
|
18
19
|
end
|
19
20
|
end
|
20
21
|
|
@@ -48,6 +49,7 @@ class Conjur::Command::Resources < Conjur::Command
|
|
48
49
|
role = require_arg(args, "role")
|
49
50
|
privilege = require_arg(args, "privilege")
|
50
51
|
api.resource([ conjur_account, kind, id ].join(':')).permit privilege, role
|
52
|
+
puts "Permission granted"
|
51
53
|
end
|
52
54
|
end
|
53
55
|
|
@@ -60,6 +62,7 @@ class Conjur::Command::Resources < Conjur::Command
|
|
60
62
|
role = require_arg(args, "role")
|
61
63
|
privilege = require_arg(args, "privilege")
|
62
64
|
api.resource([ conjur_account, kind, id ].join(':')).deny privilege, role
|
65
|
+
puts "Permission revoked"
|
63
66
|
end
|
64
67
|
end
|
65
68
|
|
@@ -84,6 +87,7 @@ class Conjur::Command::Resources < Conjur::Command
|
|
84
87
|
id = require_arg(args, "resource-id")
|
85
88
|
owner = require_arg(args, "owner")
|
86
89
|
api.resource([ conjur_account, kind, id ].join(':')).give_to owner
|
90
|
+
puts "Role granted"
|
87
91
|
end
|
88
92
|
end
|
89
93
|
|
data/lib/conjur/command/roles.rb
CHANGED
@@ -13,6 +13,7 @@ class Conjur::Command::Roles < Conjur::Command
|
|
13
13
|
id = require_arg(args, 'role')
|
14
14
|
role = api.role(id)
|
15
15
|
role.create(options)
|
16
|
+
puts "Created #{role}"
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
@@ -30,24 +31,18 @@ class Conjur::Command::Roles < Conjur::Command
|
|
30
31
|
arg_name "role"
|
31
32
|
command :memberships do |c|
|
32
33
|
c.action do |global_options,options,args|
|
33
|
-
|
34
|
-
|
34
|
+
roleid = args.shift
|
35
|
+
role = roleid.nil? && api.current_role || api.role(roleid)
|
36
|
+
display role.all.map(&:roleid)
|
35
37
|
end
|
36
38
|
end
|
37
39
|
|
38
|
-
desc "Lists members of the role"
|
40
|
+
desc "Lists all members of the role"
|
39
41
|
arg_name "role"
|
40
42
|
command :members do |c|
|
41
|
-
c.desc "List all members recursively"
|
42
|
-
c.switch :a
|
43
|
-
|
44
43
|
c.action do |global_options,options,args|
|
45
44
|
role = args.shift || api.user(api.username).roleid
|
46
|
-
|
47
|
-
display api.role(role).all.map(&:roleid)
|
48
|
-
else
|
49
|
-
display api.role(role).members.map(&:member).map(&:roleid)
|
50
|
-
end
|
45
|
+
display api.role(role).members.map(&:member).map(&:roleid)
|
51
46
|
end
|
52
47
|
end
|
53
48
|
|
@@ -62,6 +57,7 @@ class Conjur::Command::Roles < Conjur::Command
|
|
62
57
|
member = require_arg(args, 'member')
|
63
58
|
role = api.role(id)
|
64
59
|
role.grant_to member, options[:admin]
|
60
|
+
puts "Role granted"
|
65
61
|
end
|
66
62
|
end
|
67
63
|
|
@@ -73,6 +69,7 @@ class Conjur::Command::Roles < Conjur::Command
|
|
73
69
|
member = require_arg(args, 'member')
|
74
70
|
role = api.role(id)
|
75
71
|
role.revoke_from member
|
72
|
+
puts "Role revoked"
|
76
73
|
end
|
77
74
|
end
|
78
75
|
end
|
data/lib/conjur/version.rb
CHANGED
data/spec/command/authn_spec.rb
CHANGED
@@ -1,39 +1,25 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
require 'tempfile'
|
3
|
-
require 'write_expectation'
|
4
2
|
|
5
3
|
describe Conjur::Command::Authn do
|
6
|
-
|
7
|
-
let(:netrc) { Netrc.read(netrcfile.path) }
|
8
|
-
let(:host) { 'https://authn.example.com' }
|
9
|
-
|
10
|
-
before do
|
11
|
-
Conjur::Authn.stub netrc: netrc, host: host
|
12
|
-
end
|
13
|
-
|
14
|
-
context "when not logged in" do
|
4
|
+
context logged_in: false do
|
15
5
|
describe_command 'authn:whoami' do
|
16
6
|
it "errors out" do
|
17
|
-
expect{ invoke }.to
|
7
|
+
expect { invoke }.to raise_error(GLI::CustomExit, /not logged in/i)
|
18
8
|
end
|
19
9
|
end
|
20
10
|
end
|
21
11
|
|
22
|
-
context
|
23
|
-
let(:username) { 'dknuth' }
|
24
|
-
let(:api_key) { 'sekrit' }
|
25
|
-
before { netrc[host] = [username, api_key] }
|
26
|
-
|
12
|
+
context logged_in: true do
|
27
13
|
describe_command 'authn:logout' do
|
28
14
|
it "deletes credentials" do
|
29
15
|
invoke
|
30
|
-
netrc[
|
16
|
+
netrc[authn_host].should_not be
|
31
17
|
end
|
32
18
|
end
|
33
19
|
|
34
20
|
describe_command 'authn:whoami' do
|
35
|
-
it "prints the current username to stdout" do
|
36
|
-
expect { invoke }.to write username
|
21
|
+
it "prints the current account and username to stdout" do
|
22
|
+
expect { invoke }.to write({ account: account, username: username }.to_json)
|
37
23
|
end
|
38
24
|
end
|
39
25
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Conjur::Command::Roles, logged_in: true do
|
4
|
+
let(:all_roles) { %w(foo:user:joerandom foo:something:cool foo:something:else foo:group:admins) }
|
5
|
+
let(:role) do
|
6
|
+
double "the role", all: all_roles.map{|r| double r, roleid: r }
|
7
|
+
end
|
8
|
+
|
9
|
+
before do
|
10
|
+
api.stub(:role).with(rolename).and_return role
|
11
|
+
end
|
12
|
+
|
13
|
+
context "when logged in as a user" do
|
14
|
+
let(:username) { "joerandom" }
|
15
|
+
let(:rolename) { "user:joerandom" }
|
16
|
+
|
17
|
+
describe_command "role:memberships" do
|
18
|
+
it "lists all roles" do
|
19
|
+
JSON::parse(expect { invoke }.to write).should == all_roles
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
describe_command "role:memberships foo:bar" do
|
24
|
+
let(:rolename) { 'foo:bar' }
|
25
|
+
it "lists all roles of foo:bar" do
|
26
|
+
JSON::parse(expect { invoke }.to write).should == all_roles
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context "when logged in as a host" do
|
32
|
+
let(:username) { "host/foobar" }
|
33
|
+
let(:rolename) { "host:foobar" }
|
34
|
+
|
35
|
+
describe_command "role:memberships" do
|
36
|
+
it "lists all roles" do
|
37
|
+
JSON::parse(expect { invoke }.to write).should == all_roles
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require "rubygems"
|
2
2
|
require "bundler/setup"
|
3
|
+
require 'tempfile'
|
3
4
|
|
4
5
|
require "simplecov"
|
5
6
|
SimpleCov.start
|
@@ -9,11 +10,54 @@ module RSpec::Core::DSL
|
|
9
10
|
describe *argv do
|
10
11
|
let(:invoke) do
|
11
12
|
Conjur::CLI.error_device = $stderr
|
12
|
-
Conjur::CLI.run argv
|
13
|
+
Conjur::CLI.run argv.first.split(' ')
|
13
14
|
end
|
14
15
|
instance_eval &block
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
18
19
|
|
20
|
+
shared_context "with fake endpoints and test config" do
|
21
|
+
let(:authn_host) { 'https://authn.example.com' }
|
22
|
+
let(:authz_host) { 'https://authz.example.com' }
|
23
|
+
let(:core_host) { 'https://core.example.com' }
|
24
|
+
before do
|
25
|
+
Conjur::Authn::API.stub host: authn_host
|
26
|
+
Conjur::Authz::API.stub host: authz_host
|
27
|
+
Conjur::Core::API.stub host: core_host
|
28
|
+
|
29
|
+
ENV['GLI_DEBUG'] = 'true'
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
shared_context "with mock authn" do
|
34
|
+
include_context "with fake endpoints and test config"
|
35
|
+
let(:netrcfile) { Tempfile.new 'authtest' }
|
36
|
+
let(:netrc) { Netrc.read(netrcfile.path) }
|
37
|
+
let(:account) { 'the-account' }
|
38
|
+
before do
|
39
|
+
Conjur::Core::API.stub conjur_account: account
|
40
|
+
Conjur::Authn.stub netrc: netrc, host: authn_host
|
41
|
+
Conjur::Config.merge 'account' => account
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
shared_context "when logged in", logged_in: true do
|
47
|
+
include_context "with mock authn"
|
48
|
+
let(:username) { 'dknuth' }
|
49
|
+
let(:api_key) { 'sekrit' }
|
50
|
+
let(:api) { Conjur::API.new_from_token({ 'data' => username }) }
|
51
|
+
before do
|
52
|
+
netrc[authn_host] = [username, api_key]
|
53
|
+
Conjur::Command.stub api: api
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
shared_context "when not logged in", logged_in: false do
|
58
|
+
include_context "with mock authn"
|
59
|
+
end
|
60
|
+
|
61
|
+
require 'write_expectation'
|
62
|
+
|
19
63
|
require 'conjur/cli'
|
data/spec/write_expectation.rb
CHANGED
@@ -27,6 +27,7 @@ RSpec::Matchers.define :write do |message|
|
|
27
27
|
case message
|
28
28
|
when String then output.include? message
|
29
29
|
when Regexp then output.match message
|
30
|
+
when nil then output
|
30
31
|
else fail("Allowed types for write `message` are String or Regexp, got `#{message.class}`")
|
31
32
|
end
|
32
33
|
end
|
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: 2.1
|
4
|
+
version: 2.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,10 +10,26 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-06-
|
13
|
+
date: 2013-06-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: conjur-api
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
none: false
|
19
|
+
requirements:
|
20
|
+
- - ~>
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '2.4'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
none: false
|
27
|
+
requirements:
|
28
|
+
- - ~>
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '2.4'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
name: gli
|
17
33
|
requirement: !ruby/object:Gem::Requirement
|
18
34
|
none: false
|
19
35
|
requirements:
|
@@ -29,7 +45,7 @@ dependencies:
|
|
29
45
|
- !ruby/object:Gem::Version
|
30
46
|
version: '0'
|
31
47
|
- !ruby/object:Gem::Dependency
|
32
|
-
name:
|
48
|
+
name: highline
|
33
49
|
requirement: !ruby/object:Gem::Requirement
|
34
50
|
none: false
|
35
51
|
requirements:
|
@@ -45,7 +61,7 @@ dependencies:
|
|
45
61
|
- !ruby/object:Gem::Version
|
46
62
|
version: '0'
|
47
63
|
- !ruby/object:Gem::Dependency
|
48
|
-
name:
|
64
|
+
name: netrc
|
49
65
|
requirement: !ruby/object:Gem::Requirement
|
50
66
|
none: false
|
51
67
|
requirements:
|
@@ -61,7 +77,7 @@ dependencies:
|
|
61
77
|
- !ruby/object:Gem::Version
|
62
78
|
version: '0'
|
63
79
|
- !ruby/object:Gem::Dependency
|
64
|
-
name:
|
80
|
+
name: methadone
|
65
81
|
requirement: !ruby/object:Gem::Requirement
|
66
82
|
none: false
|
67
83
|
requirements:
|
@@ -124,25 +140,76 @@ dependencies:
|
|
124
140
|
- - ! '>='
|
125
141
|
- !ruby/object:Gem::Version
|
126
142
|
version: '0'
|
143
|
+
- !ruby/object:Gem::Dependency
|
144
|
+
name: aruba
|
145
|
+
requirement: !ruby/object:Gem::Requirement
|
146
|
+
none: false
|
147
|
+
requirements:
|
148
|
+
- - ! '>='
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
151
|
+
type: :development
|
152
|
+
prerelease: false
|
153
|
+
version_requirements: !ruby/object:Gem::Requirement
|
154
|
+
none: false
|
155
|
+
requirements:
|
156
|
+
- - ! '>='
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
- !ruby/object:Gem::Dependency
|
160
|
+
name: ci_reporter
|
161
|
+
requirement: !ruby/object:Gem::Requirement
|
162
|
+
none: false
|
163
|
+
requirements:
|
164
|
+
- - ~>
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '1.8'
|
167
|
+
type: :development
|
168
|
+
prerelease: false
|
169
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
|
+
none: false
|
171
|
+
requirements:
|
172
|
+
- - ~>
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '1.8'
|
175
|
+
- !ruby/object:Gem::Dependency
|
176
|
+
name: rake
|
177
|
+
requirement: !ruby/object:Gem::Requirement
|
178
|
+
none: false
|
179
|
+
requirements:
|
180
|
+
- - ~>
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
version: '10.0'
|
183
|
+
type: :development
|
184
|
+
prerelease: false
|
185
|
+
version_requirements: !ruby/object:Gem::Requirement
|
186
|
+
none: false
|
187
|
+
requirements:
|
188
|
+
- - ~>
|
189
|
+
- !ruby/object:Gem::Version
|
190
|
+
version: '10.0'
|
127
191
|
description:
|
128
192
|
email:
|
129
193
|
- divided.mind@gmail.com
|
130
194
|
- kevin.gilpin@inscitiv.com
|
131
195
|
executables:
|
132
196
|
- conjur
|
197
|
+
- jsonfield
|
133
198
|
extensions: []
|
134
199
|
extra_rdoc_files: []
|
135
200
|
files:
|
136
201
|
- .gitignore
|
137
202
|
- .kateproject
|
138
203
|
- .project
|
139
|
-
- .rvmrc
|
140
204
|
- Gemfile
|
141
205
|
- LICENSE
|
142
206
|
- README.md
|
143
207
|
- Rakefile
|
144
208
|
- bin/conjur
|
209
|
+
- bin/jsonfield
|
145
210
|
- conjur.gemspec
|
211
|
+
- features/jsonfield.feature
|
212
|
+
- features/support/env.rb
|
146
213
|
- lib/conjur.rb
|
147
214
|
- lib/conjur/authn.rb
|
148
215
|
- lib/conjur/cli.rb
|
@@ -161,6 +228,7 @@ files:
|
|
161
228
|
- lib/conjur/config.rb
|
162
229
|
- lib/conjur/version.rb
|
163
230
|
- spec/command/authn_spec.rb
|
231
|
+
- spec/command/roles_spec.rb
|
164
232
|
- spec/spec_helper.rb
|
165
233
|
- spec/write_expectation.rb
|
166
234
|
homepage: https://github.com/inscitiv/cli-ruby
|
@@ -175,19 +243,28 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
175
243
|
- - ! '>='
|
176
244
|
- !ruby/object:Gem::Version
|
177
245
|
version: '0'
|
246
|
+
segments:
|
247
|
+
- 0
|
248
|
+
hash: -1479172198194627634
|
178
249
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
179
250
|
none: false
|
180
251
|
requirements:
|
181
252
|
- - ! '>='
|
182
253
|
- !ruby/object:Gem::Version
|
183
254
|
version: '0'
|
255
|
+
segments:
|
256
|
+
- 0
|
257
|
+
hash: -1479172198194627634
|
184
258
|
requirements: []
|
185
259
|
rubyforge_project:
|
186
|
-
rubygems_version: 1.8.
|
260
|
+
rubygems_version: 1.8.25
|
187
261
|
signing_key:
|
188
262
|
specification_version: 3
|
189
263
|
summary: Conjur command line interface
|
190
264
|
test_files:
|
265
|
+
- features/jsonfield.feature
|
266
|
+
- features/support/env.rb
|
191
267
|
- spec/command/authn_spec.rb
|
268
|
+
- spec/command/roles_spec.rb
|
192
269
|
- spec/spec_helper.rb
|
193
270
|
- spec/write_expectation.rb
|
data/.rvmrc
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
rvm use 1.9.3@conjur-cli --create
|