Class: Saml::Assertion
- Inherits:
-
Object
- Object
- Saml::Assertion
- Includes:
- Base, XMLHelpers
- Defined in:
- lib/saml/assertion.rb
Instance Method Summary collapse
- #add_attribute(key, value) ⇒ Object
- #fetch_attribute(key) ⇒ Object
-
#initialize(*args) ⇒ Assertion
constructor
A new instance of Assertion.
Methods included from XMLHelpers
Constructor Details
#initialize(*args) ⇒ Assertion
Returns a new instance of Assertion.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/saml/assertion.rb', line 29 def initialize(*args) = args. @subject = Saml::Elements::Subject.new(:name_id => .delete(:name_id), :name_id_format => .delete(:name_id_format), :recipient => .delete(:recipient), :in_response_to => .delete(:in_response_to)) @conditions = Saml::Elements::Conditions.new(:audience => .delete(:audience)) @authn_statement = Saml::Elements::AuthnStatement.new(:authn_instant => Time.now, :address => .delete(:address), :authn_context_class_ref => .delete(:authn_context_class_ref), :session_index => .delete(:session_index)) super(*(args << )) @_id ||= Saml.generate_id @issue_instant ||= Time.now @issuer ||= Saml::Config.entity_id @version ||= Saml::SAML_VERSION end |
Instance Method Details
#add_attribute(key, value) ⇒ Object
47 48 49 50 51 |
# File 'lib/saml/assertion.rb', line 47 def add_attribute(key, value) self.attribute_statement ||= Saml::Elements::AttributeStatement.new self.attribute_statement.attribute ||= [] self.attribute_statement.attribute << Saml::Elements::Attribute.new(name: key, attribute_value: value) end |
#fetch_attribute(key) ⇒ Object
53 54 55 56 57 |
# File 'lib/saml/assertion.rb', line 53 def fetch_attribute(key) return unless self.attribute_statement return unless self.attribute_statement.attribute attribute_statement.fetch_attribute(key) end |