Class: Saml::Kit::Builders::Response
- Inherits:
-
Object
- Object
- Saml::Kit::Builders::Response
- Includes:
- Templatable
- Defined in:
- lib/saml/kit/builders/response.rb
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#encrypt ⇒ Object
Returns the value of attribute encrypt.
-
#id ⇒ Object
Returns the value of attribute id.
-
#issuer ⇒ Object
Returns the value of attribute issuer.
-
#now ⇒ Object
Returns the value of attribute now.
-
#reference_id ⇒ Object
Returns the value of attribute reference_id.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#status_code ⇒ Object
Returns the value of attribute status_code.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes included from Templatable
Instance Method Summary collapse
- #build ⇒ Object
- #encryption_certificate ⇒ Object
-
#initialize(user, request, configuration: Saml::Kit.configuration) ⇒ Response
constructor
A new instance of Response.
- #want_assertions_signed ⇒ Object
Methods included from Templatable
#encrypt?, #encryption_for, #render, #sign=, #sign?, #signature_for, #signatures, #to_xml
Constructor Details
#initialize(user, request, configuration: Saml::Kit.configuration) ⇒ Response
Returns a new instance of Response.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/saml/kit/builders/response.rb', line 12 def initialize(user, request, configuration: Saml::Kit.configuration) @user = user @request = request @id = Id.generate @reference_id = Id.generate @now = Time.now.utc @version = "2.0" @status_code = Namespaces::SUCCESS @issuer = configuration.issuer @embed_signature = want_assertions_signed @encrypt = encryption_certificate.present? @configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
10 11 12 |
# File 'lib/saml/kit/builders/response.rb', line 10 def configuration @configuration end |
#destination ⇒ Object
Returns the value of attribute destination.
9 10 11 |
# File 'lib/saml/kit/builders/response.rb', line 9 def destination @destination end |
#encrypt ⇒ Object
Returns the value of attribute encrypt.
9 10 11 |
# File 'lib/saml/kit/builders/response.rb', line 9 def encrypt @encrypt end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/saml/kit/builders/response.rb', line 7 def id @id end |
#issuer ⇒ Object
Returns the value of attribute issuer.
9 10 11 |
# File 'lib/saml/kit/builders/response.rb', line 9 def issuer @issuer end |
#now ⇒ Object
Returns the value of attribute now.
7 8 9 |
# File 'lib/saml/kit/builders/response.rb', line 7 def now @now end |
#reference_id ⇒ Object
Returns the value of attribute reference_id.
7 8 9 |
# File 'lib/saml/kit/builders/response.rb', line 7 def reference_id @reference_id end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
6 7 8 |
# File 'lib/saml/kit/builders/response.rb', line 6 def request @request end |
#status_code ⇒ Object
Returns the value of attribute status_code.
8 9 10 |
# File 'lib/saml/kit/builders/response.rb', line 8 def status_code @status_code end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
6 7 8 |
# File 'lib/saml/kit/builders/response.rb', line 6 def user @user end |
#version ⇒ Object
Returns the value of attribute version.
8 9 10 |
# File 'lib/saml/kit/builders/response.rb', line 8 def version @version end |
Instance Method Details
#build ⇒ Object
33 34 35 |
# File 'lib/saml/kit/builders/response.rb', line 33 def build Saml::Kit::Response.new(to_xml, request_id: request.id, configuration: configuration) end |