Skip to content

Commit 591bdaa

Browse files
committed
Change deprecations to be removed in RubySaml 3.0.0, for SemVer reasons
1 parent 04a7b8e commit 591bdaa

File tree

5 files changed

+51
-49
lines changed

5 files changed

+51
-49
lines changed

UPGRADING.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Ruby SAML Migration Guide
22

3-
## Updating from 1.x to 2.0.0
3+
## Upgrading from 1.x to 2.0.0
44

55
**IMPORTANT: Please read this section carefully as it contains breaking changes!**
66

@@ -34,7 +34,7 @@ Note that the project folder structure has also been updated accordingly. Notabl
3434
`lib/onelogin/schemas` is now `lib/ruby_saml/schemas`.
3535

3636
For backward compatibility, the alias `OneLogin = Object` has been set, so `OneLogin::RubySaml::` will still work
37-
as before. This alias will be removed in RubySaml version `2.1.0`.
37+
as before. This alias will be removed in RubySaml version `3.0.0`.
3838

3939
### Deprecation and removal of "XMLSecurity" namespace
4040

@@ -101,7 +101,7 @@ end
101101

102102
RubySaml now always uses double quotes for attribute values when generating XML.
103103
The `settings.double_quote_xml_attribute_values` parameter now always behaves as `true`,
104-
and will be removed in RubySaml 2.1.0.
104+
and will be removed in RubySaml 3.0.0.
105105

106106
The reasons for this change are:
107107
- RubySaml will use Nokogiri instead of REXML to generate XML. Nokogiri does not support
@@ -154,7 +154,7 @@ a different `sp_uuid_prefix` is passed-in on subsequent calls.
154154
### Deprecation of compression settings
155155

156156
The `settings.compress_request` and `settings.compress_response` parameters have been deprecated
157-
and are no longer functional. They will be removed in RubySaml 2.1.0. Please remove `compress_request`
157+
and are no longer functional. They will be removed in RubySaml 3.0.0. Please remove `compress_request`
158158
and `compress_response` everywhere within your project code.
159159

160160
The SAML SP request/response message compression behavior is now controlled automatically by the
@@ -166,13 +166,15 @@ compression may be achieved by enabling `Content-Encoding: gzip` on your webserv
166166
### Deprecation of IdP certificate fingerprint settings
167167

168168
The `settings.idp_cert_fingerprint` and `settings.idp_cert_fingerprint_algorithm` are deprecated
169-
and will be removed in RubySaml 2.1.0. Please use `settings.idp_cert` or `settings.idp_cert_multi` instead.
170-
The reasons for this deprecation are that (1) fingerprint cannot be used with HTTP-Redirect binding,
171-
and (2) fingerprint is theoretically susceptible to collision attacks.
169+
and will be removed in RubySaml 3.0.0. Please use `settings.idp_cert` or `settings.idp_cert_multi` instead.
170+
171+
The reasons for this deprecation are:
172+
- Fingerprint cannot be used with HTTP-Redirect binding
173+
- Fingerprint is theoretically susceptible to collision attacks.
172174

173175
### Other settings deprecations
174176

175-
The following parameters in `RubySaml::Settings` are deprecated and will be removed in RubySaml 2.1.0:
177+
The following parameters in `RubySaml::Settings` are deprecated and will be removed in RubySaml 3.0.0:
176178

177179
- `#issuer` is deprecated and replaced 1:1 by `#sp_entity_id`
178180
- `#idp_sso_target_url` is deprecated and replaced 1:1 by `#idp_sso_service_url`
@@ -212,7 +214,7 @@ and `#format_private_key` methods. Specifically:
212214
stripped out.
213215
- Case 7: If no valid certificates are found, the entire original string will be returned.
214216

215-
## Updating from 1.17.x to 1.18.0
217+
## Upgrading from 1.17.x to 1.18.0
216218

217219
Version `1.18.0` changes the way the toolkit validates SAML signatures. There is a new order
218220
how validation happens in the toolkit and also the toolkit by default will check malformed doc
@@ -222,7 +224,7 @@ The SignedDocument class defined at xml_security.rb experienced several changes.
222224
We don't expect compatibilty issues if you use the main methods offered by ruby-saml, but if
223225
you use a fork or customized usage, is possible that you need to adapt your code.
224226

