Skip to content

Commit 2ed7183

Browse files
committed
Merge remote-tracking branch 'remotes/johnnyshields/v2.x-decryption-refactor' into signed-document-info-refactor
2 parents 3b16870 + 75c8a0e commit 2ed7183

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

UPGRADING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA256
1818
settings.security[:digest_method] = XMLSecurity::Document::SHA256
1919
```
2020

21+
### JRuby users should upgrade to JRuby 1.19 or later
22+
23+
JRuby users should upgrade to Nokogiri gem version 1.19 or later, to avoid
24+
[this Nokogiri issue affecting how XML is generated on JRuby](https://github.com/sparklemotion/nokogiri/pull/3456).
25+
This issue is likely not critical for most IdPs, but since it is not tested, it is recommended to upgrade.
26+
2127
### Root "OneLogin" namespace changed to "RubySaml"
2228

2329
RubySaml version `2.0.0` changes the root namespace from `OneLogin::RubySaml::` to just `RubySaml::`.

lib/ruby_saml/metadata.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ class Metadata
1414
# @param valid_until [DateTime] Metadata's valid time
1515
# @param cache_duration [Integer] Duration of the cache in seconds
1616
# @return [String] XML Metadata of the Service Provider
17-
def generate(settings, pretty_print=false, valid_until=nil, cache_duration=nil)
17+
def generate(settings, pretty_print = false, valid_until = nil, cache_duration = nil)
1818
builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
1919
root_attributes = {
20-
'xmlns:md' => 'urn:oasis:names:tc:SAML:2.0:metadata',
20+
'xmlns:md' => RubySaml::XML::NS_METADATA,
21+
'xmlns:ds' => RubySaml::XML::DSIG,
2122
'ID' => RubySaml::Utils.uuid,
2223
'entityID' => settings.sp_entity_id
2324
}
@@ -151,7 +152,7 @@ def output_xml(meta_doc, pretty_print)
151152
def add_certificate_element(xml, cert, use)
152153
cert_text = Base64.strict_encode64(cert.to_der)
153154
xml['md'].KeyDescriptor('use' => use.to_s) do
154-
xml['ds'].KeyInfo('xmlns:ds' => 'http://www.w3.org/2000/09/xmldsig#') do
155+
xml['ds'].KeyInfo do
155156
xml['ds'].X509Data do
156157
xml['ds'].X509Certificate(cert_text)
157158
end

0 commit comments

Comments
 (0)