Class: SAML2::Role

Inherits:
Base
  • Object
show all
Includes:
OrganizationAndContacts, Signable
Defined in:
lib/saml2/role.rb

Direct Known Subclasses

SSO

Defined Under Namespace

Modules: Protocols

Instance Attribute Summary collapse

Attributes included from OrganizationAndContacts

#contacts, #organization

Attributes inherited from Base

#xml

Instance Method Summary collapse

Methods included from Signable

#sign, #signature, #signed?, #signing_key, #valid_signature?, #validate_signature

Methods inherited from Base

from_xml, #inspect, load_object_array, load_string_array, lookup_qname, #to_s, #to_xml

Constructor Details

#initializeRole

Returns a new instance of Role.



19
20
21
22
23
24
# File 'lib/saml2/role.rb', line 19

def initialize
  super
  @supported_protocols = Set.new
  @supported_protocols << Protocols::SAML2
  @keys = []
end

Instance Attribute Details

#keysObject



36
37
38
# File 'lib/saml2/role.rb', line 36

def keys
  @keys ||= load_object_array(xml, 'md:KeyDescriptor', Key)
end

#supported_protocolsObject



32
33
34
# File 'lib/saml2/role.rb', line 32

def supported_protocols
  @supported_protocols ||= xml['protocolSupportEnumeration'].split
end

Instance Method Details

#encryption_keysObject



44
45
46
# File 'lib/saml2/role.rb', line 44

def encryption_keys
  keys.select { |key| key.encryption? }
end

#from_xml(node) ⇒ Object



26
27
28
29
30
# File 'lib/saml2/role.rb', line 26

def from_xml(node)
  super
  @supported_protocols = nil
  @keys = nil
end

#signing_keysObject



40
41
42
# File 'lib/saml2/role.rb', line 40

def signing_keys
  keys.select { |key| key.signing? }
end