libsaml 2.6.0 → 2.6.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dccdf146af819002b65e31bd049aa6d474d539f4
4
- data.tar.gz: 2b448c399f8d12ea56931886568373af80641fb9
3
+ metadata.gz: 07ae6c9a93423c6b980f593c7ac38d6cf90cb003
4
+ data.tar.gz: ccbd0755186ced0ffcc73c1ef43be13b74151d6c
5
5
  SHA512:
6
- metadata.gz: cf2a5dbe186d390d63c0720412c558773ce7e791b24aa2d3fefee89d46b3c56480d6733cb299b491e41a263dc98aa4dcac02d76b86c4c038cc6889280c0ac595
7
- data.tar.gz: 5e4286804bb11390ca0924c3916d1bc8dc853dee0fe966b6b75ff9a093d659a9fa60fc7e6213fc64e77c65fbadefa4feb7b206745031bf2dd7448c4180cb4928
6
+ metadata.gz: f3e209bf9232f5775e0814f657e597e713a5fcfedfe68df8a22493b5d3ad8741126860ba8fe42fc386da86db8b9fd18661db24c2f0ed19736d0ca6923817d465
7
+ data.tar.gz: fd58ecd4b590808e0b5934219e9f4f60f921429dadccee034a50c1c0662eda4cfe63da8b87c0c4ca96c0f9747214eff620dba8951a7c707616d8cb4b638a75ea
@@ -6,14 +6,14 @@ module Saml
6
6
  register_namespace 'samlp', Saml::SAMLP_NAMESPACE
7
7
  register_namespace 'saml', Saml::SAML_NAMESPACE
8
8
 
9
- tag "Assertion"
9
+ tag 'Assertion'
10
10
  namespace 'saml'
11
11
 
12
12
  attribute :_id, String, :tag => 'ID'
13
- attribute :version, String, :tag => "Version"
14
- attribute :issue_instant, Time, :tag => "IssueInstant", :on_save => lambda { |val| val.utc.xmlschema }
13
+ attribute :version, String, :tag => 'Version'
14
+ attribute :issue_instant, Time, :tag => 'IssueInstant', :on_save => lambda { |val| val.utc.xmlschema }
15
15
 
16
- element :issuer, String, :namespace => 'saml', :tag => "Issuer"
16
+ element :issuer, String, :namespace => 'saml', :tag => 'Issuer'
17
17
 
18
18
  has_one :signature, Saml::Elements::Signature
19
19
  has_one :subject, Saml::Elements::Subject
@@ -25,7 +25,7 @@ module Saml
25
25
  validates :_id, :version, :issue_instant, :issuer, :presence => true
26
26
 
27
27
  validates :version, inclusion: %w(2.0)
28
- validate :check_issue_instant, :if => "issue_instant.present?"
28
+ validate :check_issue_instant, :if => 'issue_instant.present?'
29
29
 
30
30
  def initialize(*args)
31
31
  options = args.extract_options!
@@ -57,9 +57,13 @@ module Saml
57
57
  end
58
58
 
59
59
  def fetch_attribute(key)
60
+ fetch_attributes(key).first if fetch_attributes(key)
61
+ end
62
+
63
+ def fetch_attributes(key)
60
64
  return unless self.attribute_statement
61
65
  return unless self.attribute_statement.attribute
62
- attribute_statement.fetch_attribute(key)
66
+ attribute_statement.fetch_attributes(key)
63
67
  end
64
68
 
65
69
  private
@@ -3,7 +3,7 @@ module Saml
3
3
  class AttributeStatement
4
4
  include Saml::Base
5
5
 
6
- tag "AttributeStatement"
6
+ tag 'AttributeStatement'
7
7
  register_namespace 'saml', Saml::SAML_NAMESPACE
8
8
  namespace 'saml'
9
9
 
@@ -11,10 +11,11 @@ module Saml
11
11
  has_many :encrypted_attributes, Saml::Elements::EncryptedAttribute
12
12
 
13
13
  def fetch_attribute(key)
14
- attribute = self.attribute.find do |attr|
15
- attr.name == key
16
- end
17
- attribute.attribute_value if attribute
14
+ fetch_attributes(key).first
15
+ end
16
+
17
+ def fetch_attributes(key)
18
+ attribute.find_all { |attr| attr.name == key }.map(&:attribute_value)
18
19
  end
19
20
  end
20
21
  end
data/lib/saml/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Saml
2
- VERSION = "2.6.0"
2
+ VERSION = "2.6.1"
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.6.0
4
+ version: 2.6.1
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-04-20 00:00:00.000000000 Z
11
+ date: 2015-04-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport