Class: RSAML::Protocol::Message
- Inherits:
-
Object
- Object
- RSAML::Protocol::Message
- Defined in:
- lib/rsaml/protocol/message.rb
Overview
Base class for messages. This class should not be instantiated directly, rather the Request and Response classes should be used.
Instance Attribute Summary collapse
-
#consent ⇒ Object
Indicates whether or not (and under what conditions) consent has been obtained from a principal in the sending of this message.
-
#destination ⇒ Object
A URI reference indicating the address to which this message has been sent.
-
#id ⇒ Object
An identifier for the message.
-
#issue_instant ⇒ Object
The time instant of issue of the message.
-
#issuer ⇒ Object
Identifies the entity that generated the message.
-
#signature ⇒ Object
An XML Signature that authenticates the requestor or responder and provides message integrity.
-
#version ⇒ Object
The version of this message.
Instance Method Summary collapse
-
#extensions ⇒ Object
This extension point contains optional protocol message extension elements that are agreed on between the communicating parties.
-
#initialize ⇒ Message
constructor
Initialize the message instance.
-
#validate ⇒ Object
Validate the request structure.
Constructor Details
#initialize ⇒ Message
Initialize the message instance
36 37 38 39 40 |
# File 'lib/rsaml/protocol/message.rb', line 36 def initialize @id = UUID.new.generate @version = "2.0" @issue_instant = Time.now.utc end |
Instance Attribute Details
#consent ⇒ Object
Indicates whether or not (and under what conditions) consent has been obtained from a principal in the sending of this message. If no Consent value is provided, the identifier
urn:oasis:names:tc:SAML:2.0:consent:unspecified is in effect.
27 28 29 |
# File 'lib/rsaml/protocol/message.rb', line 27 def @consent end |
#destination ⇒ Object
A URI reference indicating the address to which this message has been sent. This is useful to prevent malicious forwarding of messages to unintended recipients, a protection that is required by some protocol bindings. If it is present, the actual recipient MUST check that the URI reference identifies the location at which the message was sent or received. If it does not, the response MUST be discarded. Some protocol bindings may require the use of this attribute.
22 23 24 |
# File 'lib/rsaml/protocol/message.rb', line 22 def destination @destination end |
#id ⇒ Object
An identifier for the message. It is of type xs:ID and MUST follow the requirements specified in Section 1.3.4 of the SAML 2.0 specification for identifier uniqueness.
9 10 11 |
# File 'lib/rsaml/protocol/message.rb', line 9 def id @id end |
#issue_instant ⇒ Object
The time instant of issue of the message. The time value must be encoded in UTC.
15 16 17 |
# File 'lib/rsaml/protocol/message.rb', line 15 def issue_instant @issue_instant end |
#issuer ⇒ Object
Identifies the entity that generated the message.
30 31 32 |
# File 'lib/rsaml/protocol/message.rb', line 30 def issuer @issuer end |
#signature ⇒ Object
An XML Signature that authenticates the requestor or responder and provides message integrity.
33 34 35 |
# File 'lib/rsaml/protocol/message.rb', line 33 def signature @signature end |
#version ⇒ Object
The version of this message. The identifier for the version of SAML defined in this specification is “2.0”.
12 13 14 |
# File 'lib/rsaml/protocol/message.rb', line 12 def version @version end |
Instance Method Details
#extensions ⇒ Object
This extension point contains optional protocol message extension elements that are agreed on between the communicating parties.
44 45 46 |
# File 'lib/rsaml/protocol/message.rb', line 44 def extensions @extionsion ||= [] end |
#validate ⇒ Object
Validate the request structure
49 50 51 52 53 54 |
# File 'lib/rsaml/protocol/message.rb', line 49 def validate raise ValidationError, "ID is required" if id.nil? raise ValidationError, "Version is required" if version.nil? raise ValidationError, "Issue instant is required" if issue_instant.nil? raise ValidationError, "Issue instant must be UTC" unless issue_instant.utc? end |