Class: Conjur::Policy::Executor::Base
- Includes:
- Logger
- Defined in:
- lib/conjur/policy/executor/base.rb
Overview
Builds a list of execution actions for a statement. The statement is an object from Conjur::Policy::Types. Each execution action is an HTTP method, a request path, and request parameters.
Instance Attribute Summary collapse
-
#actions ⇒ Object
readonly
Returns the value of attribute actions.
-
#statement ⇒ Object
readonly
Returns the value of attribute statement.
Instance Method Summary collapse
- #action(obj) ⇒ Object
- #execute ⇒ Object
-
#initialize(statement, actions) ⇒ Base
constructor
A new instance of Base.
- #resource_path(record = nil) ⇒ Object
- #role_path(record = nil) ⇒ Object
Methods included from Logger
Constructor Details
#initialize(statement, actions) ⇒ Base
Returns a new instance of Base.
11 12 13 14 |
# File 'lib/conjur/policy/executor/base.rb', line 11 def initialize statement, actions @statement = statement @actions = actions end |
Instance Attribute Details
#actions ⇒ Object (readonly)
Returns the value of attribute actions.
9 10 11 |
# File 'lib/conjur/policy/executor/base.rb', line 9 def actions @actions end |
#statement ⇒ Object (readonly)
Returns the value of attribute statement.
9 10 11 |
# File 'lib/conjur/policy/executor/base.rb', line 9 def statement @statement end |
Instance Method Details
#action(obj) ⇒ Object
16 17 18 |
# File 'lib/conjur/policy/executor/base.rb', line 16 def action obj @actions.push obj end |
#execute ⇒ Object
20 21 22 |
# File 'lib/conjur/policy/executor/base.rb', line 20 def execute raise "execute not implemented in #{self.class.name}" end |
#resource_path(record = nil) ⇒ Object
24 25 26 27 |
# File 'lib/conjur/policy/executor/base.rb', line 24 def resource_path record = nil record ||= self.statement [ "authz", record.account, "resources", record.resource_kind, record.id ].join('/') end |
#role_path(record = nil) ⇒ Object
29 30 31 32 |
# File 'lib/conjur/policy/executor/base.rb', line 29 def role_path record = nil record ||= self.statement [ "authz", record.account, "roles", record.role_kind, record.id ].join('/') end |