Class: Soar::Authentication::Identity::Test::OrchestrationProvider::Staff
- Inherits:
-
Object
- Object
- Soar::Authentication::Identity::Test::OrchestrationProvider::Staff
- Defined in:
- lib/soar/authentication/identity/test/orchestration_provider/staff.rb
Instance Method Summary collapse
- #given_authenticated_identifier ⇒ Nil
- #given_existing_identity ⇒ Nil
-
#initialize ⇒ Staff
constructor
A new instance of Staff.
- #request_uuid ⇒ Nil
- #uuid? ⇒ Boolean
Constructor Details
#initialize ⇒ Staff
12 13 14 15 16 17 18 19 20 |
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 12 def initialize() directory_provider = Soar::Registry::Directory::Provider::Stub.new({ table: "mytable", primary_key: "uuid", index: ["uuid", "email"] }) @directory = Soar::Registry::Directory.new(directory_provider) end |
Instance Method Details
#given_authenticated_identifier ⇒ Nil
39 40 41 42 43 44 |
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 39 def given_authenticated_identifier @identity = Soar::Authentication::Identity::Factory.create({ directory: @directory, authenticated_identifier: @entry["email"] }) end |
#given_existing_identity ⇒ Nil
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 25 def given_existing_identity @entry = { "uuid" => SecureRandom.uuid, "email" => '[email protected]' } @directory.put(@entry) end |
#request_uuid ⇒ Nil
49 50 51 |
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 49 def request_uuid @identity.uuid end |
#uuid? ⇒ Boolean
56 57 58 |
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 56 def uuid? @entry["uuid"] == @identity.uuid end |