libsaml 2.7.0 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saml.rb +3 -0
- data/lib/saml/complex_types/attribute_type.rb +17 -1
- data/lib/saml/complex_types/statement_abstract_type.rb +1 -1
- data/lib/saml/elements/attribute_statement.rb +1 -1
- data/lib/saml/elements/attribute_value.rb +18 -0
- data/lib/saml/version.rb +1 -1
- data/lib/saml/xml_helpers.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9e195ed198652f536ab402c05ff6482b5a8a01e
|
4
|
+
data.tar.gz: 250c776273dc68c698543239a95ed47cb77522a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32ce58306d95b976fc0477ebdfd16c91bf9a1aea336db82e7a4cd0451b53f9c2778bb69875503c581845ba4bcc513b4e91e4f8e64a555729d823299aa03ea26c
|
7
|
+
data.tar.gz: 0e26262b7cc6542270b51895deaf037dcb21783c589aad812ca137d9ff703e65ffd741581368aa80700789a8479765f5875f6c4340d603d684f8bb0076a6102c
|
data/lib/saml.rb
CHANGED
@@ -16,6 +16,8 @@ module Saml
|
|
16
16
|
MD_ATTR_NAMESPACE = 'urn:oasis:names:tc:SAML:metadata:attribute'
|
17
17
|
SAML_NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:assertion'
|
18
18
|
SAMLP_NAMESPACE = 'urn:oasis:names:tc:SAML:2.0:protocol'
|
19
|
+
XS_NAMESPACE = 'http://www.w3.org/2001/XMLSchema'
|
20
|
+
XSI_NAMESPACE = 'http://www.w3.org/2001/XMLSchema-instance'
|
19
21
|
XML_DSIG_NAMESPACE = 'http://www.w3.org/2000/09/xmldsig#'
|
20
22
|
SAML_VERSION = '2.0'
|
21
23
|
|
@@ -111,6 +113,7 @@ module Saml
|
|
111
113
|
require 'saml/elements/subject_confirmation'
|
112
114
|
require 'saml/elements/encrypted_assertion'
|
113
115
|
require 'saml/elements/encrypted_attribute'
|
116
|
+
require 'saml/elements/attribute_value'
|
114
117
|
require 'saml/elements/attribute'
|
115
118
|
require 'saml/elements/attribute_statement'
|
116
119
|
require 'saml/elements/entity_attributes'
|
@@ -10,15 +10,31 @@ module Saml
|
|
10
10
|
attribute :name, String, :tag => 'Name'
|
11
11
|
attribute :format, String, tag: 'NameFormat'
|
12
12
|
attribute :friendly_name, String, tag: 'FriendlyName'
|
13
|
-
|
13
|
+
|
14
|
+
has_many :attribute_values, Saml::Elements::AttributeValue
|
14
15
|
|
15
16
|
validates :name, :presence => true
|
16
17
|
end
|
17
18
|
|
18
19
|
def initialize(*args)
|
19
20
|
options = args.extract_options!
|
21
|
+
@attribute_values ||= []
|
20
22
|
super(*(args << options))
|
21
23
|
end
|
24
|
+
|
25
|
+
def attribute_value
|
26
|
+
warn '[DEPRECATED] please use #attribute_values'
|
27
|
+
attribute_values.first.try(:content)
|
28
|
+
end
|
29
|
+
|
30
|
+
def attribute_value=(value)
|
31
|
+
self.attribute_values << if value.is_a? String
|
32
|
+
Saml::Elements::AttributeValue.new(content: value)
|
33
|
+
else
|
34
|
+
value
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
22
38
|
end
|
23
39
|
end
|
24
40
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Saml
|
2
|
+
module Elements
|
3
|
+
class AttributeValue
|
4
|
+
include Saml::Base
|
5
|
+
|
6
|
+
register_namespace 'saml', Saml::SAML_NAMESPACE
|
7
|
+
register_namespace 'xs', Saml::XS_NAMESPACE
|
8
|
+
register_namespace 'xsi', Saml::XSI_NAMESPACE
|
9
|
+
|
10
|
+
namespace 'saml'
|
11
|
+
tag 'AttributeValue'
|
12
|
+
|
13
|
+
attribute :type, String, tag: 'xsi:type'
|
14
|
+
|
15
|
+
content :content, String
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/saml/version.rb
CHANGED
data/lib/saml/xml_helpers.rb
CHANGED
@@ -27,8 +27,8 @@ module Saml
|
|
27
27
|
|
28
28
|
builder = Nokogiri::XML::Builder.new(:encoding => "UTF-8")
|
29
29
|
builder.Envelope(:'xmlns:soapenv' => "http://schemas.xmlsoap.org/soap/envelope/",
|
30
|
-
:'xmlns:xsd' =>
|
31
|
-
:'xmlns:xsi' =>
|
30
|
+
:'xmlns:xsd' => Saml::XS_NAMESPACE,
|
31
|
+
:'xmlns:xsi' => Saml::XSI_NAMESPACE) do |xml|
|
32
32
|
builder.parent.namespace = builder.parent.namespace_definitions.find { |n| n.prefix == 'soapenv' }
|
33
33
|
builder.Body do
|
34
34
|
builder.parent.add_child body.doc.root
|
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.
|
4
|
+
version: 2.8.0
|
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-10-
|
11
|
+
date: 2015-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -147,6 +147,7 @@ files:
|
|
147
147
|
- lib/saml/elements/attribute_authority_descriptor.rb
|
148
148
|
- lib/saml/elements/attribute_consuming_service.rb
|
149
149
|
- lib/saml/elements/attribute_statement.rb
|
150
|
+
- lib/saml/elements/attribute_value.rb
|
150
151
|
- lib/saml/elements/audience_restriction.rb
|
151
152
|
- lib/saml/elements/authenticating_authority.rb
|
152
153
|
- lib/saml/elements/authn_context.rb
|