@@ -32,8 +32,8 @@ def initialize(overrides = {}, keep_security_attributes = false)
3232
3333 # IdP Data
3434 attr_accessor :idp_entity_id
35- attr_writer :idp_sso_service_url
36- attr_writer :idp_slo_service_url
35+ attr_accessor :idp_sso_service_url
36+ attr_accessor :idp_slo_service_url
3737 attr_accessor :idp_slo_response_service_url
3838 attr_accessor :idp_cert
3939 attr_accessor :idp_cert_fingerprint
@@ -43,10 +43,11 @@ def initialize(overrides = {}, keep_security_attributes = false)
4343 attr_accessor :idp_name_qualifier
4444 attr_accessor :valid_until
4545 # SP Data
46- attr_writer :sp_entity_id
46+ attr_accessor :sp_entity_id
4747 attr_accessor :assertion_consumer_service_url
4848 attr_reader :assertion_consumer_service_binding
49- attr_writer :single_logout_service_url
49+ attr_accessor :single_logout_service_url
50+ attr_reader :single_logout_service_binding
5051 attr_accessor :sp_name_qualifier
5152 attr_accessor :name_identifier_format
5253 attr_accessor :name_identifier_value
@@ -68,25 +69,6 @@ def initialize(overrides = {}, keep_security_attributes = false)
6869 # Work-flow
6970 attr_accessor :security
7071 attr_accessor :soft
71- # Deprecated
72- attr_accessor :certificate_new
73- attr_accessor :assertion_consumer_logout_service_url
74- attr_reader :assertion_consumer_logout_service_binding
75- attr_accessor :issuer
76- attr_accessor :idp_sso_target_url
77- attr_accessor :idp_slo_target_url
78-
79- # @return [String] IdP Single Sign On Service URL
80- #
81- def idp_sso_service_url
82- @idp_sso_service_url || @idp_sso_target_url
83- end
84-
85- # @return [String] IdP Single Logout Service URL
86- #
87- def idp_slo_service_url
88- @idp_slo_service_url || @idp_slo_target_url
89- end
9072
9173 # @return [String] IdP Single Sign On Service Binding
9274 #
@@ -114,12 +96,6 @@ def idp_slo_service_binding=(value)
11496 @idp_slo_service_binding = get_binding ( value )
11597 end
11698
117- # @return [String] SP Entity ID
118- #
119- def sp_entity_id
120- @sp_entity_id || @issuer
121- end
122-
12399 # Setter for SP Protocol Binding
124100 # @param value [String, Symbol].
125101 #
@@ -134,18 +110,6 @@ def assertion_consumer_service_binding=(value)
134110 @assertion_consumer_service_binding = get_binding ( value )
135111 end
136112
137- # @return [String] Single Logout Service URL.
138- #
139- def single_logout_service_url
140- @single_logout_service_url || @assertion_consumer_logout_service_url
141- end
142-
143- # @return [String] Single Logout Service Binding.
144- #
145- def single_logout_service_binding
146- @single_logout_service_binding || @assertion_consumer_logout_service_binding
147- end
148-
149113 # Setter for Single Logout Service Binding.
150114 #
151115 # (Currently we only support "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect")
@@ -155,15 +119,6 @@ def single_logout_service_binding=(value)
155119 @single_logout_service_binding = get_binding ( value )
156120 end
157121
158- # @deprecated Setter for legacy Single Logout Service Binding parameter.
159- #
160- # (Currently we only support "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect")
161- # @param value [String, Symbol]
162- #
163- def assertion_consumer_logout_service_binding = ( value )
164- @assertion_consumer_logout_service_binding = get_binding ( value )
165- end
166-
167122 # Calculates the fingerprint of the IdP x509 certificate.
168123 # @return [String] The fingerprint
169124 #
@@ -292,6 +247,38 @@ def get_binding(value)
292247 } . freeze
293248 } . freeze
294249
250+ {
251+ issuer : :sp_entity_id ,
252+ idp_sso_target_url : :idp_sso_service_url ,
253+ idp_slo_target_url : :idp_slo_service_url ,
254+ assertion_consumer_logout_service_url : :single_logout_service_url ,
255+ assertion_consumer_logout_service_binding : :single_logout_service_binding
256+ } . each do |old_param , new_param |
257+ # @deprecated Will be removed in v2.1.0
258+ define_method ( old_param ) do
259+ replaced_deprecation ( old_param , new_param )
260+ send ( new_param )
261+ end
262+
263+ # @deprecated Will be removed in v2.1.0
264+ define_method ( :"#{ old_param } =" ) do |value |
265+ replaced_deprecation ( old_param , new_param )
266+ send ( :"#{ new_param } =" , value )
267+ end
268+ end
269+
270+ # @deprecated Will be removed in v2.1.0
271+ def certificate_new
272+ certificate_new_deprecation
273+ @certificate_new
274+ end
275+
276+ # @deprecated Will be removed in v2.1.0
277+ def certificate_new = ( value )
278+ certificate_new_deprecation
279+ @certificate_new = value
280+ end
281+
295282 # @deprecated Will be removed in v2.1.0
296283 def compress_request
297284 compress_deprecation ( 'compress_request' , 'idp_sso_service_binding' )
@@ -318,6 +305,19 @@ def compress_response=(value)
318305
319306 private
320307
308+ # @deprecated Will be removed in v2.1.0
309+ def replaced_deprecation ( old_param , new_param )
310+ Logging . deprecate "`RubySaml::Settings##{ old_param } ` is deprecated and will be removed in RubySaml 2.1.0. " \
311+ "Please set the same value to `RubySaml::Settings##{ new_param } ` instead."
312+ end
313+
314+ # @deprecated Will be removed in v2.1.0
315+ def certificate_new_deprecation
316+ Logging . deprecate '`RubySaml::Settings#certificate_new` is deprecated and will be removed in RubySaml v2.1.0. ' \
317+ 'Please set `RubySaml::Settings#sp_cert_multi` instead. ' \
318+ 'Please refer to documentation as `sp_cert_multi` has a different value type.'
319+ end
320+
321321 # @deprecated Will be removed in v2.1.0
322322 def compress_deprecation ( old_param , new_param )
323323 Logging . deprecate "`RubySaml::Settings##{ old_param } ` is deprecated and no longer functional. " \
0 commit comments