Skip to content

Commit 626140b

Browse files
Remove stray "include REXML" + fix REXML deprecation (#706)
* Remove stray "include REXML" * Change deprecated REXML::Document.entity_expansion_limit to REXML::Security.entity_expansion_limit
1 parent f5768d2 commit 626140b

5 files changed

Lines changed: 9 additions & 17 deletions

File tree

.rubocop_todo.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2024-07-09 08:57:21 UTC using RuboCop version 1.64.1.
3+
# on 2024-07-10 16:10:44 UTC using RuboCop version 1.64.1.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -20,7 +20,7 @@ Layout/EmptyLineAfterGuardClause:
2020
- 'lib/ruby_saml/slo_logoutrequest.rb'
2121
- 'lib/ruby_saml/slo_logoutresponse.rb'
2222

23-
# Offense count: 6
23+
# Offense count: 7
2424
# This cop supports safe autocorrection (--autocorrect).
2525
# Configuration parameters: EnforcedStyle.
2626
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines, beginning_only, ending_only
@@ -31,6 +31,7 @@ Layout/EmptyLinesAroundClassBody:
3131
- 'lib/ruby_saml/logoutrequest.rb'
3232
- 'lib/ruby_saml/logoutresponse.rb'
3333
- 'lib/ruby_saml/metadata.rb'
34+
- 'lib/ruby_saml/saml_message.rb'
3435
- 'lib/ruby_saml/slo_logoutresponse.rb'
3536

3637
# Offense count: 1
@@ -39,14 +40,16 @@ Layout/EmptyLinesAroundMethodBody:
3940
Exclude:
4041
- 'lib/ruby_saml/slo_logoutrequest.rb'
4142

42-
# Offense count: 11
43+
# Offense count: 13
4344
# This cop supports safe autocorrection (--autocorrect).
4445
# Configuration parameters: EnforcedStyle.
4546
# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines
4647
Layout/EmptyLinesAroundModuleBody:
4748
Exclude:
4849
- 'lib/ruby_saml/attribute_service.rb'
4950
- 'lib/ruby_saml/attributes.rb'
51+
- 'lib/ruby_saml/authrequest.rb'
52+
- 'lib/ruby_saml/idp_metadata_parser.rb'
5053
- 'lib/ruby_saml/logoutrequest.rb'
5154
- 'lib/ruby_saml/logoutresponse.rb'
5255
- 'lib/ruby_saml/metadata.rb'
@@ -294,7 +297,7 @@ Performance/StringReplacement:
294297
- 'lib/ruby_saml/utils.rb'
295298
- 'lib/ruby_saml/xml/document.rb'
296299

297-
# Offense count: 52
300+
# Offense count: 48
298301
# This cop supports safe autocorrection (--autocorrect).
299302
# Configuration parameters: EnforcedStyle.
300303
# SupportedStyles: separated, grouped
@@ -414,14 +417,6 @@ Style/ModuleFunction:
414417
Exclude:
415418
- 'lib/ruby_saml/logging.rb'
416419

417-
# Offense count: 1
418-
# This cop supports unsafe autocorrection (--autocorrect-all).
419-
# Configuration parameters: EnforcedStyle, Autocorrect.
420-
# SupportedStyles: module_function, extend_self, forbidden
421-
Style/ModuleFunction:
422-
Exclude:
423-
- 'lib/ruby_saml/logging.rb'
424-
425420
# Offense count: 16
426421
# Configuration parameters: AllowedMethods.
427422
# AllowedMethods: respond_to_missing?
@@ -514,7 +509,7 @@ Style/SymbolArray:
514509
Exclude:
515510
- 'lib/ruby_saml/settings.rb'
516511

517-
# Offense count: 95
512+
# Offense count: 92
518513
# This cop supports safe autocorrection (--autocorrect).
519514
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns.
520515
# URISchemes: http, https

lib/ruby_saml/authrequest.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
# Only supports SAML 2.0
1111
module RubySaml
12-
include REXML
1312

1413
# SAML2 Authentication. AuthNRequest (SSO SP initiated, Builder)
1514
#

lib/ruby_saml/idp_metadata_parser.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
# Only supports SAML 2.0
1010
module RubySaml
11-
include REXML
1211

1312
# Auxiliary class to retrieve and parse the Identity Provider Metadata
1413
#

lib/ruby_saml/saml_message.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ module RubySaml
1515
# SAML2 Message
1616
#
1717
class SamlMessage
18-
include REXML
1918

2019
ASSERTION = "urn:oasis:names:tc:SAML:2.0:assertion"
2120
PROTOCOL = "urn:oasis:names:tc:SAML:2.0:protocol"

lib/ruby_saml/xml/base_document.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
module RubySaml
1111
module XML
1212
class BaseDocument < REXML::Document
13-
REXML::Document.entity_expansion_limit = 0
13+
REXML::Security.entity_expansion_limit = 0
1414

1515
C14N = 'http://www.w3.org/2001/10/xml-exc-c14n#'
1616
DSIG = 'http://www.w3.org/2000/09/xmldsig#'

0 commit comments

Comments
 (0)