libsaml 2.11.1 → 2.11.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: feedb049131233fa3b5af8e496c634a4a3f62258
4
- data.tar.gz: 29c4fdbee9fd7487edd7fb9154fdf45d1592f531
3
+ metadata.gz: 52fd6cd1d0af0f41f1632b2479b78d1b5365c455
4
+ data.tar.gz: 5260800a99393c17ec10737eefdbb4028e9c9cf1
5
5
  SHA512:
6
- metadata.gz: 140b08f978e59a54c21eb8269245bc463fcdb7ab9f9f5cd742c374ef439df7c38880b922331dabda6975b894d4ad64bbfc8e3c37bb831d6509c222d0fda0019f
7
- data.tar.gz: e2aa1bfa00bcf148465aaa52ee51f80f0bb350bbb17f9d4a7b542c1eaa17752f9a89106de49f84bd147861c375a6e4b8d950b4206f0a2cff52daa8f79cd69ae4
6
+ metadata.gz: 741c4c38a246efb603c329d72921e7f72560f3256a2593c7759a4b32e5d77d169e515e248bd189405424c1a5851c884806eb6e26308470d32d175a82375c9c38
7
+ data.tar.gz: ff59291d3bc4120db647434a61d270516bb8f0b26f7aabb65abac070f4857dc0cb45ed30aa5c76af3b0bfe421ed8bd5fd6ab3522366234f9adc133884ec34bb0
@@ -58,7 +58,7 @@ module Saml
58
58
  end
59
59
 
60
60
  def fetch_attribute(key)
61
- fetch_attributes(key).first if fetch_attributes(key)
61
+ Array(fetch_attributes(key)).first
62
62
  end
63
63
 
64
64
  def fetch_attributes(key)
@@ -67,6 +67,16 @@ module Saml
67
67
  attribute_statements.flat_map { |attribute_statement| attribute_statement.fetch_attributes(key) }
68
68
  end
69
69
 
70
+ def fetch_attribute_value(key)
71
+ Array(fetch_attribute_values(key)).first
72
+ end
73
+
74
+ def fetch_attribute_values(key)
75
+ return unless self.attribute_statements
76
+ return unless self.attribute_statements.flat_map(&:attribute)
77
+ attribute_statements.flat_map { |attribute_statement| attribute_statement.fetch_attribute_values(key) }
78
+ end
79
+
70
80
  def attribute_statement
71
81
  attribute_statements.try(:first)
72
82
  end
@@ -11,11 +11,19 @@ module Saml
11
11
  has_many :encrypted_attributes, Saml::Elements::EncryptedAttribute
12
12
 
13
13
  def fetch_attribute(key)
14
- fetch_attributes(key).first
14
+ fetch_attribute_value(key).content
15
15
  end
16
16
 
17
17
  def fetch_attributes(key)
18
- attribute.find_all { |attr| attr.name == key }.flat_map(&:attribute_values).map(&:content)
18
+ fetch_attribute_values(key).map(&:content)
19
+ end
20
+
21
+ def fetch_attribute_value(key)
22
+ fetch_attribute_values(key).first
23
+ end
24
+
25
+ def fetch_attribute_values(key)
26
+ attribute.find_all { |attr| attr.name == key }.flat_map(&:attribute_values)
19
27
  end
20
28
  end
21
29
  end
data/lib/saml/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Saml
2
- VERSION = "2.11.1"
2
+ VERSION = "2.11.2"
3
3
  end
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.11.1
4
+ version: 2.11.2
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-10 00:00:00.000000000 Z
11
+ date: 2015-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport