conjur-cli 4.5.0 → 4.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -89,13 +89,15 @@ class Conjur::Command::Roles < Conjur::Command
89
89
  arg_name "role member"
90
90
  command :grant_to do |c|
91
91
  c.desc "Whether to grant with admin option"
92
- c.switch :admin
92
+ c.switch [:a,:admin]
93
93
 
94
94
  c.action do |global_options,options,args|
95
95
  id = require_arg(args, 'role')
96
96
  member = require_arg(args, 'member')
97
97
  role = api.role(id)
98
- role.grant_to member, options[:admin]
98
+ grant_options = {}
99
+ grant_options[:admin_option] = true if options[:admin]
100
+ role.grant_to member, grant_options
99
101
  puts "Role granted"
100
102
  end
101
103
  end
@@ -19,5 +19,5 @@
19
19
  # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
20
  #
21
21
  module Conjur
22
- VERSION = "4.5.0"
22
+ VERSION = "4.5.1"
23
23
  end
@@ -2,6 +2,21 @@ require 'spec_helper'
2
2
 
3
3
  describe Conjur::Command::Roles, logged_in: true do
4
4
 
5
+ describe "role:grant_to" do
6
+ describe_command "role:grant_to test:a test:b" do
7
+ it "grants the role without options" do
8
+ Conjur::Role.any_instance.should_receive(:grant_to).with("test:b", {})
9
+ invoke
10
+ end
11
+ end
12
+ describe_command "role:grant_to --admin test:a test:b" do
13
+ it "grants the role with admin option" do
14
+ Conjur::Role.any_instance.should_receive(:grant_to).with("test:b", {admin_option: true})
15
+ invoke
16
+ end
17
+ end
18
+ end
19
+
5
20
  describe "role:create" do
6
21
  describe_command "role:create test:the-role" do
7
22
  it "creates the role with no options" do
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.5.0
4
+ version: 4.5.1
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: 2014-01-14 00:00:00.000000000 Z
13
+ date: 2014-01-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: conjur-api
@@ -291,7 +291,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
291
291
  version: '0'
292
292
  segments:
293
293
  - 0
294
- hash: 1871278325472077316
294
+ hash: 2904609356239992395
295
295
  required_rubygems_version: !ruby/object:Gem::Requirement
296
296
  none: false
297
297
  requirements:
@@ -300,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
300
300
  version: '0'
301
301
  segments:
302
302
  - 0
303
- hash: 1871278325472077316
303
+ hash: 2904609356239992395
304
304
  requirements: []
305
305
  rubyforge_project:
306
306
  rubygems_version: 1.8.25