Class: Soar::Authentication::IdentityUuidTranslator::Test::OrchestrationProvider::Base
- Inherits:
-
Object
- Object
- Soar::Authentication::IdentityUuidTranslator::Test::OrchestrationProvider::Base
- Defined in:
- lib/soar/authentication/identity_uuid_translator/test/orchestration_provider/base.rb
Instance Method Summary collapse
- #given_identity_uuid_translator ⇒ Object
- #given_role_generator ⇒ Object
- #given_roles_directory ⇒ Object
- #request_identity_uuid ⇒ Object
Instance Method Details
#given_identity_uuid_translator ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/soar/authentication/identity_uuid_translator/test/orchestration_provider/base.rb', line 31 def given_identity_uuid_translator @identity_uuid_translator = Soar::Authentication::IdentityUuidTranslator::Factory::create({ value: @identifier, selector: ObjectSelector.new( ObjectSelector::Provider::RegexRuleList.new({ rules: [ { regex: /\A[\w+\-.][email protected]\z/i, object: Soar::Authentication::IdentityUuidTranslator::Provider::Staff.new( identifier: @identifier, identity_registry: @identity_registry, role_generator: @role_generator ? @role_generator : nil ) }, { regex: /\A[\w+\-.]+@.+/i, object: Soar::Authentication::IdentityUuidTranslator::Provider::Customer.new( identifier: @identifier, identity_registry: @identity_registry, uuid_generator: Soar::Authentication::IdentityUuidTranslator::UuidGenerator, role_generator: @role_generator ? @role_generator : nil ) }, { regex: /\A[CF]{0,1}\d+\z/, object: Soar::Authentication::IdentityUuidTranslator::Provider::Customer.new( identifier: @identifier, identity_registry: @identity_registry, uuid_generator: Soar::Authentication::IdentityUuidTranslator::UuidGenerator, role_generator: @role_generator ? @role_generator : nil ) } ] }) ) }) end |
#given_role_generator ⇒ Object
27 28 29 |
# File 'lib/soar/authentication/identity_uuid_translator/test/orchestration_provider/base.rb', line 27 def given_role_generator @role_generator = Soar::Authentication::IdentityUuidTranslator::RoleGenerator.new(@roles_directory) end |
#given_roles_directory ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/soar/authentication/identity_uuid_translator/test/orchestration_provider/base.rb', line 16 def given_roles_directory roles_directory_configuration = YAML.load_file("config/#{ENV['ROLES_DIRECTORY_CONFIG_FILE']}") @roles_directory = Soar::Registry::Directory.new( Soar::Registry::Directory::Provider::DynamoDb.new(Hashie.symbolize_keys(roles_directory_configuration['config'])) ) @roles_directory.provider.recreate_table({ name: roles_directory_configuration['config']['table'][:name], structure: JSON.parse(File.read("lib/soar/authentication/identity_uuid_translator/test/fixtures/roles_table.json")) }) end |
#request_identity_uuid ⇒ Object
69 70 71 |
# File 'lib/soar/authentication/identity_uuid_translator/test/orchestration_provider/base.rb', line 69 def request_identity_uuid @uuid = @identity_uuid_translator.uuid() end |