Class: Soar::Authentication::Identity::Test::OrchestrationProvider::Staff

Inherits:
Object
  • Object
show all
Defined in:
lib/soar/authentication/identity/test/orchestration_provider/staff.rb

Instance Method Summary collapse

Constructor Details

#initializeStaff



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_identifierNil



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_identityNil



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_uuidNil



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