Class: Spid::Slo::Request
- Inherits:
-
Object
- Object
- Spid::Slo::Request
- Defined in:
- lib/spid/slo/request.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#idp_name ⇒ Object
readonly
Returns the value of attribute idp_name.
-
#relay_state ⇒ Object
readonly
Returns the value of attribute relay_state.
-
#session_index ⇒ Object
readonly
Returns the value of attribute session_index.
Instance Method Summary collapse
- #identity_provider ⇒ Object
-
#initialize(idp_name:, session_index:, relay_state: nil) ⇒ Request
constructor
A new instance of Request.
- #logout_request ⇒ Object
- #query_params_signer ⇒ Object
- #saml_message ⇒ Object
- #service_provider ⇒ Object
- #settings ⇒ Object
- #url ⇒ Object
- #uuid ⇒ Object
Constructor Details
#initialize(idp_name:, session_index:, relay_state: nil) ⇒ Request
Returns a new instance of Request.
10 11 12 13 14 15 16 17 |
# File 'lib/spid/slo/request.rb', line 10 def initialize(idp_name:, session_index:, relay_state: nil) @idp_name = idp_name @session_index = session_index @relay_state = begin relay_state || Spid.configuration.default_relay_state_path end end |
Instance Attribute Details
#idp_name ⇒ Object (readonly)
Returns the value of attribute idp_name.
6 7 8 |
# File 'lib/spid/slo/request.rb', line 6 def idp_name @idp_name end |
#relay_state ⇒ Object (readonly)
Returns the value of attribute relay_state.
8 9 10 |
# File 'lib/spid/slo/request.rb', line 8 def relay_state @relay_state end |
#session_index ⇒ Object (readonly)
Returns the value of attribute session_index.
7 8 9 |
# File 'lib/spid/slo/request.rb', line 7 def session_index @session_index end |
Instance Method Details
#identity_provider ⇒ Object
60 61 62 63 |
# File 'lib/spid/slo/request.rb', line 60 def identity_provider @identity_provider ||= IdentityProviderManager.find_by_entity(idp_name) end |
#logout_request ⇒ Object
46 47 48 49 50 51 |
# File 'lib/spid/slo/request.rb', line 46 def logout_request @logout_request ||= Spid::Saml2::LogoutRequest.new( settings: settings, session_index: session_index ) end |
#query_params_signer ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/spid/slo/request.rb', line 30 def query_params_signer @query_params_signer ||= begin Spid::Saml2::Utils::QueryParamsSigner.new( saml_message: , relay_state: relay_state, private_key: settings.private_key, signature_method: settings.signature_method ) end end |
#saml_message ⇒ Object
42 43 44 |
# File 'lib/spid/slo/request.rb', line 42 def @saml_message ||= logout_request.to_saml end |
#service_provider ⇒ Object
65 66 67 68 |
# File 'lib/spid/slo/request.rb', line 65 def service_provider @service_provider ||= Spid.configuration.service_provider end |
#settings ⇒ Object
53 54 55 56 57 58 |
# File 'lib/spid/slo/request.rb', line 53 def settings @settings ||= Spid::Saml2::Settings.new( service_provider: service_provider, identity_provider: identity_provider ) end |
#url ⇒ Object
19 20 21 22 23 24 |
# File 'lib/spid/slo/request.rb', line 19 def url [ settings.idp_slo_target_url, query_params_signer.escaped_signed_query_string ].join("?") end |
#uuid ⇒ Object
26 27 28 |
# File 'lib/spid/slo/request.rb', line 26 def uuid logout_request.uuid end |