225-
## Updating from 1.12.x to 1.13.0
227+
## Upgrading from 1.12.x to 1.13.0
226228

227229
Version `1.13.0` adds `settings.idp_sso_service_binding` and `settings.idp_slo_service_binding`, and
228230
deprecates `settings.security[:embed_sign]`. If specified, new binding parameters will be used in place of `:embed_sign`

lib/ruby_saml.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@
2020
require 'ruby_saml/utils'
2121
require 'ruby_saml/version'
2222

23-
# @deprecated This alias adds compatibility with v1.x and will be removed in v2.1.0
23+
# @deprecated This alias adds compatibility with v1.x and will be removed in v3.0.0
2424
OneLogin = Object

lib/ruby_saml/settings.rb

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,13 @@ def get_binding(value)
248248
{
249249
double_quote_xml_attribute_values: true
250250
}.each do |old_param, new_value|
251-
# @deprecated Will be removed in v2.1.0
251+
# @deprecated Will be removed in v3.0.0
252252
define_method(old_param) do
253253
removed_deprecation(old_param, new_value)
254254
new_value
255255
end
256256

257-
# @deprecated Will be removed in v2.1.0
257+
# @deprecated Will be removed in v3.0.0
258258
define_method(:"#{old_param}=") do |_|
259259
removed_deprecation(old_param, new_value)
260260
new_value
@@ -268,13 +268,13 @@ def get_binding(value)
268268
assertion_consumer_logout_service_url: :single_logout_service_url,
269269
assertion_consumer_logout_service_binding: :single_logout_service_binding
270270
}.each do |old_param, new_param|
271-
# @deprecated Will be removed in v2.1.0
271+
# @deprecated Will be removed in v3.0.0
272272
define_method(old_param) do
273273
replaced_deprecation(old_param, new_param)
274274
send(new_param)
275275
end
276276

277-
# @deprecated Will be removed in v2.1.0
277+
# @deprecated Will be removed in v3.0.0
278278
define_method(:"#{old_param}=") do |value|
279279
replaced_deprecation(old_param, new_param)
280280
send(:"#{new_param}=", value)
@@ -318,86 +318,86 @@ def get_sp_digest_method
318318
end
319319
end
320320

321-
# @deprecated Will be removed in v2.1.0
321+
# @deprecated Will be removed in v3.0.0
322322
def idp_cert_fingerprint=(value)
323323
idp_cert_fingerprint_deprecation
324324
@idp_cert_fingerprint = value
325325
end
326326

327-
# @deprecated Will be removed in v2.1.0
327+
# @deprecated Will be removed in v3.0.0
328328
def idp_cert_fingerprint_algorithm=(value)
329329
idp_cert_fingerprint_deprecation
330330
@idp_cert_fingerprint_algorithm = value
331331
end
332332

333-
# @deprecated Will be removed in v2.1.0
333+
# @deprecated Will be removed in v3.0.0
334334
def certificate_new
335335
certificate_new_deprecation
336336
@certificate_new
337337
end
338338

339-
# @deprecated Will be removed in v2.1.0
339+
# @deprecated Will be removed in v3.0.0
340340
def certificate_new=(value)
341341
certificate_new_deprecation
342342
@certificate_new = value
343343
end
344344

345-
# @deprecated Will be removed in v2.1.0
345+
# @deprecated Will be removed in v3.0.0
346346
def compress_request
347347
compress_deprecation('compress_request', 'idp_sso_service_binding')
348348
defined?(@compress_request) ? @compress_request : true
349349
end
350350

351-
# @deprecated Will be removed in v2.1.0
351+
# @deprecated Will be removed in v3.0.0
352352
def compress_request=(value)
353353
compress_deprecation('compress_request', 'idp_sso_service_binding')
354354
@compress_request = value
355355
end
356356

357-
# @deprecated Will be removed in v2.1.0
357+
# @deprecated Will be removed in v3.0.0
358358
def compress_response
359359
compress_deprecation('compress_response', 'idp_slo_service_binding')
360360
defined?(@compress_response) ? @compress_response : true
361361
end
362362

