conjur-api 4.9.2 → 4.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/conjur-api/version.rb +1 -1
- data/lib/conjur/api/users.rb +5 -1
- data/lib/conjur/user.rb +5 -1
- data/spec/api/users_spec.rb +34 -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: 433c76ede7475ca9af07431734069c9692ace125
|
4
|
+
data.tar.gz: 842baac408d16a623dc0539dbb312d970040eafc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: beb95d37603ab34b37f33e297d1c8ba5efb90d800432def027f110a895782d6e5eb730d220ac02430d95320ad684b0edb3d3ff76d0b04c799dc75ec309ad6458
|
7
|
+
data.tar.gz: 115862f1080d52472f0cae83359f86526d6166668af11fa603cc0b38170c0f23a6fe6646c90eb62965839f789b51aefa624111212403174c4304386191da3e21
|
data/lib/conjur-api/version.rb
CHANGED
data/lib/conjur/api/users.rb
CHANGED
@@ -29,5 +29,9 @@ module Conjur
|
|
29
29
|
def user login
|
30
30
|
standard_show Conjur::Core::API.host, :user, login
|
31
31
|
end
|
32
|
+
|
33
|
+
def find_users options
|
34
|
+
JSON.parse( RestClient::Resource.new(Conjur::Core::API.host, credentials)["users/search?#{options.to_query}"].get )
|
35
|
+
end
|
32
36
|
end
|
33
|
-
end
|
37
|
+
end
|
data/lib/conjur/user.rb
CHANGED
data/spec/api/users_spec.rb
CHANGED
@@ -8,6 +8,40 @@ describe Conjur::API, api: :dummy do
|
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
+
describe 'user#update' do
|
12
|
+
let(:userid) { "alice@wonderland" }
|
13
|
+
it "PUTs to /users/:id?uidnumber=:uidnumber" do
|
14
|
+
RestClient::Request.should_receive(:execute).with(
|
15
|
+
method: :put,
|
16
|
+
url: "#{core_host}/users/#{api.fully_escape(userid)}",
|
17
|
+
headers: credentials[:headers],
|
18
|
+
payload: { uidnumber: 12345 }
|
19
|
+
)
|
20
|
+
api.user(userid).update(uidnumber: 12345)
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
describe "find_users" do
|
26
|
+
|
27
|
+
let(:search_parameters) { {uidnumber: 12345} }
|
28
|
+
let(:search_result) { ["someuser"].to_json }
|
29
|
+
|
30
|
+
it "GETs /users/search with appropriate options, and returns parsed JSON response" do
|
31
|
+
RestClient::Request.should_receive(:execute).with(
|
32
|
+
method: :get,
|
33
|
+
url: "#{core_host}/users/search?uidnumber=12345",
|
34
|
+
headers: credentials[:headers]
|
35
|
+
).and_return search_result
|
36
|
+
|
37
|
+
parsed = double()
|
38
|
+
|
39
|
+
JSON.should_receive(:parse).with(search_result).and_return(parsed)
|
40
|
+
|
41
|
+
api.find_users(search_parameters).should == parsed
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
11
45
|
describe '#user' do
|
12
46
|
it_should_behave_like 'standard_show with', :user, :login do
|
13
47
|
let(:invoke) { api.user :login }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conjur-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafał Rzepecki
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-08-
|
12
|
+
date: 2014-08-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|