Sha256: 46814e274c8b5e1bda7f0966ae51edaf2ba6e1fa390e183e2ca7fc811e7bc332

Contents?: true

Size: 567 Bytes

Versions: 3

Compression:

Stored size: 567 Bytes

Contents

module SamlAuthenticatable
  class SamlMappedAttributes
    def initialize(attributes, attribute_map)
      @attributes = attributes
      @attribute_map = attribute_map
      @inverted_attribute_map = @attribute_map.invert
    end

    def saml_attribute_keys
      @attribute_map.keys
    end

    def resource_keys
      @attribute_map.values
    end

    def value_by_resource_key(key)
      value_by_saml_attribute_key(@inverted_attribute_map.fetch(String(key)))
    end

    def value_by_saml_attribute_key(key)
      @attributes[String(key)]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
devise_saml_authenticatable-1.4.1 lib/devise_saml_authenticatable/saml_mapped_attributes.rb
devise_saml_authenticatable-1.4.0 lib/devise_saml_authenticatable/saml_mapped_attributes.rb
devise_saml_authenticatable-1.3.2 lib/devise_saml_authenticatable/saml_mapped_attributes.rb