Class: Soar::Authentication::IdentityUuidTranslator::Provider::Staff

Inherits:
Object
  • Object
show all
Defined in:
lib/soar/authentication/identity_uuid_translator/provider/staff.rb

Constant Summary collapse

ROLE =
"hetzner_staff_member"

Instance Method Summary collapse

Constructor Details

#initialize(identifier:, identity_registry:, role_generator: nil) ⇒ Staff

Returns a new instance of Staff.



11
12
13
14
15
# File 'lib/soar/authentication/identity_uuid_translator/provider/staff.rb', line 11

def initialize(identifier: , identity_registry: , role_generator: nil)
  @identifier = identifier
  @idr = identity_registry
  @role_generator = role_generator 
end

Instance Method Details

#uuidObject



17
18
19
20
21
22
23
24
25
26
# File 'lib/soar/authentication/identity_uuid_translator/provider/staff.rb', line 17

def uuid
  return @uuid if not @uuid.nil?
  identifiers = @idr.get_identifiers(@identifier)
  @uuid = identifiers[0]
  @role_generator.generate({
      "identity_uuid" => uuid,
      "identity_role" => ROLE
  }) if not @role_generator.nil? 
  return @uuid
end