Class: Saml::Artifact
- Inherits:
-
Object
- Object
- Saml::Artifact
- Includes:
- HappyMapper
- Defined in:
- lib/saml/artifact.rb
Constant Summary collapse
- TYPE_CODE =
"\000\004"
- END_POINT_INDEX =
"\000\000"
Instance Method Summary collapse
- #endpoint_index ⇒ Object
-
#initialize(artifact = nil) ⇒ Artifact
constructor
A new instance of Artifact.
- #message_handle ⇒ Object
- #source_id ⇒ Object
- #to_s ⇒ Object
- #type_code ⇒ Object
Constructor Details
#initialize(artifact = nil) ⇒ Artifact
Returns a new instance of Artifact.
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/saml/artifact.rb', line 13 def initialize(artifact = nil) if artifact @artifact = artifact else source_id = ::Digest::SHA1.digest(Saml.current_provider.entity_id.to_s) = ::SecureRandom.random_bytes(20) @type_code = TYPE_CODE @endpoint_index = END_POINT_INDEX @artifact = Saml::Encoding.encode_64 [@type_code, @endpoint_index, source_id, ].join end end |
Instance Method Details
#endpoint_index ⇒ Object
29 30 31 |
# File 'lib/saml/artifact.rb', line 29 def endpoint_index decoded_value[2, 2] end |
#message_handle ⇒ Object
37 38 39 |
# File 'lib/saml/artifact.rb', line 37 def decoded_value[24, 20] end |
#source_id ⇒ Object
33 34 35 |
# File 'lib/saml/artifact.rb', line 33 def source_id decoded_value[4, 20] end |
#to_s ⇒ Object
41 42 43 |
# File 'lib/saml/artifact.rb', line 41 def to_s artifact end |
#type_code ⇒ Object
25 26 27 |
# File 'lib/saml/artifact.rb', line 25 def type_code decoded_value[0, 2] end |