Class: Soar::Policy::AccessManager::Test::OrchestrationProvider::Stub
- Inherits:
-
Object
- Object
- Soar::Policy::AccessManager::Test::OrchestrationProvider::Stub
- Defined in:
- lib/soar/policy/access_manager/test/orchestration_provider/stub.rb
Instance Method Summary collapse
- #authorized ⇒ Object
- #authorized? ⇒ Boolean
- #deny_access ⇒ Object
- #grant_access ⇒ Object
-
#initialize ⇒ Stub
constructor
A new instance of Stub.
- #no_policy ⇒ Object
- #notification ⇒ Object
Constructor Details
#initialize ⇒ Stub
Returns a new instance of Stub.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/soar/policy/access_manager/test/orchestration_provider/stub.rb', line 12 def initialize @meta = { 'service_identifier1' => { 'policy' => 'policy1' } } @policies = { 'policy1' => { 'resource_identifier1' => ['authentication_identifier1'], 'resource_identifier2' => [] } } @request = { params: {}, authentication_identifier: 'authentication_identifier1' } end |
Instance Method Details
#authorized ⇒ Object
55 56 57 |
# File 'lib/soar/policy/access_manager/test/orchestration_provider/stub.rb', line 55 def @response['data']['approved'] end |
#authorized? ⇒ Boolean
49 50 51 52 53 |
# File 'lib/soar/policy/access_manager/test/orchestration_provider/stub.rb', line 49 def model_provider = Soar::Policy::AccessManager::ModelProvider::Stub.new(meta: @meta, policies: @policies) model = Soar::Policy::AccessManager::Model.new(model_provider) @response = model.(service_identifier: @service_identifier, resource_identifier: @resource_identifier, request: @request) end |
#deny_access ⇒ Object
35 36 37 38 |
# File 'lib/soar/policy/access_manager/test/orchestration_provider/stub.rb', line 35 def deny_access @service_identifier = 'service_identifier1' @resource_identifier = 'resource_identifier2' end |
#grant_access ⇒ Object
30 31 32 33 |
# File 'lib/soar/policy/access_manager/test/orchestration_provider/stub.rb', line 30 def grant_access @service_identifier = 'service_identifier1' @resource_identifier = 'resource_identifier1' end |
#no_policy ⇒ Object
40 41 42 43 |
# File 'lib/soar/policy/access_manager/test/orchestration_provider/stub.rb', line 40 def no_policy @service_identifier = 'service_identifier2' @resource_identifier = nil end |
#notification ⇒ Object
45 46 47 |
# File 'lib/soar/policy/access_manager/test/orchestration_provider/stub.rb', line 45 def notification @response['data']['notifications'] end |