Class: Conjur::Policy::Executor::Update
Instance Attribute Summary
Attributes inherited from Base
#actions, #statement
Instance Method Summary
collapse
Methods included from Annotate
#annotate, #update_annotation_path
Methods inherited from Base
#action, #initialize, #resource_path, #role_path
Methods included from Logger
included
Instance Method Details
#annotate_record ⇒ Object
27
28
29
|
# File 'lib/conjur/policy/executor/update.rb', line 27
def annotate_record
statement.record
end
|
5
6
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/conjur/policy/executor/update.rb', line 5
def execute
statement.record.custom_attribute_names.each do |attr|
value = statement.record.send(attr)
action({
'method' => 'put',
'path' => update_path,
'parameters' => { attr.to_s => value }
})
end
annotate
end
|
#kind_path ⇒ Object
18
19
20
|
# File 'lib/conjur/policy/executor/update.rb', line 18
def kind_path
statement.record.resource_kind.pluralize
end
|
#update_path ⇒ Object
22
23
24
25
|
# File 'lib/conjur/policy/executor/update.rb', line 22
def update_path
require 'cgi'
[ kind_path, CGI.escape(statement.record.id) ].join('/')
end
|