saml-kit 1.2.0 → 1.3.0
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 +4 -4
- data/CHANGELOG.md +14 -2
- data/Gemfile.lock +42 -39
- data/lib/saml/kit/assertion.rb +1 -1
- data/lib/saml/kit/composite_metadata.rb +2 -2
- data/lib/saml/kit/concerns/buildable.rb +6 -6
- data/lib/saml/kit/concerns/translatable.rb +1 -1
- data/lib/saml/kit/concerns/trustable.rb +1 -1
- data/lib/saml/kit/concerns/validatable.rb +25 -0
- data/lib/saml/kit/document.rb +1 -1
- data/lib/saml/kit/metadata.rb +2 -2
- data/lib/saml/kit/null_assertion.rb +1 -1
- data/lib/saml/kit/response.rb +2 -3
- data/lib/saml/kit/signature.rb +1 -1
- data/lib/saml/kit/version.rb +1 -1
- data/lib/saml/kit.rb +1 -0
- data/saml-kit.gemspec +3 -3
- metadata +25 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c9a4200f425bfeb877bfefb73991a9f7f71192c4c62c42a57fdced9ca9dd7e29
|
|
4
|
+
data.tar.gz: 240318f54c98446e6ed07c57838e5186a642203566f24d33b13ebc8152262779
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a05177ad91a35bdec004a0cc12fcec85a2f9b2cbc1e0b98a9c243cf05d790008bfa4f1189e3cb59eb49d34cfa162e9171ec82b24b3c190968d64911c2bdb8587
|
|
7
|
+
data.tar.gz: 3cef11e9d6eafd0ee8a471475f88b2635ba452d6490f310acc8f0349d8a1430349a541cb99632a05ed14e817bee8109afd98a3cda678ddb182848c65458fd0e9
|
data/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Version 1.
|
|
1
|
+
Version 1.3.0
|
|
2
2
|
|
|
3
3
|
# Changelog
|
|
4
4
|
All notable changes to this project will be documented in this file.
|
|
@@ -8,6 +8,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [1.3.0] - 2022-03-30
|
|
12
|
+
### Removed
|
|
13
|
+
|
|
14
|
+
- Drop support for ruby 2.6
|
|
15
|
+
- Drop support for ruby 2.5
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- fix: upgrade to Ruby 2.7+ `*args` syntax.
|
|
20
|
+
- fix: resolve deprecation warnings
|
|
21
|
+
|
|
11
22
|
## [1.2.0] - 2021-02-04
|
|
12
23
|
### Changed
|
|
13
24
|
- Use [ActiveModel::Errors#add](https://www.rubydoc.info/docs/rails/ActiveModel%2FErrors:add)
|
|
@@ -87,7 +98,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
87
98
|
### Removed
|
|
88
99
|
- Removed optional SessionNotOnOrAfter attribute from AuthnStatement.
|
|
89
100
|
|
|
90
|
-
[Unreleased]: https://github.com/xlgmokha/saml-kit/compare/v1.
|
|
101
|
+
[Unreleased]: https://github.com/xlgmokha/saml-kit/compare/v1.3.0...HEAD
|
|
102
|
+
[1.3.0]: https://github.com/xlgmokha/saml-kit/compare/v1.2.0...v1.3.0
|
|
91
103
|
[1.2.0]: https://github.com/xlgmokha/saml-kit/compare/v1.1.0...v1.2.0
|
|
92
104
|
[1.1.0]: https://github.com/xlgmokha/saml-kit/compare/v1.0.31...v1.1.0
|
|
93
105
|
[1.0.31]: https://github.com/xlgmokha/saml-kit/compare/v1.0.30...v1.0.31
|
data/Gemfile.lock
CHANGED
|
@@ -1,71 +1,74 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
saml-kit (1.
|
|
5
|
-
activemodel (
|
|
6
|
-
net-hippie (
|
|
4
|
+
saml-kit (1.3.0)
|
|
5
|
+
activemodel (>= 5.1, < 8.0)
|
|
6
|
+
net-hippie (>= 0.1, < 2.0)
|
|
7
7
|
xml-kit (~> 0.4)
|
|
8
8
|
|
|
9
9
|
GEM
|
|
10
10
|
remote: https://rubygems.org/
|
|
11
11
|
specs:
|
|
12
|
-
activemodel (
|
|
13
|
-
activesupport (=
|
|
14
|
-
activesupport (
|
|
12
|
+
activemodel (6.1.5)
|
|
13
|
+
activesupport (= 6.1.5)
|
|
14
|
+
activesupport (6.1.5)
|
|
15
15
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
16
|
-
i18n (>=
|
|
17
|
-
minitest (
|
|
18
|
-
tzinfo (~>
|
|
19
|
-
|
|
16
|
+
i18n (>= 1.6, < 2)
|
|
17
|
+
minitest (>= 5.1)
|
|
18
|
+
tzinfo (~> 2.0)
|
|
19
|
+
zeitwerk (~> 2.3)
|
|
20
|
+
addressable (2.8.0)
|
|
20
21
|
public_suffix (>= 2.0.2, < 5.0)
|
|
21
22
|
ast (2.4.2)
|
|
22
23
|
benchmark-malloc (0.2.0)
|
|
23
24
|
benchmark-perf (0.6.0)
|
|
24
25
|
benchmark-trend (0.4.0)
|
|
25
26
|
builder (3.2.4)
|
|
26
|
-
bundler-audit (0.
|
|
27
|
+
bundler-audit (0.9.0.1)
|
|
27
28
|
bundler (>= 1.2.0, < 3)
|
|
28
|
-
thor (
|
|
29
|
-
concurrent-ruby (1.1.
|
|
29
|
+
thor (~> 1.0)
|
|
30
|
+
concurrent-ruby (1.1.10)
|
|
30
31
|
crack (0.4.5)
|
|
31
32
|
rexml
|
|
32
|
-
diff-lcs (1.
|
|
33
|
+
diff-lcs (1.5.0)
|
|
33
34
|
docile (1.3.5)
|
|
34
|
-
ffaker (2.
|
|
35
|
+
ffaker (2.20.0)
|
|
35
36
|
hashdiff (1.0.1)
|
|
36
|
-
i18n (1.
|
|
37
|
+
i18n (1.10.0)
|
|
37
38
|
concurrent-ruby (~> 1.0)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
mini_portile2 (2.8.0)
|
|
40
|
+
minitest (5.15.0)
|
|
41
|
+
net-hippie (1.1.1)
|
|
42
|
+
nokogiri (1.13.3)
|
|
43
|
+
mini_portile2 (~> 2.8.0)
|
|
41
44
|
racc (~> 1.4)
|
|
42
45
|
parallel (1.20.1)
|
|
43
46
|
parser (3.0.0.0)
|
|
44
47
|
ast (~> 2.4.1)
|
|
45
48
|
public_suffix (4.0.6)
|
|
46
|
-
racc (1.
|
|
49
|
+
racc (1.6.0)
|
|
47
50
|
rainbow (3.0.0)
|
|
48
|
-
rake (13.0.
|
|
51
|
+
rake (13.0.6)
|
|
49
52
|
regexp_parser (2.0.3)
|
|
50
|
-
rexml (3.2.
|
|
51
|
-
rspec (3.
|
|
52
|
-
rspec-core (~> 3.
|
|
53
|
-
rspec-expectations (~> 3.
|
|
54
|
-
rspec-mocks (~> 3.
|
|
53
|
+
rexml (3.2.5)
|
|
54
|
+
rspec (3.11.0)
|
|
55
|
+
rspec-core (~> 3.11.0)
|
|
56
|
+
rspec-expectations (~> 3.11.0)
|
|
57
|
+
rspec-mocks (~> 3.11.0)
|
|
55
58
|
rspec-benchmark (0.6.0)
|
|
56
59
|
benchmark-malloc (~> 0.2)
|
|
57
60
|
benchmark-perf (~> 0.6)
|
|
58
61
|
benchmark-trend (~> 0.4)
|
|
59
62
|
rspec (>= 3.0)
|
|
60
|
-
rspec-core (3.
|
|
61
|
-
rspec-support (~> 3.
|
|
62
|
-
rspec-expectations (3.
|
|
63
|
+
rspec-core (3.11.0)
|
|
64
|
+
rspec-support (~> 3.11.0)
|
|
65
|
+
rspec-expectations (3.11.0)
|
|
63
66
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
64
|
-
rspec-support (~> 3.
|
|
65
|
-
rspec-mocks (3.
|
|
67
|
+
rspec-support (~> 3.11.0)
|
|
68
|
+
rspec-mocks (3.11.0)
|
|
66
69
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
67
|
-
rspec-support (~> 3.
|
|
68
|
-
rspec-support (3.
|
|
70
|
+
rspec-support (~> 3.11.0)
|
|
71
|
+
rspec-support (3.11.0)
|
|
69
72
|
rubocop (0.93.1)
|
|
70
73
|
parallel (~> 1.10)
|
|
71
74
|
parser (>= 2.7.1.5)
|
|
@@ -80,7 +83,7 @@ GEM
|
|
|
80
83
|
rubocop-rspec (1.44.1)
|
|
81
84
|
rubocop (~> 0.87)
|
|
82
85
|
rubocop-ast (>= 0.7.1)
|
|
83
|
-
ruby-prof (1.4.
|
|
86
|
+
ruby-prof (1.4.3)
|
|
84
87
|
ruby-progressbar (1.11.0)
|
|
85
88
|
simplecov (0.21.2)
|
|
86
89
|
docile (~> 1.1)
|
|
@@ -89,13 +92,12 @@ GEM
|
|
|
89
92
|
simplecov-html (0.12.3)
|
|
90
93
|
simplecov_json_formatter (0.1.2)
|
|
91
94
|
thor (1.1.0)
|
|
92
|
-
thread_safe (0.3.6)
|
|
93
95
|
tilt (2.0.10)
|
|
94
|
-
tzinfo (
|
|
95
|
-
|
|
96
|
+
tzinfo (2.0.4)
|
|
97
|
+
concurrent-ruby (~> 1.0)
|
|
96
98
|
unicode-display_width (1.7.0)
|
|
97
|
-
webmock (3.
|
|
98
|
-
addressable (>= 2.
|
|
99
|
+
webmock (3.14.0)
|
|
100
|
+
addressable (>= 2.8.0)
|
|
99
101
|
crack (>= 0.3.2)
|
|
100
102
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
101
103
|
xml-kit (0.5.0)
|
|
@@ -106,6 +108,7 @@ GEM
|
|
|
106
108
|
xmldsig (~> 0.6)
|
|
107
109
|
xmldsig (0.6.6)
|
|
108
110
|
nokogiri (>= 1.6.8, < 2.0.0)
|
|
111
|
+
zeitwerk (2.5.4)
|
|
109
112
|
|
|
110
113
|
PLATFORMS
|
|
111
114
|
ruby
|
data/lib/saml/kit/assertion.rb
CHANGED
|
@@ -51,9 +51,9 @@ module Saml
|
|
|
51
51
|
@metadatum.each(&block)
|
|
52
52
|
end
|
|
53
53
|
|
|
54
|
-
def method_missing(name, *args)
|
|
54
|
+
def method_missing(name, *args, **kwargs)
|
|
55
55
|
if (target = find { |x| x.respond_to?(name) })
|
|
56
|
-
target.public_send(name, *args)
|
|
56
|
+
target.public_send(name, *args, **kwargs)
|
|
57
57
|
else
|
|
58
58
|
super
|
|
59
59
|
end
|
|
@@ -9,20 +9,20 @@ module Saml
|
|
|
9
9
|
extend ActiveSupport::Concern
|
|
10
10
|
|
|
11
11
|
class_methods do
|
|
12
|
-
def build(*args)
|
|
13
|
-
builder(*args) do |builder|
|
|
12
|
+
def build(*args, **kwargs)
|
|
13
|
+
builder(*args, **kwargs) do |builder|
|
|
14
14
|
yield builder if block_given?
|
|
15
15
|
end.build
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
def build_xml(*args)
|
|
19
|
-
builder(*args) do |builder|
|
|
18
|
+
def build_xml(*args, **kwargs)
|
|
19
|
+
builder(*args, **kwargs) do |builder|
|
|
20
20
|
yield builder if block_given?
|
|
21
21
|
end.to_xml
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
def builder(*args)
|
|
25
|
-
builder_class.new(*args).tap do |builder|
|
|
24
|
+
def builder(*args, **kwargs)
|
|
25
|
+
builder_class.new(*args, **kwargs).tap do |builder|
|
|
26
26
|
yield builder if block_given?
|
|
27
27
|
end
|
|
28
28
|
end
|
|
@@ -9,7 +9,7 @@ module Saml
|
|
|
9
9
|
# @!visibility private
|
|
10
10
|
def error_message(attribute, options = {})
|
|
11
11
|
default_options = { scope: "saml/kit.errors.#{name}" }
|
|
12
|
-
I18n.translate(attribute, default_options.merge(options))
|
|
12
|
+
I18n.translate(attribute, **default_options.merge(options))
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Saml
|
|
4
|
+
module Kit
|
|
5
|
+
# This module is responsible for
|
|
6
|
+
# providing an adapter to the ActiveModel::Validations
|
|
7
|
+
# module.
|
|
8
|
+
module Validatable
|
|
9
|
+
extend ActiveSupport::Concern
|
|
10
|
+
include ActiveModel::Validations
|
|
11
|
+
|
|
12
|
+
def each_error
|
|
13
|
+
if Gem::Requirement.new('>= 6.1').satisfied_by?(ActiveModel.version)
|
|
14
|
+
errors.each do |error|
|
|
15
|
+
yield error.attribute, error.message
|
|
16
|
+
end
|
|
17
|
+
else
|
|
18
|
+
errors.each do |attribute, message|
|
|
19
|
+
yield attribute, message
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
data/lib/saml/kit/document.rb
CHANGED
data/lib/saml/kit/metadata.rb
CHANGED
|
@@ -26,7 +26,7 @@ module Saml
|
|
|
26
26
|
# for a list of options that can be specified.
|
|
27
27
|
# {include:file:spec/examples/metadata_spec.rb}
|
|
28
28
|
class Metadata
|
|
29
|
-
include
|
|
29
|
+
include Validatable
|
|
30
30
|
include Buildable
|
|
31
31
|
include Translatable
|
|
32
32
|
include XmlParseable
|
|
@@ -192,7 +192,7 @@ module Saml
|
|
|
192
192
|
def must_have_valid_signature
|
|
193
193
|
return if !signature.present? || signature.valid?
|
|
194
194
|
|
|
195
|
-
signature.
|
|
195
|
+
signature.each_error do |attribute, error|
|
|
196
196
|
errors.add(attribute, error)
|
|
197
197
|
end
|
|
198
198
|
end
|
data/lib/saml/kit/response.rb
CHANGED
|
@@ -43,9 +43,8 @@ module Saml
|
|
|
43
43
|
|
|
44
44
|
def must_be_valid_assertion
|
|
45
45
|
assertion.valid?
|
|
46
|
-
assertion.
|
|
47
|
-
attribute
|
|
48
|
-
errors.add(attribute, error)
|
|
46
|
+
assertion.each_error do |attribute, error|
|
|
47
|
+
errors.add(attribute == :base ? :assertion : attribute, error)
|
|
49
48
|
end
|
|
50
49
|
end
|
|
51
50
|
|
data/lib/saml/kit/signature.rb
CHANGED
data/lib/saml/kit/version.rb
CHANGED
data/lib/saml/kit.rb
CHANGED
|
@@ -23,6 +23,7 @@ require 'saml/kit/concerns/respondable'
|
|
|
23
23
|
require 'saml/kit/concerns/serializable'
|
|
24
24
|
require 'saml/kit/concerns/translatable'
|
|
25
25
|
require 'saml/kit/concerns/trustable'
|
|
26
|
+
require 'saml/kit/concerns/validatable'
|
|
26
27
|
require 'saml/kit/concerns/xml_parseable'
|
|
27
28
|
require 'saml/kit/concerns/xml_templatable'
|
|
28
29
|
require 'saml/kit/concerns/xsd_validatable'
|
data/saml-kit.gemspec
CHANGED
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
|
14
14
|
spec.description = 'A simple toolkit for working with SAML.'
|
|
15
15
|
spec.homepage = 'https://github.com/xlgmokha/saml-kit'
|
|
16
16
|
spec.license = 'MIT'
|
|
17
|
-
spec.required_ruby_version = '
|
|
17
|
+
spec.required_ruby_version = '>= 2.7.0'
|
|
18
18
|
|
|
19
19
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
20
20
|
(
|
|
@@ -28,8 +28,8 @@ Gem::Specification.new do |spec|
|
|
|
28
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
29
29
|
spec.require_paths = ['lib']
|
|
30
30
|
|
|
31
|
-
spec.add_dependency 'activemodel', '
|
|
32
|
-
spec.add_dependency 'net-hippie', '
|
|
31
|
+
spec.add_dependency 'activemodel', '>= 5.1', '< 8.0'
|
|
32
|
+
spec.add_dependency 'net-hippie', '>= 0.1', '< 2.0'
|
|
33
33
|
spec.add_dependency 'xml-kit', '~> 0.4'
|
|
34
34
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
|
35
35
|
spec.add_development_dependency 'bundler-audit', '~> 0.6'
|
metadata
CHANGED
|
@@ -1,43 +1,55 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: saml-kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- mo khan
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-03-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- - "
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: '5.1'
|
|
20
|
+
- - "<"
|
|
21
|
+
- !ruby/object:Gem::Version
|
|
22
|
+
version: '8.0'
|
|
20
23
|
type: :runtime
|
|
21
24
|
prerelease: false
|
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
26
|
requirements:
|
|
24
|
-
- - "
|
|
27
|
+
- - ">="
|
|
25
28
|
- !ruby/object:Gem::Version
|
|
26
29
|
version: '5.1'
|
|
30
|
+
- - "<"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '8.0'
|
|
27
33
|
- !ruby/object:Gem::Dependency
|
|
28
34
|
name: net-hippie
|
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
|
30
36
|
requirements:
|
|
31
|
-
- - "
|
|
37
|
+
- - ">="
|
|
32
38
|
- !ruby/object:Gem::Version
|
|
33
39
|
version: '0.1'
|
|
40
|
+
- - "<"
|
|
41
|
+
- !ruby/object:Gem::Version
|
|
42
|
+
version: '2.0'
|
|
34
43
|
type: :runtime
|
|
35
44
|
prerelease: false
|
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
46
|
requirements:
|
|
38
|
-
- - "
|
|
47
|
+
- - ">="
|
|
39
48
|
- !ruby/object:Gem::Version
|
|
40
49
|
version: '0.1'
|
|
50
|
+
- - "<"
|
|
51
|
+
- !ruby/object:Gem::Version
|
|
52
|
+
version: '2.0'
|
|
41
53
|
- !ruby/object:Gem::Dependency
|
|
42
54
|
name: xml-kit
|
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -263,6 +275,7 @@ files:
|
|
|
263
275
|
- lib/saml/kit/concerns/serializable.rb
|
|
264
276
|
- lib/saml/kit/concerns/translatable.rb
|
|
265
277
|
- lib/saml/kit/concerns/trustable.rb
|
|
278
|
+
- lib/saml/kit/concerns/validatable.rb
|
|
266
279
|
- lib/saml/kit/concerns/xml_parseable.rb
|
|
267
280
|
- lib/saml/kit/concerns/xml_templatable.rb
|
|
268
281
|
- lib/saml/kit/concerns/xsd_validatable.rb
|
|
@@ -322,23 +335,23 @@ licenses:
|
|
|
322
335
|
- MIT
|
|
323
336
|
metadata:
|
|
324
337
|
yard.run: yri
|
|
325
|
-
post_install_message:
|
|
338
|
+
post_install_message:
|
|
326
339
|
rdoc_options: []
|
|
327
340
|
require_paths:
|
|
328
341
|
- lib
|
|
329
342
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
330
343
|
requirements:
|
|
331
|
-
- - "
|
|
344
|
+
- - ">="
|
|
332
345
|
- !ruby/object:Gem::Version
|
|
333
|
-
version:
|
|
346
|
+
version: 2.7.0
|
|
334
347
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
335
348
|
requirements:
|
|
336
349
|
- - ">="
|
|
337
350
|
- !ruby/object:Gem::Version
|
|
338
351
|
version: '0'
|
|
339
352
|
requirements: []
|
|
340
|
-
rubygems_version: 3.
|
|
341
|
-
signing_key:
|
|
353
|
+
rubygems_version: 3.3.7
|
|
354
|
+
signing_key:
|
|
342
355
|
specification_version: 4
|
|
343
356
|
summary: A simple toolkit for working with SAML.
|
|
344
357
|
test_files: []
|