ruby-saml 1.7.1 → 1.7.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ruby-saml might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bbac6942120c5332a95a90dd3d88cde723269092
4
- data.tar.gz: 4b08b52dc6263e036983b519cd01028af7725566
3
+ metadata.gz: 58b2d78436fa5304bc67e40cd5f4a0cc766b4301
4
+ data.tar.gz: b2445dcda50eeb89ce6fe2b9b285c5021755e189
5
5
  SHA512:
6
- metadata.gz: b7394a6d2d7e02d069e1b721d036a5af5f8a324ccbc308026d38f6876b5fcd9b88a73ad963ba6be7ad4a7125634a65f8c5d9dae6e96567141500dcfa9e5eca4a
7
- data.tar.gz: 7efb59314189ccf38abc734378cbbd91a38c6235557d4e25f70b45494c9b235e6ba899f43e4b51693503880b97cc67a3f3111c4c1944af4bab4481c64a94f363
6
+ metadata.gz: 5b90724f90916e973182de8bf2d009aeabfbc356acb167e927a63d1e360b831e540b25602ba4bb1d79b74fd6e07889860fda5f4620eeb31f76fdc9b585bd13f0
7
+ data.tar.gz: cd3750758fa6326bfe6be73552480b1f37994ba137eb048750afbd093d7ee4b23afadcbc1869bfdd49f9b77bdf29f629b0fc6963d814e3cdf54ad72281053999
data/changelog.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # RubySaml Changelog
2
2
 
3
+ ### 1.7.2 (Feb 28, 2018)
4
+ * [#446](https://github.com/onelogin/ruby-saml/pull/446) Normalize text returned by OneLogin::RubySaml::Utils.element_text
5
+
3
6
  ### 1.7.1 (Feb 28, 2018)
4
7
  * [#444](https://github.com/onelogin/ruby-saml/pull/444) Fix audience validation for empty audience restriction
5
8
 
@@ -286,7 +286,7 @@ module OneLogin
286
286
  # that there all children other than text nodes can be ignored (e.g. comments). If nil is
287
287
  # passed, nil will be returned.
288
288
  def self.element_text(element)
289
- element.texts.join if element
289
+ element.texts.map(&:value).join if element
290
290
  end
291
291
  end
292
292
  end
@@ -1,5 +1,5 @@
1
1
  module OneLogin
2
2
  module RubySaml
3
- VERSION = '1.7.1'
3
+ VERSION = '1.7.2'
4
4
  end
5
5
  end
data/test/utils_test.rb CHANGED
@@ -213,5 +213,42 @@ class UtilsTest < Minitest::Test
213
213
  assert !OneLogin::RubySaml::Utils.uri_match?(destination, settings)
214
214
  end
215
215
  end
216
+
217
+ describe 'element_text' do
218
+ it 'returns the element text' do
219
+ element = REXML::Document.new('<element>element text</element>').elements.first
220
+ assert_equal 'element text', OneLogin::RubySaml::Utils.element_text(element)
221
+ end
222
+
223
+ it 'returns all segments of the element text' do
224
+ element = REXML::Document.new('<element>element <!-- comment -->text</element>').elements.first
225
+ assert_equal 'element text', OneLogin::RubySaml::Utils.element_text(element)
226
+ end
227
+
228
+ it 'returns normalized element text' do
229
+ element = REXML::Document.new('<element>element &amp; text</element>').elements.first
230
+ assert_equal 'element & text', OneLogin::RubySaml::Utils.element_text(element)
231
+ end
232
+
233
+ it 'returns the CDATA element text' do
234
+ element = REXML::Document.new('<element><![CDATA[element & text]]></element>').elements.first
235
+ assert_equal 'element & text', OneLogin::RubySaml::Utils.element_text(element)
236
+ end
237
+
238
+ it 'returns the element text with newlines and additional whitespace' do
239
+ element = REXML::Document.new("<element> element \n text </element>").elements.first
240
+ assert_equal " element \n text ", OneLogin::RubySaml::Utils.element_text(element)
241
+ end
242
+
243
+ it 'returns nil when element is nil' do
244
+ assert_nil OneLogin::RubySaml::Utils.element_text(nil)
245
+ end
246
+
247
+ it 'returns empty string when element has no text' do
248
+ element = REXML::Document.new('<element></element>').elements.first
249
+ assert_equal '', OneLogin::RubySaml::Utils.element_text(element)
250
+ end
251
+
252
+ end
216
253
  end
217
254
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-saml
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - OneLogin LLC