libsaml 3.1.1 → 3.1.2

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: 17c67b9601317d36394c440a7e7d99a46e717eb5
4
- data.tar.gz: 6722ab68b77666bdb39036ac6fed7c6d04fa8be5
3
+ metadata.gz: 653781649ab736fa3d4e373c424366b6126d5ae0
4
+ data.tar.gz: ee51d71c7f89226f970fa36824809e67b0fb24ee
5
5
  SHA512:
6
- metadata.gz: 8a1688bda04cde34e5978a47efe6ad153727b92ec34640d55eb639458513925efbe7ecdb03944cbcb7a77fe0277ccb08ae6fc2d679ff40576e1d536edeae6a54
7
- data.tar.gz: 4281d5571b063ab7913038ab413c6f711180eb17f52a2b2718542e786c1e1ff2d832731c659632894dec81499db6e36f98a2aaf5d824b3f7632730f6f17537a0
6
+ metadata.gz: 05d9360fe5c93a25c5e956172d7abb271db94165281217db8cdd19418416256c34ad43649758280288c1062a03666a2fe0f4d42d9008545394788fc69d02fbcd
7
+ data.tar.gz: ce81cbba375271f0e890368ffbf2dc157b9fdcf849dfedfe70fb73c3de2fea6253b8c7c282746361702ca8d910ac3a2c7b319002b3d77a42547aac9cda47863a
@@ -59,12 +59,19 @@ module Saml
59
59
  @provider ||= Saml.provider(issuer)
60
60
  end
61
61
 
62
- def add_attribute(key, value, value_attributes = {}, attribute_options = {})
62
+ def add_attribute(key, value_or_values, value_attributes = {}, attribute_options = {})
63
63
  self.attribute_statement ||= Saml::Elements::AttributeStatement.new
64
64
  self.attribute_statement.attributes ||= []
65
- attribute_value = Saml::Elements::AttributeValue.new(value_attributes.merge(content: value))
65
+ attribute_values = case value_or_values
66
+ when Saml::Elements::NameId
67
+ [Saml::Elements::AttributeValue.new(value_attributes.merge(name_id: value_or_values))]
68
+ else
69
+ Array(value_or_values).collect do |value|
70
+ Saml::Elements::AttributeValue.new(value_attributes.merge(content: value))
71
+ end
72
+ end
66
73
  self.attribute_statement.attributes << Saml::Elements::Attribute.new(
67
- attribute_options.merge(name: key, attribute_value: attribute_value)
74
+ attribute_options.merge(name: key, attribute_values: attribute_values)
68
75
  )
69
76
  end
70
77
 
@@ -16,6 +16,7 @@ module Saml
16
16
  attribute :type, String, tag: 'xsi:type'
17
17
 
18
18
  content :content, String
19
+ has_one :name_id, Saml::Elements::NameId
19
20
  end
20
21
  end
21
22
  end
@@ -9,6 +9,7 @@ module Saml
9
9
 
10
10
  attribute :format, String, :tag => "Format"
11
11
  attribute :name_qualifier, String, :tag => "NameQualifier"
12
+ attribute :sp_name_qualifier, String, :tag => "SPNameQualifier"
12
13
 
13
14
  content :value, String
14
15
  end
data/lib/saml/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Saml
2
- VERSION = '3.1.1'
2
+ VERSION = '3.1.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: 3.1.1
4
+ version: 3.1.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: 2018-01-26 00:00:00.000000000 Z
11
+ date: 2018-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport