Class: Conjur::Policy::HTTPExecutor
- Defined in:
- lib/conjur/policy/executor.rb
Instance Attribute Summary collapse
-
#api ⇒ Object
readonly
Returns the value of attribute api.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #execute(actions) ⇒ Object
-
#initialize(api) ⇒ HTTPExecutor
constructor
A new instance of HTTPExecutor.
Constructor Details
#initialize(api) ⇒ HTTPExecutor
Returns a new instance of HTTPExecutor.
49 50 51 52 |
# File 'lib/conjur/policy/executor.rb', line 49 def initialize api @api = api @context = {} end |
Instance Attribute Details
#api ⇒ Object (readonly)
Returns the value of attribute api.
46 47 48 |
# File 'lib/conjur/policy/executor.rb', line 46 def api @api end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
46 47 48 |
# File 'lib/conjur/policy/executor.rb', line 46 def context @context end |
Instance Method Details
#execute(actions) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/conjur/policy/executor.rb', line 54 def execute actions require 'net/https' uri = URI.parse(Conjur.configuration.appliance_url) use_ssl = uri.scheme == 'https' @base_path = uri.path Net::HTTP.start uri.host, uri.port, use_ssl: use_ssl do |http| @http = http actions.each do |step| invoke step end end @context end |