libsaml 2.15.3 → 2.15.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saml/assertion.rb +2 -0
- data/lib/saml/authn_request.rb +2 -0
- data/lib/saml/base.rb +5 -2
- data/lib/saml/response.rb +2 -0
- data/lib/saml/util.rb +18 -13
- data/lib/saml/version.rb +1 -1
- data/lib/saml/xml_helpers.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ff45f250b6c9660592b1bd45e38be03353e3477
|
4
|
+
data.tar.gz: 007f63e6a19af60dbb06b8a32aeaec058f97436c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92bb5e00d9f0072b5a32721c548ac788280ce96e3f150343fd6fd4d26213d0b1fc35eeb60cb8fb3544a48356317092ab4f6814e503cc3fe239c52e0aef7cde69
|
7
|
+
data.tar.gz: a4324d76708a171c044c9cc4b4303a19c14b3952a081a6f2d525f97739e0d9d8e1a15aa4ce91b35d1e6eea79c6d6ebba0be4c84f5c7b1070eb9bc32659947c58
|
data/lib/saml/assertion.rb
CHANGED
data/lib/saml/authn_request.rb
CHANGED
data/lib/saml/base.rb
CHANGED
@@ -8,8 +8,6 @@ module Saml
|
|
8
8
|
include ::XmlMapper
|
9
9
|
include ::ActiveModel::Validations
|
10
10
|
|
11
|
-
attr_accessor :xml_node
|
12
|
-
|
13
11
|
def use_parsed
|
14
12
|
@use_parsed = true
|
15
13
|
self
|
@@ -35,6 +33,11 @@ module Saml
|
|
35
33
|
def from_xml?
|
36
34
|
@from_xml
|
37
35
|
end
|
36
|
+
|
37
|
+
def use_original(object)
|
38
|
+
registered_namespaces.merge!(Saml::Util.collect_extra_namespaces(object.xml_value))
|
39
|
+
object.use_parsed
|
40
|
+
end
|
38
41
|
end
|
39
42
|
|
40
43
|
module XmlMapperClassMethods
|
data/lib/saml/response.rb
CHANGED
data/lib/saml/util.rb
CHANGED
@@ -29,10 +29,10 @@ module Saml
|
|
29
29
|
http.key = OpenSSL::PKey::RSA.new(key)
|
30
30
|
end
|
31
31
|
|
32
|
-
headers = {
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
headers = {
|
33
|
+
'Content-Type' => 'text/xml',
|
34
|
+
'Cache-Control' => 'no-cache, no-store',
|
35
|
+
'Pragma' => 'no-cache'
|
36
36
|
}
|
37
37
|
headers.merge! additional_headers
|
38
38
|
|
@@ -57,14 +57,14 @@ module Saml
|
|
57
57
|
|
58
58
|
def encrypt_assertion(assertion, key_descriptor_or_certificate)
|
59
59
|
case key_descriptor_or_certificate
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
60
|
+
when OpenSSL::X509::Certificate
|
61
|
+
certificate = key_descriptor_or_certificate
|
62
|
+
key_name = nil
|
63
|
+
when Saml::Elements::KeyDescriptor
|
64
|
+
certificate = key_descriptor_or_certificate.certificate
|
65
|
+
key_name = key_descriptor_or_certificate.key_info.key_name
|
66
|
+
else
|
67
|
+
raise ArgumentError.new("Expecting Certificate or KeyDescriptor got: #{key_descriptor_or_certificate.class}")
|
68
68
|
end
|
69
69
|
|
70
70
|
assertion = assertion.to_xml(nil, nil, false) if assertion.is_a?(Assertion) # create xml without instruct
|
@@ -100,7 +100,7 @@ module Saml
|
|
100
100
|
end
|
101
101
|
|
102
102
|
def decrypt_encrypted_id(encrypted_id, private_key)
|
103
|
-
encrypted_id_xml
|
103
|
+
encrypted_id_xml = encrypted_id.is_a?(Saml::Elements::EncryptedID) ?
|
104
104
|
encrypted_id.to_xml : encrypted_id.to_s
|
105
105
|
encrypted_document = Xmlenc::EncryptedDocument.new(encrypted_id_xml)
|
106
106
|
Saml::Elements::EncryptedID.parse(encrypted_document.decrypt(private_key))
|
@@ -120,6 +120,11 @@ module Saml
|
|
120
120
|
message.class.parse(signed_node.to_xml, single: true)
|
121
121
|
end
|
122
122
|
|
123
|
+
def collect_extra_namespaces(raw_xml)
|
124
|
+
doc = Nokogiri::XML(raw_xml, nil, nil, Nokogiri::XML::ParseOptions::STRICT)
|
125
|
+
doc.collect_namespaces.each_with_object({}) { |(prefix, path), hash| hash[prefix.gsub('xmlns:', '')] = path }
|
126
|
+
end
|
127
|
+
|
123
128
|
def download_metadata_xml(location)
|
124
129
|
uri = URI.parse(location)
|
125
130
|
|
data/lib/saml/version.rb
CHANGED
data/lib/saml/xml_helpers.rb
CHANGED
@@ -17,8 +17,8 @@ module Saml
|
|
17
17
|
write_xml = builder.nil? ? true : false
|
18
18
|
builder ||= Nokogiri::XML::Builder.new
|
19
19
|
builder.doc.encoding = "UTF-8"
|
20
|
-
result = if
|
21
|
-
builder
|
20
|
+
result = if use_parsed? && respond_to?(:xml_value)
|
21
|
+
builder << xml_value
|
22
22
|
builder
|
23
23
|
else
|
24
24
|
super(builder, default_namespace)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libsaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.15.
|
4
|
+
version: 2.15.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benoist Claassen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.6.
|
47
|
+
version: 0.6.3
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.6.
|
54
|
+
version: 0.6.3
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: xmldsig
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|