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