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

Returns a new instance of Staff.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 11

def initialize
  @entry = {
    "uuid" => SecureRandom.uuid,
    "email" => '[email protected]'
  }
  @identity = Soar::Authentication::Identity::Factory.create({
    authenticated_identifier: @entry["email"],
    directory_configurations:  {
      "staff" => {
        "provider" => 'Soar::Registry::Directory::Provider::Stub',
        "config" => {
          "table" => "identity",
          "primary_key" =>"uuid",
          "index" => ["uuid", "email"]
        }
      },
      "customer" => {},
      "domain" => {}
    }
  })
end

Instance Method Details

#given_authenticated_identifierNil

Returns:

  • (Nil)


43
44
45
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 43

def given_authenticated_identifier
  @entry["email"]
end

#given_existing_identityNil

Returns:

  • (Nil)


36
37
38
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 36

def given_existing_identity
  @identity.directory.put(@entry)
end

#request_uuidNil

Returns:

  • (Nil)


50
51
52
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 50

def request_uuid
  @identity.uuid
end

#role?Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 64

def role?
  @identity.role == 'staff'
end

#uuid?Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/soar/authentication/identity/test/orchestration_provider/staff.rb', line 57

def uuid?
  @entry["uuid"] == @identity.uuid
end