class Soar::Registry::Identity::Provider::Stub::Uuid

Work in progress. Do not use.

Public Class Methods

new(directory:) click to toggle source

@param [Array<Hash{String => Hash, String, Number}>] identities @param [Soar::Registry::Directory] directory @raise [ArgumentError]

# File lib/soar/registry/identity/provider/stub/uuid.rb, line 19
def initialize(directory:)
  @directory = directory
end

Public Instance Methods

calculate_all_attributes(identity_uuid) click to toggle source

@param [String] identity_uuid @return [Hash{String => String, Number, Hash, Array}] A hash of attributes

# File lib/soar/registry/identity/provider/stub/uuid.rb, line 58
def calculate_all_attributes(identity_uuid)
  begin
    identity = @directory.fetch(identity_uuid)
    return identity
  rescue Soar::Registry::Directory::Error::NoEntriesFoundError => e
    raise SoarIdm::IdentityError, e.message
  end
end
calculate_attributes(identity_uuid, role) click to toggle source

@param [String] identity_uuid @param [String] role @return [Hash{String => String, Number, Hash, Array}] A hash of attributes

# File lib/soar/registry/identity/provider/stub/uuid.rb, line 48
def calculate_attributes(identity_uuid, role)
  identity = @directory.fetch(identity_uuid)
  return {
    role => identity['roles'].key?(role) ? identity['roles'][role] : {}
  } 
end
calculate_identifiers(identity_uuid) click to toggle source

@param [String] identity_uuid @return [Array<String,Number>] list of identifiers

# File lib/soar/registry/identity/provider/stub/uuid.rb, line 40
def calculate_identifiers(identity_uuid)
end
calculate_identities(identity_uuid) click to toggle source

@param [String] identity_uuid @return [Array<String>] identities

# File lib/soar/registry/identity/provider/stub/uuid.rb, line 71
def calculate_identities(identity_uuid)
  return [identity_uuid]
end
calculate_roles(identity_uuid) click to toggle source

@param [String] identity_uuid @return [Array<String>] list of roles

# File lib/soar/registry/identity/provider/stub/uuid.rb, line 27
def calculate_roles(identity_uuid)
  begin
    identity = @directory.fetch(identity_uuid)
    return identity.key?('roles') ? identity['roles'].keys : []
  rescue Soar::Registry::Directory::Error::NoEntriesFoundError => e
    return []
  end
end