Class: Saml::Kit::Builders::Assertion

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
XmlTemplatable
Defined in:
lib/saml/kit/builders/assertion.rb

Overview

This class is responsible for building a SAML Assertion

Constant Summary

Constants included from XmlTemplatable

XmlTemplatable::TEMPLATES_DIR

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from XmlTemplatable

#digest_method, #sign?, #signature_method, #template_name, #template_path

Constructor Details

#initialize(response_builder, embed_signature) ⇒ Assertion

Returns a new instance of Assertion.



18
19
20
21
22
# File 'lib/saml/kit/builders/assertion.rb', line 18

def initialize(response_builder, embed_signature)
  @response_builder = response_builder
  self.embed_signature = embed_signature
  self.default_name_id_format = Saml::Kit::Namespaces::UNSPECIFIED_NAMEID
end

Instance Attribute Details

#default_name_id_formatObject

Returns the value of attribute default_name_id_format.



16
17
18
# File 'lib/saml/kit/builders/assertion.rb', line 16

def default_name_id_format
  @default_name_id_format
end

Instance Method Details

#assertion_attributesObject



32
33
34
35
# File 'lib/saml/kit/builders/assertion.rb', line 32

def assertion_attributes
  return {} unless user.respond_to?(:assertion_attributes_for)
  user.assertion_attributes_for(request)
end

#name_idObject



28
29
30
# File 'lib/saml/kit/builders/assertion.rb', line 28

def name_id
  user.name_id_for(name_id_format)
end

#name_id_formatObject



24
25
26
# File 'lib/saml/kit/builders/assertion.rb', line 24

def name_id_format
  request.try(:name_id_format)
end

#signing_key_pairObject



37
38
39
# File 'lib/saml/kit/builders/assertion.rb', line 37

def signing_key_pair
  super || @response_builder.signing_key_pair
end