Class: Conjur::Policy::Executor::Update
Instance Attribute Summary
Attributes inherited from Base
#actions, #api, #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
28
29
30
|
# File 'lib/conjur/policy/executor/update.rb', line 28
def annotate_record
record
end
|
#attribute_names ⇒ Object
36
37
38
|
# File 'lib/conjur/policy/executor/update.rb', line 36
def attribute_names
record.custom_attribute_names
end
|
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/conjur/policy/executor/update.rb', line 5
def execute
attribute_names.each do |attr|
value = record.send(attr)
if value
action({
'method' => 'put',
'path' => update_path,
'parameters' => { attr.to_s => value }
})
end
end
annotate
end
|
#kind_path ⇒ Object
20
21
22
|
# File 'lib/conjur/policy/executor/update.rb', line 20
def kind_path
record.resource_kind.pluralize
end
|
32
33
34
|
# File 'lib/conjur/policy/executor/update.rb', line 32
def record
statement.record
end
|
#update_path ⇒ Object
24
25
26
|
# File 'lib/conjur/policy/executor/update.rb', line 24
def update_path
[ kind_path, fully_escape(statement.record.id) ].join('/')
end
|