ruby-saml 0.9.3 → 0.9.4
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 +4 -4
- data/changelog.md +3 -0
- data/lib/onelogin/ruby-saml/utils.rb +1 -1
- data/lib/onelogin/ruby-saml/version.rb +1 -1
- data/test/utils_test.rb +41 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6899da69ca7253760c8766c25579be80e078459
|
4
|
+
data.tar.gz: a38aa8ac9f56af0ecc11d2a41143570f3ba2c55f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bbe6c965d9d01e30e48e7378d98bfe0daae344f83e3a63349a51df674c9e59bf9f4d1304c01a3e040f1c1aabeb87040d2e1ee9a6866a7161c58fef251ecafcc
|
7
|
+
data.tar.gz: ee92e4423bedfb8889b56cb763754cdafd24e4f5ec42cd36e904169af827c14422412f0a5537899abab47a1a210bb9f960439b988f30ff343a1853954a85bafc
|
data/changelog.md
CHANGED
@@ -42,7 +42,7 @@ module OneLogin
|
|
42
42
|
# that there all children other than text nodes can be ignored (e.g. comments). If nil is
|
43
43
|
# passed, nil will be returned.
|
44
44
|
def self.element_text(element)
|
45
|
-
element.texts.join if element
|
45
|
+
element.texts.map(&:value).join if element
|
46
46
|
end
|
47
47
|
end
|
48
48
|
end
|
data/test/utils_test.rb
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require File.expand_path(File.join(File.dirname(__FILE__), "test_helper"))
|
2
|
+
|
3
|
+
class UtilsTest < Minitest::Test
|
4
|
+
describe "Utils" do
|
5
|
+
describe 'element_text' do
|
6
|
+
it 'returns the element text' do
|
7
|
+
element = REXML::Document.new('<element>element text</element>').elements.first
|
8
|
+
assert_equal 'element text', OneLogin::RubySaml::Utils.element_text(element)
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'returns all segments of the element text' do
|
12
|
+
element = REXML::Document.new('<element>element <!-- comment -->text</element>').elements.first
|
13
|
+
assert_equal 'element text', OneLogin::RubySaml::Utils.element_text(element)
|
14
|
+
end
|
15
|
+
|
16
|
+
it 'returns normalized element text' do
|
17
|
+
element = REXML::Document.new('<element>element & text</element>').elements.first
|
18
|
+
assert_equal 'element & text', OneLogin::RubySaml::Utils.element_text(element)
|
19
|
+
end
|
20
|
+
|
21
|
+
it 'returns the CDATA element text' do
|
22
|
+
element = REXML::Document.new('<element><![CDATA[element & text]]></element>').elements.first
|
23
|
+
assert_equal 'element & text', OneLogin::RubySaml::Utils.element_text(element)
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'returns the element text with newlines and additional whitespace' do
|
27
|
+
element = REXML::Document.new("<element> element \n text </element>").elements.first
|
28
|
+
assert_equal " element \n text ", OneLogin::RubySaml::Utils.element_text(element)
|
29
|
+
end
|
30
|
+
|
31
|
+
it 'returns nil when element is nil' do
|
32
|
+
assert_nil OneLogin::RubySaml::Utils.element_text(nil)
|
33
|
+
end
|
34
|
+
|
35
|
+
it 'returns empty string when element has no text' do
|
36
|
+
element = REXML::Document.new('<element></element>').elements.first
|
37
|
+
assert_equal '', OneLogin::RubySaml::Utils.element_text(element)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-saml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- OneLogin LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: uuid
|
@@ -225,6 +225,7 @@ files:
|
|
225
225
|
- test/slo_logoutrequest_test.rb
|
226
226
|
- test/slo_logoutresponse_test.rb
|
227
227
|
- test/test_helper.rb
|
228
|
+
- test/utils_test.rb
|
228
229
|
- test/xml_security_test.rb
|
229
230
|
homepage: http://github.com/onelogin/ruby-saml
|
230
231
|
licenses:
|
@@ -247,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
247
248
|
version: '0'
|
248
249
|
requirements: []
|
249
250
|
rubyforge_project: http://www.rubygems.org/gems/ruby-saml
|
250
|
-
rubygems_version: 2.5.
|
251
|
+
rubygems_version: 2.5.1
|
251
252
|
signing_key:
|
252
253
|
specification_version: 4
|
253
254
|
summary: SAML Ruby Tookit
|
@@ -292,4 +293,5 @@ test_files:
|
|
292
293
|
- test/slo_logoutrequest_test.rb
|
293
294
|
- test/slo_logoutresponse_test.rb
|
294
295
|
- test/test_helper.rb
|
296
|
+
- test/utils_test.rb
|
295
297
|
- test/xml_security_test.rb
|