conjur-api 4.24.0 → 4.24.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/conjur-api/version.rb +1 -1
- data/lib/conjur/api/ldapsync.rb +3 -1
- data/spec/api/ldapsync_spec.rb +39 -18
- 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: 5947d8b6da3129ef22780755b92550a5fbfd57b0
|
4
|
+
data.tar.gz: 0acd1390453eae96cb6040f0fa167c35f6aa732b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92e2760b149238a95b86f1db50e59e21c04482cb8858581447fbe3edb9d12eb8ab60a5b72e628daa63908b116a37616052ce1a8d71e369d545c5989a8a5e869b
|
7
|
+
data.tar.gz: 5458008ccacf7c28e04de0d63ed00883e0df8120a06ac725816921ede7f6046936c069f14a72c8dfe4a88aa698ee202f69cf5ecbffc46a5913849cf4d871a00d
|
data/CHANGELOG.md
CHANGED
data/lib/conjur-api/version.rb
CHANGED
data/lib/conjur/api/ldapsync.rb
CHANGED
@@ -33,7 +33,9 @@ module Conjur
|
|
33
33
|
opts = credentials.dup.tap{ |h|
|
34
34
|
h[:headers][:accept] = format
|
35
35
|
}
|
36
|
-
|
36
|
+
|
37
|
+
dry_run = !!dry_run
|
38
|
+
|
37
39
|
resp = RestClient::Resource.new(Conjur.configuration.appliance_url, opts)['ldap-sync']['sync'].post({
|
38
40
|
config_name: config_name,
|
39
41
|
dry_run: dry_run
|
data/spec/api/ldapsync_spec.rb
CHANGED
@@ -4,23 +4,15 @@
|
|
4
4
|
# Permission is hereby granted, free of charge, to any person obtaining a copy of
|
5
5
|
# this software and associated documentation files (the "Software"), to deal in
|
6
6
|
# the Software without restriction, including without limitation the rights to
|
7
|
-
|
8
|
-
# the Software, and to permit persons to whom the Software is furnished to do so,
|
9
|
-
# subject to the following conditions:
|
10
|
-
#
|
11
|
-
# The above copyright notice and this permission notice shall be included in all
|
12
|
-
# copies or substantial portions of the Software.
|
13
|
-
#
|
14
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
15
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
16
|
-
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
17
|
-
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
18
|
-
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
7
|
+
|
19
8
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
20
9
|
#
|
21
10
|
require 'spec_helper'
|
11
|
+
require 'helpers/request_helpers'
|
22
12
|
|
23
13
|
describe Conjur::API, api: :dummy do
|
14
|
+
include RequestHelpers
|
15
|
+
|
24
16
|
let(:appliance_url){ "http://example.com/api" }
|
25
17
|
let(:ldapsync_url){ "#{appliance_url}/ldap-sync/sync" }
|
26
18
|
let(:response_json){
|
@@ -34,21 +26,50 @@ describe Conjur::API, api: :dummy do
|
|
34
26
|
}
|
35
27
|
}
|
36
28
|
let(:response){ double('response', body: response_json.to_json) }
|
29
|
+
let(:dry_run) { true }
|
37
30
|
|
38
31
|
before do
|
39
32
|
allow(Conjur.configuration).to receive(:appliance_url).and_return appliance_url
|
40
33
|
allow(Conjur::API).to receive_messages(ldap_sync_now: ldapsync_url)
|
34
|
+
expect_request(
|
35
|
+
url: ldapsync_url,
|
36
|
+
method: :post,
|
37
|
+
headers: credentials[:headers],
|
38
|
+
payload: {config_name: 'default', dry_run: dry_run}
|
39
|
+
).and_return response
|
41
40
|
end
|
42
41
|
|
43
42
|
describe "#ldap_sync_now" do
|
44
43
|
it "POSTs /sync" do
|
45
|
-
expect_request(
|
46
|
-
url: ldapsync_url,
|
47
|
-
method: :post,
|
48
|
-
headers: credentials[:headers],
|
49
|
-
payload: {config_name: 'default', dry_run: true}
|
50
|
-
).and_return response
|
51
44
|
api.ldap_sync_now('default', 'application/json', true)
|
52
45
|
end
|
53
46
|
end
|
47
|
+
|
48
|
+
describe "#ldap_sync_now" do
|
49
|
+
let(:dry_run) { true }
|
50
|
+
it "POSTs /sync with dry_run set to true" do
|
51
|
+
api.ldap_sync_now('default', 'application/json', true)
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "#ldap_sync_now" do
|
56
|
+
let(:dry_run) { false }
|
57
|
+
it "POSTs /sync with dry_run set to false" do
|
58
|
+
api.ldap_sync_now('default', 'application/json', false)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe "#ldap_sync_now" do
|
63
|
+
let(:dry_run) { true }
|
64
|
+
it "POSTs /sync with truthy dry_run value" do
|
65
|
+
api.ldap_sync_now('default', 'application/json', 1)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
describe "#ldap_sync_now" do
|
70
|
+
let(:dry_run) { false }
|
71
|
+
it "POSTs /sync with falsey dry_run value" do
|
72
|
+
api.ldap_sync_now('default', 'application/json', nil)
|
73
|
+
end
|
74
|
+
end
|
54
75
|
end
|
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.24.
|
4
|
+
version: 4.24.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafal Rzepecki
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|