class Conjur::Policy::Executor::Base

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.

Attributes

actions[R]
api[R]
statement[R]

Public Class Methods

new(api, statement, actions) click to toggle source
# File lib/conjur/policy/executor/base.rb, line 14
def initialize api, statement, actions
  @api = api
  @statement = statement
  @actions = actions
end

Public Instance Methods

action(obj) click to toggle source
# File lib/conjur/policy/executor/base.rb, line 20
def action obj
  @actions.push obj
end
execute() click to toggle source
# File lib/conjur/policy/executor/base.rb, line 24
def execute
  raise "execute not implemented in #{self.class.name}"
end
resource_path(record = nil) click to toggle source
# File lib/conjur/policy/executor/base.rb, line 28
def resource_path record = nil
  record ||= self.statement
  [ "authz", record.account, "resources", record.resource_kind, path_escape(record.id) ].join('/')
end
role_path(record = nil) click to toggle source
# File lib/conjur/policy/executor/base.rb, line 33
def role_path record = nil
  record ||= self.statement
  [ "authz", record.account, "roles", record.role_kind, path_escape(record.id) ].join('/')
end