Class: Soar::Registry::Identity::Provider::Staff::Uuid
- Inherits:
-
SoarIdm::IdmApi
- Object
- SoarIdm::IdmApi
- Soar::Registry::Identity::Provider::Staff::Uuid
- Defined in:
- lib/soar/registry/identity/provider/staff/uuid.rb
Overview
Work in progress. Do not use.
Instance Method Summary collapse
-
#calculate_all_attributes(identity) ⇒ Hash
Hash of attributes keyed by role.
-
#calculate_attributes(identity, role) ⇒ Hash
A hash of attributes.
-
#calculate_identifiers(identity) ⇒ Array
List of identifiers.
-
#calculate_identities(identifier) ⇒ Hash
An identity.
-
#calculate_roles(identity) ⇒ Array
List of roles.
-
#initialize(directories:, fetch_index: "entryuuid") ⇒ Uuid
constructor
A new instance of Uuid.
Constructor Details
#initialize(directories:, fetch_index: "entryuuid") ⇒ Uuid
Returns a new instance of Uuid.
19 20 21 22 23 |
# File 'lib/soar/registry/identity/provider/staff/uuid.rb', line 19 def initialize(directories:, fetch_index: "entryuuid") raise Soar::Registry::Identity::Error::MissingRequiredDirectoryError, ':identity key is required' if not directories.key?(:identity) @identity_directory = directories[:identity] @roles_directory = directories.key?(:roles) ? directories[:roles] : directories[:identity] end |
Instance Method Details
#calculate_all_attributes(identity) ⇒ Hash
Returns Hash of attributes keyed by role.
64 65 66 |
# File 'lib/soar/registry/identity/provider/staff/uuid.rb', line 64 def calculate_all_attributes(identity) @directory.fetch(identity[@roles_directory.index[0]]) end |
#calculate_attributes(identity, role) ⇒ Hash
Returns A hash of attributes.
55 56 57 58 59 |
# File 'lib/soar/registry/identity/provider/staff/uuid.rb', line 55 def calculate_attributes(identity, role) entry = @roles_directory.fetch(identity[@roles_directory.index[0]]) return nil if not entry { role => entry['roles'][role] } end |
#calculate_identifiers(identity) ⇒ Array
Returns list of identifiers.
42 43 44 45 46 47 48 49 |
# File 'lib/soar/registry/identity/provider/staff/uuid.rb', line 42 def calculate_identifiers(identity) indexes = @identity_directory.index identifiers = [] indexes.each { |index| identifiers << identity[index] } identifiers end |
#calculate_identities(identifier) ⇒ Hash
Returns an identity.
72 73 74 |
# File 'lib/soar/registry/identity/provider/staff/uuid.rb', line 72 def calculate_identities(identifier) return [@identity_directory.fetch(identifier)] end |
#calculate_roles(identity) ⇒ Array
Returns list of roles.
28 29 30 31 32 33 34 35 36 |
# File 'lib/soar/registry/identity/provider/staff/uuid.rb', line 28 def calculate_roles(identity) entry = @roles_directory.fetch(identity[@roles_directory.index[0]]) return nil if not entry roles = [] entry['roles'].each do |role, attributes| roles << role end roles end |