saml2 2.2.10 → 2.2.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 453b3acfb0a9b791d213e0c985e36beaddfc915512a9722aee036bfb09e43a24
4
- data.tar.gz: f725eba226322b37181528c19fcdd320477b4cd67b54775cb0d72a727dd761c0
3
+ metadata.gz: d29dce81582e9f864e9382373bff2d075041266b9a6c13931a2675b2a3b8665f
4
+ data.tar.gz: a126314896499fd3a30fac541aa8a32ad3d1610c9f7b133b596502d543997a70
5
5
  SHA512:
6
- metadata.gz: 95845c85c633d58abf0131820a2be7eb8dfdbca1976e60dc77f5b7fafbcb68024089eefe59e99a42778d4e99ab9c808a4cd278f0aa0c7cacf2b1b04e5975f40c
7
- data.tar.gz: 5b45cd12d4f79353a61e36e47fbcd4b4e0d3fbcd6f3eac62dd640a0e19260f3e5deef64c72b01014a2b43e128d6145d10855dcedb5e6ba31ab1d7441f1334930
6
+ metadata.gz: a6573df0b3f11f79e0878350a021c8bf3c28ebf2736469ea0a97202b22cf41a2823a6aa62a4f0bb18e0e79aecfac946d357e1e2d074dec130192510f997e5fe4
7
+ data.tar.gz: 9b8011e5a896b084f5e30b552fd8337ea3bcfcce80bdbb99351cf9e6e319864af04f565bc1733c69ee286b53f8e928a4cf7267e7b23409110a5ccc70b2d5b1cc
@@ -36,7 +36,8 @@ module SAML2
36
36
  def self.recognizes?(name_or_node)
37
37
  if name_or_node.is_a?(Nokogiri::XML::Element)
38
38
  !!name_or_node.at_xpath("@x500:Encoding", Namespaces::ALL) ||
39
- name_or_node['NameFormat'] == NameFormats::URI && OIDS.include?(name_or_node['Name'])
39
+ (name_or_node['NameFormat'] == NameFormats::URI || name_or_node['NameFormat'].nil?) &&
40
+ OIDS.include?(name_or_node['Name'])
40
41
  else
41
42
  FRIENDLY_NAMES.include?(name_or_node) || OIDS.include?(name_or_node)
42
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SAML2
4
- VERSION = '2.2.10'
4
+ VERSION = '2.2.11'
5
5
  end
@@ -28,6 +28,18 @@ XML
28
28
  expect(attr.name_format).to eq Attribute::NameFormats::URI
29
29
  end
30
30
 
31
+ it "recognizes and X500 attribute without a NameFormat" do
32
+ xml = <<-XML
33
+ <saml:Attribute xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" Name="urn:oid:1.3.6.1.4.1.5923.1.1.1.6"><saml:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">user@domain</saml:AttributeValue></saml:Attribute>
34
+ XML
35
+ attr = Attribute.from_xml(Nokogiri::XML(xml).root)
36
+ expect(attr).to be_instance_of Attribute::X500
37
+ expect(attr.value).to eq "user@domain"
38
+ expect(attr.name).to eq Attribute::X500::EduPerson::PRINCIPAL_NAME
39
+ expect(attr.friendly_name).to eq 'eduPersonPrincipalName'
40
+ expect(attr.name_format).to eq nil
41
+ end
42
+
31
43
  it "should serialize an X500 attribute correctly" do
32
44
  attr = Attribute.create('eduPersonPrincipalName', 'user@domain')
33
45
  expect(attr).to be_instance_of Attribute::X500
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saml2
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.10
4
+ version: 2.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-21 00:00:00.000000000 Z
11
+ date: 2018-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri