conjur-cli 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ testdata/
1
2
  *.gem
2
3
  *.rbc
3
4
  .bundle
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
- gem 'slosilo', git: 'https://github.com/inscitiv/slosilo.git'
6
+ gem 'slosilo', git: 'https://github.com/inscitiv/slosilo.git', branch: 'master'
7
7
  gem 'conjur-api', git: 'https://github.com/inscitiv/api-ruby.git', branch: 'master'
8
+ gem 'conjur-asset-cmi-study', git: 'https://inscitiv-ops-dev:Me5aswes@github.com/inscitiv/conjur-asset-cmi-study', branch: 'master'
8
9
  gem 'conjur-asset-environment', git: 'https://inscitiv-ops-dev:Me5aswes@github.com/inscitiv/conjur-asset-environment', branch: 'master'
9
10
  gem 'conjur-asset-deployment', git: 'https://inscitiv-ops-dev:Me5aswes@github.com/inscitiv/conjur-asset-deployment', branch: 'master'
10
- gem 'conjur-asset-cmi-study', git: 'https://inscitiv-ops-dev:Me5aswes@github.com/inscitiv/conjur-asset-cmi-study', branch: 'master'
11
+ gem 'conjur-asset-service-gateway', git: 'https://inscitiv-ops-dev:Me5aswes@github.com/inscitiv/conjur-asset-service-gateway', branch: 'master'
data/lib/conjur/cli.rb CHANGED
@@ -18,8 +18,10 @@ module Conjur
18
18
 
19
19
  load_config
20
20
 
21
- ENV['CONJUR_ENV'] = Config[:env] if Config[:env]
21
+ ENV['CONJUR_ENV'] = Config[:env] || "production"
22
22
  ENV['CONJUR_STACK'] = Config[:stack] if Config[:stack]
23
+ ENV['CONJUR_STACK'] ||= 'v3' if ENV['CONJUR_ENV'] == 'production'
24
+ ENV['CONJUR_ACCOUNT'] = Config[:account] or raise "Missing configuration setting: account"
23
25
 
24
26
  Conjur::Config.plugins.each do |plugin|
25
27
  require "conjur-asset-#{plugin}"
@@ -18,8 +18,7 @@ class Conjur::Command::Groups < Conjur::Command
18
18
  end
19
19
 
20
20
  desc "Add a new group member"
21
- arg_name "group"
22
- arg_name "member"
21
+ arg_name "group member"
23
22
  command :"members:add" do |c|
24
23
  c.desc "Grant with admin option"
25
24
  c.switch [:a, :admin]
@@ -1,4 +1,5 @@
1
1
  require 'conjur/authn'
2
+ require 'conjur/resource'
2
3
  require 'conjur/command'
3
4
 
4
5
  class Conjur::Command::Resources < Conjur::Command
@@ -12,7 +13,7 @@ class Conjur::Command::Resources < Conjur::Command
12
13
  c.action do |global_options,options,args|
13
14
  kind = require_arg(args, "kind")
14
15
  id = require_arg(args, "resource-id")
15
- resource = api.resource(kind, id)
16
+ resource = api.resource([ Conjur.account, kind, id ].join(':'))
16
17
  resource.create(options)
17
18
  end
18
19
  end
@@ -23,7 +24,7 @@ class Conjur::Command::Resources < Conjur::Command
23
24
  c.action do |global_options,options,args|
24
25
  kind = require_arg(args, "kind")
25
26
  id = require_arg(args, "resource-id")
26
- display api.resource(kind, id).attributes
27
+ display api.resource([ Conjur.account, kind, id ].join(':')).attributes
27
28
  end
28
29
  end
29
30
 
@@ -33,7 +34,7 @@ class Conjur::Command::Resources < Conjur::Command
33
34
  c.action do |global_options,options,args|
34
35
  kind = require_arg(args, "kind")
35
36
  id = require_arg(args, "resource-id")
36
- resource = api.resource(kind, id)
37
+ resource = api.resource([ Conjur.account, kind, id ].join(':'))
37
38
  puts resource.exists?
38
39
  end
39
40
  end
@@ -46,7 +47,7 @@ class Conjur::Command::Resources < Conjur::Command
46
47
  id = require_arg(args, "resource-id")
47
48
  role = require_arg(args, "role")
48
49
  privilege = require_arg(args, "privilege")
49
- api.resource(kind, id).permit privilege, role
50
+ api.resource([ Conjur.account, kind, id ].join(':')).permit privilege, role
50
51
  end
51
52
  end
52
53
 
@@ -58,7 +59,7 @@ class Conjur::Command::Resources < Conjur::Command
58
59
  id = require_arg(args, "resource-id")
59
60
  role = require_arg(args, "role")
60
61
  privilege = require_arg(args, "privilege")
61
- api.resource(kind, id).deny privilege, role
62
+ api.resource([ Conjur.account, kind, id ].join(':')).deny privilege, role
62
63
  end
63
64
  end
64
65
 
@@ -69,7 +70,7 @@ class Conjur::Command::Resources < Conjur::Command
69
70
  kind = require_arg(args, "kind")
70
71
  id = require_arg(args, "resource-id")
71
72
  owner = require_arg(args, "owner")
72
- api.resource(kind, id).give_to owner
73
+ api.resource([ Conjur.account, kind, id ].join(':')).give_to owner
73
74
  end
74
75
  end
75
76
 
@@ -80,7 +81,7 @@ class Conjur::Command::Resources < Conjur::Command
80
81
  kind = require_arg(args, "kind")
81
82
  id = require_arg(args, "resource-id")
82
83
  permission = require_arg(args, "permission")
83
- display api.resource(kind, id).permitted_roles(permission)
84
+ display api.resource([ Conjur.account, kind, id ].join(':')).permitted_roles(permission)
84
85
  end
85
86
  end
86
87
  end
@@ -30,8 +30,17 @@ class Conjur::Command::Roles < Conjur::Command
30
30
  arg_name "role"
31
31
  command :memberships do |c|
32
32
  c.action do |global_options,options,args|
33
- role = args.shift || api.username
34
- display api.role(role).all.map(&:id)
33
+ role = args.shift || api.user(api.username).roleid
34
+ display api.role(role).all.map(&:roleid)
35
+ end
36
+ end
37
+
38
+ desc "Lists all members of the role"
39
+ arg_name "role"
40
+ command :members do |c|
41
+ c.action do |global_options,options,args|
42
+ role = args.shift || api.user(api.username).roleid
43
+ display api.role(role).members.map(&:member).map(&:roleid)
35
44
  end
36
45
  end
37
46
 
@@ -30,7 +30,7 @@ class Conjur::Command::Variables < Conjur::Command
30
30
  end
31
31
 
32
32
  desc "Add a value"
33
- arg_name "variable value"
33
+ arg_name "variable ( value | STDIN )"
34
34
  command :"values:add" do |c|
35
35
  c.action do |global_options,options,args|
36
36
  id = require_arg(args, 'variable')
@@ -1,3 +1,3 @@
1
1
  module Conjur
2
- VERSION = "2.1.2"
2
+ VERSION = "2.1.3"
3
3
  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.2
4
+ version: 2.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-12 00:00:00.000000000 Z
13
+ date: 2013-04-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: conjur-api