ruby-saml 0.4.3 → 0.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.3
1
+ 0.4.4
@@ -29,8 +29,8 @@ module Onelogin::Saml
29
29
  # The value of the user identifier as designated by the initialization request response
30
30
  def name_id
31
31
  @name_id ||= begin
32
- node = REXML::XPath.first(document, "/p:Response/a:Assertion[@ID='#{document.signed_element_id[1,document.signed_element_id.size]}']/a:Subject/a:NameID", { "p" => PROTOCOL, "a" => ASSERTION })
33
- node.text
32
+ node = REXML::XPath.first(document, "/p:Response/a:Assertion[@ID='#{document.signed_element_id[1,document.signed_element_id.size]}']/a:Subject/a:NameID", { "p" => PROTOCOL, "a" => ASSERTION })
33
+ node.nil? ? nil : node.text
34
34
  end
35
35
  end
36
36
 
@@ -50,6 +50,8 @@ module Onelogin::Saml
50
50
  result = {}
51
51
 
52
52
  stmt_element = REXML::XPath.first(document, "/p:Response/a:Assertion/a:AttributeStatement", { "p" => PROTOCOL, "a" => ASSERTION })
53
+ return {} if stmt_element.nil?
54
+
53
55
  stmt_element.elements.each do |attr_element|
54
56
  name = attr_element.attributes["Name"]
55
57
  value = attr_element.elements.first.text
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruby-saml}
8
- s.version = "0.4.3"
8
+ s.version = "0.4.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["OneLogin LLC"]
12
- s.date = %q{2011-06-04}
12
+ s.date = %q{2011-06-10}
13
13
  s.description = %q{SAML toolkit for Ruby on Rails}
14
14
  s.email = %q{support@onelogin.com}
15
15
  s.extra_rdoc_files = [
@@ -38,7 +38,7 @@ class RubySamlTest < Test::Unit::TestCase
38
38
  response = Onelogin::Saml::Response.new(response_document_3)
39
39
  assert !response.name_id.nil?
40
40
  end
41
-
41
+
42
42
  should "check time conditions" do
43
43
  response = Onelogin::Saml::Response.new(response_document)
44
44
  assert !response.check_conditions
@@ -111,6 +111,11 @@ class RubySamlTest < Test::Unit::TestCase
111
111
  response = Onelogin::Saml::Response.new(response_document_3)
112
112
  assert_equal "someone@example.com", response.attributes["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"]
113
113
  end
114
+
115
+ should "not raise on responses without attributes" do
116
+ response = Onelogin::Saml::Response.new(response_document_4)
117
+ assert_equal Hash.new, response.attributes
118
+ end
114
119
  end
115
120
 
116
121
  context "#session_expires_at" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-saml
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 4
9
- - 3
10
- version: 0.4.3
9
+ - 4
10
+ version: 0.4.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - OneLogin LLC
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-06-04 00:00:00 -06:00
18
+ date: 2011-06-10 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency