libsaml 2.24.3 → 3.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/saml/complex_types/attribute_type.rb +0 -5
- data/lib/saml/complex_types/role_descriptor_type.rb +6 -2
- data/lib/saml/elements/attribute_statement.rb +0 -10
- data/lib/saml/elements/encrypted_id.rb +18 -11
- data/lib/saml/notification.rb +3 -1
- data/lib/saml/provider.rb +2 -3
- data/lib/saml/rails/controller_helper.rb +5 -5
- data/lib/saml/version.rb +1 -1
- metadata +8 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8358775136d7df4adcd2cdb766fffefdc6a88352
|
4
|
+
data.tar.gz: aabc8811b6d09cc43cc4e22237df01582cbaeae6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c39601b63f721decde696d6b8e960a0b8bf2d1b98a8b49c9141271cc2f11cf2fdbbf4cebddce4df94916fc8994780712dd74eda18a2cd183854954546321b3c4
|
7
|
+
data.tar.gz: 58f15e65b6eff45522b193099164946bd3b9de48e439f3d66c7c4d721a6eeacf74ed72ad9c547b73ee1a6b6014da18c3182c4ad66d0a3c12bb7ae8ee0265611e
|
@@ -26,11 +26,6 @@ module Saml
|
|
26
26
|
super(*(args << options))
|
27
27
|
end
|
28
28
|
|
29
|
-
def attribute_value
|
30
|
-
warn '[DEPRECATED] `attribute_value` please use #attribute_values'
|
31
|
-
attribute_values.first.try(:content)
|
32
|
-
end
|
33
|
-
|
34
29
|
def attribute_value=(value)
|
35
30
|
attribute_value = if value.is_a? String
|
36
31
|
Saml::Elements::AttributeValue.new(content: value)
|
@@ -29,7 +29,7 @@ module Saml
|
|
29
29
|
def find_key_descriptor(key_name, use)
|
30
30
|
return key_descriptors.first unless key_name_or_use_specified?
|
31
31
|
|
32
|
-
key_descriptors_by_use =
|
32
|
+
key_descriptors_by_use = find_key_descriptors_by_use_or_without(use)
|
33
33
|
|
34
34
|
if key_name.present? && key_name_specified?
|
35
35
|
key_descriptors_by_use.find { |key| key.key_info.key_name == key_name }
|
@@ -38,9 +38,13 @@ module Saml
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
+
def find_key_descriptors_by_use(use)
|
42
|
+
key_descriptors.select { |key| key.use == use }
|
43
|
+
end
|
44
|
+
|
41
45
|
private
|
42
46
|
|
43
|
-
def
|
47
|
+
def find_key_descriptors_by_use_or_without(use)
|
44
48
|
key_descriptors.select { |key| key.use == use || key.use.blank? }
|
45
49
|
end
|
46
50
|
|
@@ -10,16 +10,6 @@ module Saml
|
|
10
10
|
|
11
11
|
has_many :attributes, Saml::Elements::Attribute
|
12
12
|
has_many :encrypted_attributes, Saml::Elements::EncryptedAttribute
|
13
|
-
|
14
|
-
def attribute
|
15
|
-
warn '[DEPRECATED] `attribute` please use #attributes'
|
16
|
-
attributes
|
17
|
-
end
|
18
|
-
|
19
|
-
def attribute=(attributes)
|
20
|
-
warn '[DEPRECATED] `attribute=` please use #attributes='
|
21
|
-
self.attributes = attributes
|
22
|
-
end
|
23
13
|
end
|
24
14
|
end
|
25
15
|
end
|
@@ -23,9 +23,9 @@ module Saml
|
|
23
23
|
super(*(args << options))
|
24
24
|
end
|
25
25
|
|
26
|
-
def encrypt(
|
27
|
-
|
28
|
-
|
26
|
+
def encrypt(key_descriptors, key_options = {})
|
27
|
+
key_descriptors = Array(key_descriptors)
|
28
|
+
encrypted_keys = []
|
29
29
|
|
30
30
|
self.encrypted_data = Xmlenc::Builder::EncryptedData.new
|
31
31
|
self.encrypted_data.set_key_retrieval_method Xmlenc::Builder::RetrievalMethod.new(
|
@@ -34,14 +34,21 @@ module Saml
|
|
34
34
|
self.encrypted_data.set_encryption_method(
|
35
35
|
algorithm: 'http://www.w3.org/2001/04/xmlenc#aes256-cbc'
|
36
36
|
)
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
37
|
+
|
38
|
+
key_descriptors.each do |key_descriptor|
|
39
|
+
encrypted_key = self.encrypted_data.encrypt(name_id_xml, key_options)
|
40
|
+
encrypted_key.set_encryption_method(
|
41
|
+
algorithm: 'http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p',
|
42
|
+
digest_method_algorithm: 'http://www.w3.org/2000/09/xmldsig#sha1'
|
43
|
+
)
|
44
|
+
|
45
|
+
encrypted_key.set_key_name(key_descriptor.key_info.key_name)
|
46
|
+
encrypted_key.encrypt(key_descriptor.certificate.public_key)
|
47
|
+
|
48
|
+
encrypted_keys << encrypted_key
|
49
|
+
end
|
50
|
+
|
51
|
+
self.encrypted_keys = encrypted_keys
|
45
52
|
self.name_id = nil
|
46
53
|
end
|
47
54
|
|
data/lib/saml/notification.rb
CHANGED
@@ -12,7 +12,9 @@ module Saml
|
|
12
12
|
define_method "#{method}_with_notification" do |*args|
|
13
13
|
notify "#{method}", send("#{method}_without_notification", *args)
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
|
+
alias_method "#{method}_without_notification", :#{method}
|
17
|
+
alias_method :#{method}, "#{method}_with_notification"
|
16
18
|
RUBY
|
17
19
|
|
18
20
|
if instance_method
|
data/lib/saml/provider.rb
CHANGED
@@ -46,9 +46,8 @@ module Saml
|
|
46
46
|
descriptor(type).find_key_descriptor(key_name, use)
|
47
47
|
end
|
48
48
|
|
49
|
-
def
|
50
|
-
|
51
|
-
encryption_key
|
49
|
+
def find_key_descriptors_by_use(use, type = :descriptor)
|
50
|
+
descriptor(type).find_key_descriptors_by_use(use)
|
52
51
|
end
|
53
52
|
|
54
53
|
def signing_key
|
@@ -3,24 +3,24 @@ module Saml
|
|
3
3
|
module ControllerHelper
|
4
4
|
def self.included(base)
|
5
5
|
base.extend self
|
6
|
-
base.
|
6
|
+
base.before_action :set_response_headers
|
7
7
|
end
|
8
8
|
|
9
9
|
def current_provider(entity_id_or_method = nil, &block)
|
10
10
|
if block_given?
|
11
|
-
|
11
|
+
before_action &block
|
12
12
|
else
|
13
13
|
case entity_id_or_method
|
14
14
|
when Symbol
|
15
|
-
|
15
|
+
before_action { Saml.current_provider = send(entity_id_or_method) }
|
16
16
|
else
|
17
|
-
|
17
|
+
before_action { Saml.current_provider = Saml.provider("#{entity_id_or_method}") }
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
22
|
def current_store(store)
|
23
|
-
|
23
|
+
before_action { Saml.current_store = store }
|
24
24
|
end
|
25
25
|
|
26
26
|
def set_response_headers
|
data/lib/saml/version.rb
CHANGED
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:
|
4
|
+
version: 3.0.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: 2017-
|
11
|
+
date: 2017-01-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '4.2'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '4.2'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activemodel
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '4.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '4.2'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: xmlmapper
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -76,22 +76,16 @@ dependencies:
|
|
76
76
|
name: xmldsig
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
|
-
- - "
|
79
|
+
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
81
|
version: 0.5.1
|
82
|
-
- - "<"
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version: 0.7.0
|
85
82
|
type: :runtime
|
86
83
|
prerelease: false
|
87
84
|
version_requirements: !ruby/object:Gem::Requirement
|
88
85
|
requirements:
|
89
|
-
- - "
|
86
|
+
- - "~>"
|
90
87
|
- !ruby/object:Gem::Version
|
91
88
|
version: 0.5.1
|
92
|
-
- - "<"
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: 0.7.0
|
95
89
|
- !ruby/object:Gem::Dependency
|
96
90
|
name: xmlenc
|
97
91
|
requirement: !ruby/object:Gem::Requirement
|