conjur-asset-dsl2 0.6.0 → 0.6.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 +6 -0
- data/lib/conjur-asset-dsl2-version.rb +1 -1
- data/lib/conjur/dsl2/executor.rb +15 -3
- data/lib/conjur/dsl2/planner/facts.rb +2 -2
- data/lib/conjur/dsl2/types/records.rb +10 -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: 6a097eda9faf788b6594bc01a62527a3e5abbdd0
|
4
|
+
data.tar.gz: 5eeb8404b7aa9c0608c4696640075dc93e8169ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd0f36d920a9483b9e5ec4652a3361f1a424260243c4bc01a14995eb0897227eaacb5953e12a8ff2b8b8da885fbd1bb7c2f366481e2f01feed30bb7f0ba85f4e
|
7
|
+
data.tar.gz: 2afea097e8e27bd16801a654f59eb02b5997b185e5e933503f04af98153ceae54010bc39a461b8dfd32b2cb2492b1a48c098b9f860f98942cd35172977dd9683
|
data/CHANGELOG.md
CHANGED
data/lib/conjur/dsl2/executor.rb
CHANGED
@@ -66,7 +66,7 @@ module Conjur
|
|
66
66
|
|
67
67
|
def create path, parameters
|
68
68
|
request = Net::HTTP::Post.new [ @base_path, path ].join('/')
|
69
|
-
request.set_form_data parameters
|
69
|
+
request.set_form_data to_params(parameters)
|
70
70
|
send_request request
|
71
71
|
end
|
72
72
|
|
@@ -74,7 +74,7 @@ module Conjur
|
|
74
74
|
|
75
75
|
def update path, parameters
|
76
76
|
request = Net::HTTP::Put.new [ @base_path, path ].join('/')
|
77
|
-
request.set_form_data parameters
|
77
|
+
request.set_form_data to_params(parameters)
|
78
78
|
send_request request
|
79
79
|
end
|
80
80
|
|
@@ -82,7 +82,7 @@ module Conjur
|
|
82
82
|
|
83
83
|
def delete path, parameters
|
84
84
|
uri = URI.parse([ @base_path, path ].join('/'))
|
85
|
-
uri.query = [uri.query, parameters.
|
85
|
+
uri.query = [uri.query, parameters.to_query].compact.join('&')
|
86
86
|
request = Net::HTTP::Delete.new [ uri.path, '?', uri.query ].join
|
87
87
|
|
88
88
|
send_request request
|
@@ -113,6 +113,18 @@ module Conjur
|
|
113
113
|
rescue JSON::ParserError
|
114
114
|
# empty
|
115
115
|
end
|
116
|
+
|
117
|
+
# Convert parameter keys to rails []-style keys
|
118
|
+
def to_params params
|
119
|
+
params.inject({}) do |memo,entry|
|
120
|
+
key, value = entry
|
121
|
+
if value.is_a?(Array)
|
122
|
+
key = "#{key}[]"
|
123
|
+
end
|
124
|
+
memo[key] = value
|
125
|
+
memo
|
126
|
+
end
|
127
|
+
end
|
116
128
|
end
|
117
129
|
end
|
118
130
|
end
|
@@ -45,11 +45,11 @@ module Conjur
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def validate_role_exists! role
|
48
|
-
error("Role not found: #{role}") unless planner.role_exists?(role)
|
48
|
+
planner.error("Role not found: #{role}") unless planner.role_exists?(role)
|
49
49
|
end
|
50
50
|
|
51
51
|
def validate_resource_exists! resource
|
52
|
-
error("Resource not found: #{resource}") unless planner.resource_exists?(resource)
|
52
|
+
planner.error("Resource not found: #{resource}") unless planner.resource_exists?(resource)
|
53
53
|
end
|
54
54
|
|
55
55
|
protected
|
@@ -195,6 +195,16 @@ module Conjur
|
|
195
195
|
|
196
196
|
attribute :role, kind: :role, dsl_accessor: true, singular: true
|
197
197
|
attribute :layer, kind: :layer, dsl_accessor: true
|
198
|
+
|
199
|
+
alias role_accessor role
|
200
|
+
|
201
|
+
def role *args
|
202
|
+
if args.empty?
|
203
|
+
role_accessor || self.owner
|
204
|
+
else
|
205
|
+
role_accessor(*args)
|
206
|
+
end
|
207
|
+
end
|
198
208
|
end
|
199
209
|
|
200
210
|
class ManagedRole < Base
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conjur-asset-dsl2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Gilpin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: safe_yaml
|