saml-kit 1.0.12 → 1.0.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saml/kit.rb +1 -1
- data/lib/saml/kit/document.rb +4 -3
- data/lib/saml/kit/metadata.rb +2 -2
- data/lib/saml/kit/signature.rb +3 -3
- data/lib/saml/kit/version.rb +1 -1
- data/saml-kit.gemspec +2 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bee64af01bee9e3ec08669be41f4b3ba272eec4bee6157c56e43b395e72d0a81
|
4
|
+
data.tar.gz: ecc4baf598932cd6900320c7ed2544ef64fff1e3179d4df54e3215547bcd0845
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad57558fe8f97ed27b4a6804d654d4022d633d7d499e71ebe812e09023c92f1323e3d2887efa67debdf78cf26e13f0db8bd1037b9765fac3026f46db1009a16d
|
7
|
+
data.tar.gz: a3b83a575a1f528af64843cee34e4b8d3da2cfea2aa8b8acbc8b1e656a56ade030db9f39eb62d8b2f59c4745251808f08a07bd406439f41b83f1497c61aa3062
|
data/lib/saml/kit.rb
CHANGED
data/lib/saml/kit/document.rb
CHANGED
@@ -18,6 +18,7 @@ module Saml
|
|
18
18
|
'xmlenc' => ::Xml::Kit::Namespaces::XMLENC,
|
19
19
|
}.freeze
|
20
20
|
attr_accessor :registry
|
21
|
+
attr_reader :name
|
21
22
|
validates_presence_of :content
|
22
23
|
validates_presence_of :id
|
23
24
|
validate :must_match_xsd
|
@@ -58,7 +59,7 @@ module Saml
|
|
58
59
|
|
59
60
|
# Returns the SAML document returned as a Hash.
|
60
61
|
def to_h
|
61
|
-
@
|
62
|
+
@to_h ||= Hash.from_xml(content) || {}
|
62
63
|
end
|
63
64
|
|
64
65
|
# Returns the SAML document as an XML string.
|
@@ -76,7 +77,7 @@ module Saml
|
|
76
77
|
|
77
78
|
# @!visibility private
|
78
79
|
def to_nokogiri
|
79
|
-
@
|
80
|
+
@to_nokogiri ||= Nokogiri::XML(content)
|
80
81
|
end
|
81
82
|
|
82
83
|
# @!visibility private
|
@@ -137,7 +138,7 @@ module Saml
|
|
137
138
|
|
138
139
|
private
|
139
140
|
|
140
|
-
attr_reader :content, :
|
141
|
+
attr_reader :content, :configuration
|
141
142
|
|
142
143
|
def must_match_xsd
|
143
144
|
matches_xsd?(PROTOCOL_XSD)
|
data/lib/saml/kit/metadata.rb
CHANGED
@@ -148,7 +148,7 @@ module Saml
|
|
148
148
|
|
149
149
|
# Returns the XML document converted to a Hash.
|
150
150
|
def to_h
|
151
|
-
@
|
151
|
+
@to_h ||= Hash.from_xml(to_xml)
|
152
152
|
end
|
153
153
|
|
154
154
|
# Returns the XML document as a String.
|
@@ -210,7 +210,7 @@ module Saml
|
|
210
210
|
|
211
211
|
# @!visibility private
|
212
212
|
def to_nokogiri
|
213
|
-
@
|
213
|
+
@to_nokogiri ||= Nokogiri::XML(xml)
|
214
214
|
end
|
215
215
|
|
216
216
|
def at_xpath(xpath)
|
data/lib/saml/kit/signature.rb
CHANGED
@@ -26,7 +26,7 @@ module Saml
|
|
26
26
|
# Returns true when the fingerprint of the certificate matches one of the certificates registered in the metadata.
|
27
27
|
def trusted?(metadata)
|
28
28
|
return false if metadata.nil?
|
29
|
-
metadata.matches?(certificate.fingerprint, use: :signing)
|
29
|
+
metadata.matches?(certificate.fingerprint, use: :signing).present?
|
30
30
|
end
|
31
31
|
|
32
32
|
def digest_value
|
@@ -62,11 +62,11 @@ module Saml
|
|
62
62
|
|
63
63
|
# Returns the XML Hash.
|
64
64
|
def to_h
|
65
|
-
@
|
65
|
+
@to_h ||= present? ? Hash.from_xml(to_xml)['Signature'] : {}
|
66
66
|
end
|
67
67
|
|
68
68
|
def present?
|
69
|
-
node
|
69
|
+
node.present?
|
70
70
|
end
|
71
71
|
|
72
72
|
def to_xml(pretty: false)
|
data/lib/saml/kit/version.rb
CHANGED
data/saml-kit.gemspec
CHANGED
@@ -1,7 +1,6 @@
|
|
1
|
-
|
2
1
|
# frozen_string_literal: true
|
3
2
|
|
4
|
-
lib = File.expand_path('
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
5
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
6
5
|
require 'saml/kit/version'
|
7
6
|
|
@@ -30,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
30
29
|
spec.require_paths = ['lib']
|
31
30
|
|
32
31
|
spec.add_dependency 'activemodel', '>= 4.2.0'
|
33
|
-
spec.add_dependency 'xml-kit', '>= 0.1.
|
32
|
+
spec.add_dependency 'xml-kit', '>= 0.1.13', '<= 1.0.0'
|
34
33
|
spec.add_development_dependency 'bundler', '~> 1.15'
|
35
34
|
spec.add_development_dependency 'bundler-audit', '~> 0.6'
|
36
35
|
spec.add_development_dependency 'ffaker', '~> 2.7'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: saml-kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mo khan
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.1.
|
33
|
+
version: 0.1.13
|
34
34
|
- - "<="
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: 1.0.0
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: 0.1.
|
43
|
+
version: 0.1.13
|
44
44
|
- - "<="
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 1.0.0
|