saml2 2.2.10 → 2.2.11
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.
- checksums.yaml +4 -4
- data/lib/saml2/attribute/x500.rb +2 -1
- data/lib/saml2/version.rb +1 -1
- data/spec/lib/attribute_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d29dce81582e9f864e9382373bff2d075041266b9a6c13931a2675b2a3b8665f
|
4
|
+
data.tar.gz: a126314896499fd3a30fac541aa8a32ad3d1610c9f7b133b596502d543997a70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6573df0b3f11f79e0878350a021c8bf3c28ebf2736469ea0a97202b22cf41a2823a6aa62a4f0bb18e0e79aecfac946d357e1e2d074dec130192510f997e5fe4
|
7
|
+
data.tar.gz: 9b8011e5a896b084f5e30b552fd8337ea3bcfcce80bdbb99351cf9e6e319864af04f565bc1733c69ee286b53f8e928a4cf7267e7b23409110a5ccc70b2d5b1cc
|
data/lib/saml2/attribute/x500.rb
CHANGED
@@ -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
|
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
|
data/lib/saml2/version.rb
CHANGED
data/spec/lib/attribute_spec.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2018-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|