363-
# @deprecated Will be removed in v2.1.0
363+
# @deprecated Will be removed in v3.0.0
364364
def compress_response=(value)
365365
compress_deprecation('compress_response', 'idp_slo_service_binding')
366366
@compress_response = value
367367
end
368368

369369
private
370370

371-
# @deprecated Will be removed in v2.1.0
371+
# @deprecated Will be removed in v3.0.0
372372
def removed_deprecation(old_param, new_value)
373-
Logging.deprecate "`RubySaml::Settings##{old_param}` is deprecated and will be removed in RubySaml 2.1.0. " \
373+
Logging.deprecate "`RubySaml::Settings##{old_param}` is deprecated and will be removed in RubySaml 3.0.0. " \
374374
"It no longer has any effect, and will behave as if always set to #{new_value.inspect}."
375375
end
376376

377-
# @deprecated Will be removed in v2.1.0
377+
# @deprecated Will be removed in v3.0.0
378378
def replaced_deprecation(old_param, new_param)
379-
Logging.deprecate "`RubySaml::Settings##{old_param}` is deprecated and will be removed in RubySaml 2.1.0. " \
379+
Logging.deprecate "`RubySaml::Settings##{old_param}` is deprecated and will be removed in RubySaml 3.0.0. " \
380380
"Please set the same value to `RubySaml::Settings##{new_param}` instead."
381381
end
382382

383-
# @deprecated Will be removed in v2.1.0
383+
# @deprecated Will be removed in v3.0.0
384384
def idp_cert_fingerprint_deprecation
385385
Logging.deprecate '`RubySaml::Settings#idp_cert_fingerprint` and `#idp_cert_fingerprint_algorithm` are ' \
386-
'deprecated and will be removed in RubySaml v2.1.0. Please provide the full IdP certificate in ' \
386+
'deprecated and will be removed in RubySaml v3.0.0. Please provide the full IdP certificate in ' \
387387
'`RubySaml::Settings#idp_cert` instead.'
388388
end
389389

390-
# @deprecated Will be removed in v2.1.0
390+
# @deprecated Will be removed in v3.0.0
391391
def certificate_new_deprecation
392-
Logging.deprecate '`RubySaml::Settings#certificate_new` is deprecated and will be removed in RubySaml v2.1.0. ' \
392+
Logging.deprecate '`RubySaml::Settings#certificate_new` is deprecated and will be removed in RubySaml v3.0.0. ' \
393393
'Please set `RubySaml::Settings#sp_cert_multi` instead. ' \
394394
'Please refer to documentation as `sp_cert_multi` has a different value type.'
395395
end
396396

397-
# @deprecated Will be removed in v2.1.0
397+
# @deprecated Will be removed in v3.0.0
398398
def compress_deprecation(old_param, new_param)
399399
Logging.deprecate "`RubySaml::Settings##{old_param}` is deprecated and no longer functional. " \
400-
'It will be removed in RubySaml 2.1.0. ' \
400+
'It will be removed in RubySaml 3.0.0. ' \
401401
"Its functionality is now handled by `RubySaml::Settings##{new_param}` instead: " \
402402
'"HTTP-Redirect" will always be compressed, and "HTTP-POST" will always be uncompressed.'
403403
end

lib/ruby_saml/xml/deprecated.rb

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,30 @@
77
REXML::Security.entity_expansion_limit = 0
88

99
module XMLSecurity
10-
# @deprecated Will be removed in v2.1.0.
10+
# @deprecated Will be removed in v3.0.0.
1111
# @api private
1212
class BaseDocument < REXML::Document
1313
# @deprecated Constants
1414
C14N = RubySaml::XML::C14N
1515
DSIG = RubySaml::XML::DSIG
1616
NOKOGIRI_OPTIONS = RubySaml::XML::NOKOGIRI_OPTIONS
1717

18-
# @deprecated Will be removed in v2.1.0.
18+
# @deprecated Will be removed in v3.0.0.
1919
def canon_algorithm(algorithm)
20-
RubySaml::Logging.deprecate 'XMLSecurity::BaseDocument#canon_algorithm is deprecated and will be removed in v2.1.0. ' \
20+
RubySaml::Logging.deprecate 'XMLSecurity::BaseDocument#canon_algorithm is deprecated and will be removed in v3.0.0. ' \
2121
'Use RubySaml::XML.canon_algorithm instead.'
2222
RubySaml::XML.canon_algorithm(algorithm)
2323
end
2424

25-
# @deprecated Will be removed in v2.1.0.
25+
# @deprecated Will be removed in v3.0.0.
2626
def algorithm(algorithm)
27-
RubySaml::Logging.deprecate 'XMLSecurity::BaseDocument#algorithm is deprecated and will be removed in v2.1.0. ' \
27+
RubySaml::Logging.deprecate 'XMLSecurity::BaseDocument#algorithm is deprecated and will be removed in v3.0.0. ' \
2828
'Use RubySaml::XML.hash_algorithm instead.'
2929
RubySaml::XML.hash_algorithm(algorithm)
3030
end
3131
end
3232

33-
# @deprecated Will be removed in v2.1.0.
33+
# @deprecated Will be removed in v3.0.0.
3434
# @api private
3535
class Document < BaseDocument
3636
# @deprecated Constants
@@ -54,39 +54,39 @@ class Document < BaseDocument
5454
SHA512 = RubySaml::XML::SHA512
5555
ENVELOPED_SIG = RubySaml::XML::ENVELOPED_SIG
5656

57-
# @deprecated Will be removed in v2.1.0.
57+
# @deprecated Will be removed in v3.0.0.
5858
def initialize(*args, **_kwargs)
59-
RubySaml::Logging.deprecate 'XMLSecurity::Document is deprecated and will be removed in v2.1.0. ' \
59+
RubySaml::Logging.deprecate 'XMLSecurity::Document is deprecated and will be removed in v3.0.0. ' \
6060
'Use RubySaml::XML::DocumentSigner.sign_document instead.'
6161
super(args[0])
6262
end
6363

64-
# @deprecated Will be removed in v2.1.0.
64+
# @deprecated Will be removed in v3.0.0.
6565
def sign_document(*_args, **_kwargs)
6666
msg = 'XMLSecurity::Document#sign_document has been removed. ' \
6767
'Use RubySaml::XML::DocumentSigner.sign_document instead.'
6868
raise ::NoMethodError.new(msg)
6969
end
7070
end
7171

72-
# @deprecated Will be removed in v2.1.0.
72+
# @deprecated Will be removed in v3.0.0.
7373
# @api private
7474
class SignedDocument < BaseDocument
75-
# @deprecated Will be removed in v2.1.0.
75+
# @deprecated Will be removed in v3.0.0.
7676
def initialize(*args, **_kwargs)
77-
RubySaml::Logging.deprecate 'XMLSecurity::SignedDocument is deprecated and will be removed in v2.1.0.' \
77+
RubySaml::Logging.deprecate 'XMLSecurity::SignedDocument is deprecated and will be removed in v3.0.0.' \
7878
'Use RubySaml::XML::SignedDocumentValidator.validate_document instead.'
7979
super(args[0])
8080
end
8181

82-
# @deprecated Will be removed in v2.1.0.
82+
# @deprecated Will be removed in v3.0.0.
8383
def validate_document(*_args, **_kwargs)
8484
msg = 'XMLSecurity::SignedDocument#validate_document has been removed. ' \
8585
'Use RubySaml::XML::SignedDocumentValidator.validate_document instead.'
8686
raise ::NoMethodError.new(msg)
8787
end
8888

89-
# @deprecated Will be removed in v2.1.0.
89+
# @deprecated Will be removed in v3.0.0.
9090
def extract_inclusive_namespaces
9191
msg = 'XMLSecurity::SignedDocument#extract_inclusive_namespaces has been removed.'
9292
raise ::NoMethodError.new(msg)

lib/xml_security.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
require 'ruby_saml/logging'
44
RubySaml::Logging.deprecate 'Using `require "xml_security"` is deprecated and will be removed ' \
5-
'in RubySaml 2.1.0. Instead, please `require "ruby-saml"` and use ' \
5+
'in RubySaml 3.0.0. Instead, please `require "ruby-saml"` and use ' \
66
'the modules in RubySaml::XML instead.'
77

8-
# @deprecated This file adds compatibility with v1.x and will be removed in v2.1.0
8+
# @deprecated This file adds compatibility with v1.x and will be removed in v3.0.0
99
require 'ruby_saml/xml'

0 commit comments

Comments
 (0)