conjur-api 2.1.5 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/conjur-api/version.rb +1 -1
- data/lib/conjur/authn-api.rb +1 -1
- data/lib/conjur/core-api.rb +1 -1
- data/lib/conjur/resource.rb +2 -2
- data/lib/conjur/standard_methods.rb +1 -1
- data/spec/lib/api_spec.rb +57 -31
- metadata +4 -4
data/lib/conjur-api/version.rb
CHANGED
data/lib/conjur/authn-api.rb
CHANGED
data/lib/conjur/core-api.rb
CHANGED
data/lib/conjur/resource.rb
CHANGED
@@ -47,7 +47,7 @@ module Conjur
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
self["?
|
50
|
+
self["?permit&privilege=#{query_escape p}&role=#{query_escape role}"].post(options)
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
@@ -59,7 +59,7 @@ module Conjur
|
|
59
59
|
logger << " with options #{options.to_json}"
|
60
60
|
end
|
61
61
|
end
|
62
|
-
self["?
|
62
|
+
self["?deny&privilege=#{query_escape p}&role=#{query_escape role}"].post(options)
|
63
63
|
end
|
64
64
|
end
|
65
65
|
|
@@ -26,7 +26,7 @@ module Conjur
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def standard_show(host, type, id)
|
29
|
-
"Conjur::#{type.to_s.classify}".constantize.new(host, credentials)[ [type.to_s.pluralize,
|
29
|
+
"Conjur::#{type.to_s.classify}".constantize.new(host, credentials)[ [type.to_s.pluralize, fully_escape(id)].join('/') ]
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
data/spec/lib/api_spec.rb
CHANGED
@@ -13,37 +13,25 @@ shared_examples_for "API endpoint" do
|
|
13
13
|
should == "http://localhost:#{Conjur.service_base_port + port_offset}"
|
14
14
|
end
|
15
15
|
end
|
16
|
-
context "
|
17
|
-
before
|
18
|
-
Conjur.stub(:
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
28
|
-
its "default_host" do
|
29
|
-
should == "https://#{service_name}-ci-conjur.herokuapp.com"
|
30
|
-
end
|
31
|
-
end
|
32
|
-
context "in production" do
|
33
|
-
before(:each) do
|
34
|
-
Conjur.stub(:env).and_return "production"
|
35
|
-
end
|
36
|
-
its "default_host" do
|
37
|
-
should == "https://#{service_name}-v3-conjur.herokuapp.com"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
context "in named production version" do
|
41
|
-
before(:each) do
|
42
|
-
Conjur.stub(:env).and_return "production"
|
43
|
-
Conjur.stub(:stack).and_return "waffle"
|
16
|
+
context "'ci' account" do
|
17
|
+
before {
|
18
|
+
Conjur.stub(:account).and_return 'ci'
|
19
|
+
}
|
20
|
+
context "in stage" do
|
21
|
+
before(:each) do
|
22
|
+
Conjur.stub(:env).and_return "stage"
|
23
|
+
end
|
24
|
+
its "default_host" do
|
25
|
+
should == "https://#{service_name}-ci-conjur.herokuapp.com"
|
26
|
+
end
|
44
27
|
end
|
45
|
-
|
46
|
-
|
28
|
+
context "in ci" do
|
29
|
+
before(:each) do
|
30
|
+
Conjur.stub(:env).and_return "ci"
|
31
|
+
end
|
32
|
+
its "default_host" do
|
33
|
+
should == "https://#{service_name}-ci-conjur.herokuapp.com"
|
34
|
+
end
|
47
35
|
end
|
48
36
|
end
|
49
37
|
end
|
@@ -58,7 +46,45 @@ describe Conjur::API do
|
|
58
46
|
context "of authz service" do
|
59
47
|
let(:port_offset) { 100 }
|
60
48
|
let(:api) { Conjur::Authz::API }
|
61
|
-
|
49
|
+
subject { api }
|
50
|
+
context "'ci' account" do
|
51
|
+
before {
|
52
|
+
Conjur.stub(:account).and_return 'ci'
|
53
|
+
}
|
54
|
+
context "in stage" do
|
55
|
+
before(:each) do
|
56
|
+
Conjur.stub(:env).and_return "stage"
|
57
|
+
end
|
58
|
+
its "default_host" do
|
59
|
+
should == "https://authz-stage-conjur.herokuapp.com"
|
60
|
+
end
|
61
|
+
end
|
62
|
+
context "in ci" do
|
63
|
+
before(:each) do
|
64
|
+
Conjur.stub(:env).and_return "ci"
|
65
|
+
end
|
66
|
+
its "default_host" do
|
67
|
+
should == "https://authz-ci-conjur.herokuapp.com"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
context "in production" do
|
72
|
+
before(:each) do
|
73
|
+
Conjur.stub(:env).and_return "production"
|
74
|
+
end
|
75
|
+
its "default_host" do
|
76
|
+
should == "https://authz-v3-conjur.herokuapp.com"
|
77
|
+
end
|
78
|
+
end
|
79
|
+
context "in named production version" do
|
80
|
+
before(:each) do
|
81
|
+
Conjur.stub(:env).and_return "production"
|
82
|
+
Conjur.stub(:stack).and_return "waffle"
|
83
|
+
end
|
84
|
+
its "default_host" do
|
85
|
+
should == "https://authz-waffle-conjur.herokuapp.com"
|
86
|
+
end
|
87
|
+
end
|
62
88
|
end
|
63
89
|
context "of core service" do
|
64
90
|
let(:port_offset) { 200 }
|
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: 2.1.
|
4
|
+
version: 2.1.6
|
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-
|
13
|
+
date: 2013-04-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rest-client
|
@@ -206,7 +206,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
206
206
|
version: '0'
|
207
207
|
segments:
|
208
208
|
- 0
|
209
|
-
hash:
|
209
|
+
hash: 294077507062460443
|
210
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
211
|
none: false
|
212
212
|
requirements:
|
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
version: '0'
|
216
216
|
segments:
|
217
217
|
- 0
|
218
|
-
hash:
|
218
|
+
hash: 294077507062460443
|
219
219
|
requirements: []
|
220
220
|
rubyforge_project:
|
221
221
|
rubygems_version: 1.8.24
|