saml-kit 0.2.12 → 0.2.13
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/saml/kit/assertion.rb +6 -2
- data/lib/saml/kit/locales/en.yml +1 -0
- data/lib/saml/kit/metadata.rb +12 -0
- data/lib/saml/kit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70dbb0e0364cd23b3f1afd8b02fb38cbe7b0b6fd
|
|
4
|
+
data.tar.gz: 6f3644f902897ca75eb959b621cd42db9dc9436d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fecaa317d931cf2e07c0b32e34b1787cd85b7b0b8f8b65322abab157f5886b712b0122832e36ce529fc3adfc803c84dd90dc380d02d3d204985eecc71f0d2b79
|
|
7
|
+
data.tar.gz: 07b68fcbcfd29c2777565c63ac66ad3d9a4fa3cac3e4d007986ea6b79fa197f8fc829680345b949aaf9182f05f2019f1c74d4fb540ee3412a757baea6c98f6ef
|
data/lib/saml/kit/assertion.rb
CHANGED
|
@@ -70,12 +70,16 @@ module Saml
|
|
|
70
70
|
private
|
|
71
71
|
|
|
72
72
|
def assertion
|
|
73
|
-
if encrypted?
|
|
73
|
+
@assertion ||= if encrypted?
|
|
74
74
|
decrypted = XmlDecryption.new(configuration: @configuration).decrypt(@xml_hash['Response']['EncryptedAssertion'])
|
|
75
75
|
Saml::Kit.logger.debug(decrypted)
|
|
76
76
|
Hash.from_xml(decrypted)['Assertion']
|
|
77
77
|
else
|
|
78
|
-
@xml_hash.fetch('Response', {}).fetch('Assertion', {})
|
|
78
|
+
result = @xml_hash.fetch('Response', {}).fetch('Assertion', {})
|
|
79
|
+
return result if result.is_a?(Hash)
|
|
80
|
+
|
|
81
|
+
errors[:assertion] << error_message(:must_contain_single_assertion)
|
|
82
|
+
{}
|
|
79
83
|
end
|
|
80
84
|
end
|
|
81
85
|
|
data/lib/saml/kit/locales/en.yml
CHANGED
data/lib/saml/kit/metadata.rb
CHANGED
|
@@ -29,6 +29,18 @@ module Saml
|
|
|
29
29
|
document.find_all("/md:EntityDescriptor/md:#{name}/md:NameIDFormat").map(&:text)
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
def organization_name
|
|
33
|
+
document.find_by("/md:EntityDescriptor/md:Organization/md:OrganizationName").try(:text)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def organization_url
|
|
37
|
+
document.find_by("/md:EntityDescriptor/md:Organization/md:OrganizationURL").try(:text)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def contact_person_company
|
|
41
|
+
document.find_by("/md:EntityDescriptor/md:ContactPerson/md:Company").try(:text)
|
|
42
|
+
end
|
|
43
|
+
|
|
32
44
|
def certificates
|
|
33
45
|
@certificates ||= document.find_all("/md:EntityDescriptor/md:#{name}/md:KeyDescriptor").map do |item|
|
|
34
46
|
cert = item.at_xpath("./ds:KeyInfo/ds:X509Data/ds:X509Certificate", Xml::NAMESPACES).text
|
data/lib/saml/kit/version.rb
CHANGED