xml-kit 0.5.0 → 0.7.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/.github/workflows/audit.yml +20 -0
- data/.github/workflows/ci.yml +35 -0
- data/.github/workflows/release.yml +52 -0
- data/.release-please-manifest.json +3 -0
- data/.rubocop.yml +55 -8
- data/CHANGELOG.md +52 -24
- data/Gemfile.lock +111 -67
- data/LICENSE.txt +2 -1
- data/README.md +3 -5
- data/Rakefile +0 -1
- data/bin/audit +8 -0
- data/bin/setup +6 -4
- data/bin/style +8 -0
- data/bin/test +1 -10
- data/lib/xml/kit/crypto/oaep_cipher.rb +4 -4
- data/lib/xml/kit/crypto/rsa_cipher.rb +4 -4
- data/lib/xml/kit/crypto/symmetric_cipher.rb +4 -4
- data/lib/xml/kit/crypto/unknown_cipher.rb +6 -6
- data/lib/xml/kit/decryption.rb +36 -20
- data/lib/xml/kit/key_pair.rb +16 -16
- data/lib/xml/kit/signatures.rb +14 -14
- data/lib/xml/kit/version.rb +1 -1
- data/release-please-config.json +11 -0
- data/xml-kit.gemspec +11 -7
- metadata +42 -32
- data/.gitlab-ci.yml +0 -15
- data/.travis.yml +0 -13
- data/bin/cibuild +0 -21
- data/bin/lint +0 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4c26430ca2a195f76646a2ff5da216ab06271749a551dc6fc2413c3a3f4422e9
|
|
4
|
+
data.tar.gz: 0c0e386ea21a83fb7c41ecf35abd6590883e138f024da891aa3ce3e2438e86d3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a53bce7bf2ff4d96be82abd8d17c2369de95e0ed8b6dffbb1f4a453f7b092a6d73199b601468621ecb9d486eedeb335663389cdb13a8be342c81dc3cf91106d4
|
|
7
|
+
data.tar.gz: 5b647418662e2a52cfdb830ed80f1679a58d949e4a00ccc4948748a5c1799eed5661e962546896eb7c71e0c7e02da1863f521b5ac65ffd68c1009cac852452cb
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: audit
|
|
2
|
+
on:
|
|
3
|
+
schedule:
|
|
4
|
+
- cron: '17 6 * * 1'
|
|
5
|
+
workflow_dispatch:
|
|
6
|
+
permissions: {}
|
|
7
|
+
jobs:
|
|
8
|
+
audit:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
14
|
+
with:
|
|
15
|
+
persist-credentials: false
|
|
16
|
+
- uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
|
|
17
|
+
with:
|
|
18
|
+
ruby-version: '4.0'
|
|
19
|
+
bundler-cache: true
|
|
20
|
+
- run: sh bin/audit
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
workflow_call:
|
|
5
|
+
permissions: {}
|
|
6
|
+
jobs:
|
|
7
|
+
test:
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
ruby-version: ['3.2', '3.3', '3.4', '4.0']
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
16
|
+
with:
|
|
17
|
+
persist-credentials: false
|
|
18
|
+
- uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
|
|
19
|
+
with:
|
|
20
|
+
ruby-version: ${{ matrix.ruby-version }}
|
|
21
|
+
bundler-cache: true
|
|
22
|
+
- run: sh bin/test
|
|
23
|
+
style:
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
permissions:
|
|
26
|
+
contents: read
|
|
27
|
+
steps:
|
|
28
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
29
|
+
with:
|
|
30
|
+
persist-credentials: false
|
|
31
|
+
- uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
|
|
32
|
+
with:
|
|
33
|
+
ruby-version: '3.2'
|
|
34
|
+
bundler-cache: true
|
|
35
|
+
- run: sh bin/style
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
on:
|
|
3
|
+
push:
|
|
4
|
+
branches: [main]
|
|
5
|
+
permissions: {}
|
|
6
|
+
concurrency:
|
|
7
|
+
group: release
|
|
8
|
+
cancel-in-progress: false
|
|
9
|
+
queue: max
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
uses: ./.github/workflows/ci.yml
|
|
15
|
+
release-please:
|
|
16
|
+
needs: test
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
permissions:
|
|
19
|
+
contents: write
|
|
20
|
+
issues: write
|
|
21
|
+
pull-requests: write
|
|
22
|
+
outputs:
|
|
23
|
+
release_created: ${{ steps.release.outputs.release_created }}
|
|
24
|
+
sha: ${{ steps.release.outputs.sha }}
|
|
25
|
+
steps:
|
|
26
|
+
- id: release
|
|
27
|
+
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5.0.0
|
|
28
|
+
with:
|
|
29
|
+
config-file: release-please-config.json
|
|
30
|
+
manifest-file: .release-please-manifest.json
|
|
31
|
+
publish:
|
|
32
|
+
needs: release-please
|
|
33
|
+
if: needs.release-please.outputs.release_created == 'true'
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
environment: rubygems
|
|
36
|
+
permissions:
|
|
37
|
+
contents: write
|
|
38
|
+
id-token: write
|
|
39
|
+
steps:
|
|
40
|
+
- run: test "$RELEASED" = "$GITHUB_SHA"
|
|
41
|
+
env:
|
|
42
|
+
RELEASED: ${{ needs.release-please.outputs.sha }}
|
|
43
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
44
|
+
with:
|
|
45
|
+
persist-credentials: false
|
|
46
|
+
- uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
|
|
47
|
+
with:
|
|
48
|
+
ruby-version: '4.0'
|
|
49
|
+
bundler-cache: true
|
|
50
|
+
- uses: rubygems/release-gem@5c53f5308233b7c0f47411f0471b3faae6fa57b2 # v1.4.2
|
|
51
|
+
with:
|
|
52
|
+
await-release: false
|
data/.rubocop.yml
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
- rubocop/cop/internal_affairs
|
|
1
|
+
plugins:
|
|
3
2
|
- rubocop-rspec
|
|
4
3
|
|
|
5
4
|
AllCops:
|
|
@@ -9,7 +8,15 @@ AllCops:
|
|
|
9
8
|
- 'spec/fixtures/**/*'
|
|
10
9
|
- 'tmp/**/*'
|
|
11
10
|
- 'vendor/**/*'
|
|
12
|
-
|
|
11
|
+
NewCops: disable
|
|
12
|
+
SuggestExtensions: false
|
|
13
|
+
TargetRubyVersion: 3.2
|
|
14
|
+
|
|
15
|
+
Layout/BlockAlignment:
|
|
16
|
+
EnforcedStyleAlignWith: start_of_line
|
|
17
|
+
Exclude:
|
|
18
|
+
- 'lib/**/*.builder'
|
|
19
|
+
- 'spec/**/*'
|
|
13
20
|
|
|
14
21
|
Layout/ClassStructure:
|
|
15
22
|
Enabled: true
|
|
@@ -33,9 +40,6 @@ Layout/EndOfLine:
|
|
|
33
40
|
Layout/FirstArrayElementIndentation:
|
|
34
41
|
EnforcedStyle: consistent
|
|
35
42
|
|
|
36
|
-
Layout/HeredocIndentation:
|
|
37
|
-
EnforcedStyle: active_support
|
|
38
|
-
|
|
39
43
|
Layout/MultilineOperationIndentation:
|
|
40
44
|
EnforcedStyle: indented
|
|
41
45
|
|
|
@@ -43,6 +47,17 @@ Lint/AmbiguousBlockAssociation:
|
|
|
43
47
|
Exclude:
|
|
44
48
|
- 'spec/**/*.rb'
|
|
45
49
|
|
|
50
|
+
Lint/ConstantDefinitionInBlock:
|
|
51
|
+
Exclude:
|
|
52
|
+
- 'spec/xml/kit/templatable_spec.rb'
|
|
53
|
+
|
|
54
|
+
Lint/DeprecatedOpenSSLConstant:
|
|
55
|
+
Enabled: false
|
|
56
|
+
|
|
57
|
+
Lint/EmptyFile:
|
|
58
|
+
Exclude:
|
|
59
|
+
- 'lib/xml/kit/templates/nil_class.builder'
|
|
60
|
+
|
|
46
61
|
Lint/InterpolationCheck:
|
|
47
62
|
Exclude:
|
|
48
63
|
- 'spec/**/*.rb'
|
|
@@ -63,8 +78,8 @@ Metrics/ModuleLength:
|
|
|
63
78
|
Exclude:
|
|
64
79
|
- 'spec/**/*.rb'
|
|
65
80
|
|
|
66
|
-
|
|
67
|
-
|
|
81
|
+
Layout/LineLength:
|
|
82
|
+
AllowedPatterns: ['(\A|\s)#']
|
|
68
83
|
Exclude:
|
|
69
84
|
- 'spec/**/*.rb'
|
|
70
85
|
- 'lib/xml/kit/templates/*.builder'
|
|
@@ -73,12 +88,30 @@ Naming/FileName:
|
|
|
73
88
|
Exclude:
|
|
74
89
|
- 'lib/xml-kit.rb'
|
|
75
90
|
|
|
91
|
+
Style/AccessorGrouping:
|
|
92
|
+
Enabled: false
|
|
93
|
+
|
|
76
94
|
Style/Documentation:
|
|
77
95
|
Enabled: false
|
|
78
96
|
|
|
79
97
|
Style/EachWithObject:
|
|
80
98
|
Enabled: false
|
|
81
99
|
|
|
100
|
+
Style/GlobalStdStream:
|
|
101
|
+
Enabled: false
|
|
102
|
+
|
|
103
|
+
Style/KeywordParametersOrder:
|
|
104
|
+
Enabled: false
|
|
105
|
+
|
|
106
|
+
Style/MutableConstant:
|
|
107
|
+
Enabled: false
|
|
108
|
+
|
|
109
|
+
Style/RedundantFreeze:
|
|
110
|
+
Enabled: false
|
|
111
|
+
|
|
112
|
+
Style/SlicingWithRange:
|
|
113
|
+
Enabled: false
|
|
114
|
+
|
|
82
115
|
Style/StringLiterals:
|
|
83
116
|
EnforcedStyle: 'single_quotes'
|
|
84
117
|
|
|
@@ -91,10 +124,17 @@ Style/TrailingCommaInHashLiteral:
|
|
|
91
124
|
RSpec/ExampleLength:
|
|
92
125
|
Max: 80
|
|
93
126
|
|
|
127
|
+
RSpec/IdenticalEqualityAssertion:
|
|
128
|
+
Exclude:
|
|
129
|
+
- 'spec/xml/kit/certificate_spec.rb'
|
|
130
|
+
|
|
94
131
|
RSpec/LeakyConstantDeclaration:
|
|
95
132
|
Exclude:
|
|
96
133
|
- 'spec/xml/kit/templatable_spec.rb'
|
|
97
134
|
|
|
135
|
+
RSpec/MatchArray:
|
|
136
|
+
Enabled: false
|
|
137
|
+
|
|
98
138
|
RSpec/MultipleExpectations:
|
|
99
139
|
Enabled: false
|
|
100
140
|
|
|
@@ -107,9 +147,16 @@ RSpec/NamedSubject:
|
|
|
107
147
|
RSpec/NestedGroups:
|
|
108
148
|
Max: 7
|
|
109
149
|
|
|
150
|
+
RSpec/SpecFilePathFormat:
|
|
151
|
+
Exclude:
|
|
152
|
+
- 'spec/xml/kit/kit_spec.rb'
|
|
153
|
+
|
|
110
154
|
RSpec/SubjectStub:
|
|
111
155
|
Enabled: false
|
|
112
156
|
|
|
113
157
|
Style/DoubleNegation:
|
|
114
158
|
Exclude:
|
|
115
159
|
- 'lib/xml/kit/certificate.rb'
|
|
160
|
+
|
|
161
|
+
Style/YodaCondition:
|
|
162
|
+
Enabled: false
|
data/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
|
-
Version 0.5.0
|
|
2
|
-
|
|
3
1
|
# Changelog
|
|
4
2
|
All notable changes to this project will be documented in this file.
|
|
5
3
|
|
|
6
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
7
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
6
|
|
|
9
|
-
## [
|
|
7
|
+
## [0.7.0](https://github.com/mokhan-ca/xml-kit/compare/v0.6.0...v0.7.0) (2026-11-25)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* raise for unknown decryption algorithms
|
|
13
|
+
* require nokogiri 1.19.1
|
|
14
|
+
* require strict xml and the xmlenc and xmldsig namespaces to decrypt
|
|
15
|
+
* require ruby 3.2
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* require ruby 3.2 ([de4163b](https://github.com/mokhan-ca/xml-kit/commit/de4163b998854521f45fd30c5d7b442591ec4cad))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* decrypt with each private key when openssl hides a wrong one ([b0597f0](https://github.com/mokhan-ca/xml-kit/commit/b0597f0547af3c5f76598a2555fbae866d948da7))
|
|
25
|
+
* link the gem to its repository and changelog ([c5549ee](https://github.com/mokhan-ca/xml-kit/commit/c5549eec7edb7d335834eddbadc8758a8b4ef8ef))
|
|
26
|
+
* raise for unknown decryption algorithms ([b65beac](https://github.com/mokhan-ca/xml-kit/commit/b65beac86d7a26db81ef21227c90a43ab9a127f6))
|
|
27
|
+
* require nokogiri 1.19.1 ([9f16831](https://github.com/mokhan-ca/xml-kit/commit/9f168319880243c62cc7f48fcd2903ac0b1e2e2e))
|
|
28
|
+
* require strict xml and the xmlenc and xmldsig namespaces to decrypt ([762c835](https://github.com/mokhan-ca/xml-kit/commit/762c83532d5bfd99f3f8521d86a4b0276d73f80b))
|
|
29
|
+
|
|
30
|
+
## [0.6.0] - 2022-05-23
|
|
31
|
+
### Added
|
|
32
|
+
- Add support for Ruby 3.1
|
|
33
|
+
|
|
34
|
+
### Removed
|
|
35
|
+
- Drop support for Ruby 2.5
|
|
36
|
+
- Drop support for Ruby 2.6
|
|
10
37
|
|
|
11
38
|
## [0.5.0] - 2021-01-30
|
|
12
39
|
### Changed
|
|
@@ -37,24 +64,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
37
64
|
- \_assign does not coerce values by default.
|
|
38
65
|
- errors are merged together instead of overwritten during attribute validation.
|
|
39
66
|
|
|
40
|
-
[Unreleased]: https://github.com/
|
|
41
|
-
[0.
|
|
42
|
-
[0.
|
|
43
|
-
[0.
|
|
44
|
-
[0.3.
|
|
45
|
-
[0.
|
|
46
|
-
[0.
|
|
47
|
-
[0.1.
|
|
48
|
-
[0.1.
|
|
49
|
-
[0.1.
|
|
50
|
-
[0.1.
|
|
51
|
-
[0.1.
|
|
52
|
-
[0.1.
|
|
53
|
-
[0.1.
|
|
54
|
-
[0.1.
|
|
55
|
-
[0.1.
|
|
56
|
-
[0.1.
|
|
57
|
-
[0.1.
|
|
58
|
-
[0.1.
|
|
59
|
-
[0.1.1]: https://github.com/
|
|
60
|
-
[0.1.
|
|
67
|
+
[Unreleased]: https://github.com/xlgmokha/xml-kit/compare/v0.6.0...HEAD
|
|
68
|
+
[0.6.0]: https://github.com/xlgmokha/xml-kit/compare/v0.5.0...v0.6.0
|
|
69
|
+
[0.5.0]: https://github.com/xlgmokha/xml-kit/compare/v0.4.0...v0.5.0
|
|
70
|
+
[0.4.0]: https://github.com/xlgmokha/xml-kit/compare/v0.3.1...v0.4.0
|
|
71
|
+
[0.3.1]: https://github.com/xlgmokha/xml-kit/compare/v0.3.0...v0.3.1
|
|
72
|
+
[0.3.0]: https://github.com/xlgmokha/xml-kit/compare/v0.2.0...v0.3.0
|
|
73
|
+
[0.2.0]: https://github.com/xlgmokha/xml-kit/compare/v0.1.14...v0.2.0
|
|
74
|
+
[0.1.14]: https://github.com/xlgmokha/xml-kit/compare/v0.1.13...v0.1.14
|
|
75
|
+
[0.1.13]: https://github.com/xlgmokha/xml-kit/compare/v0.1.12...v0.1.13
|
|
76
|
+
[0.1.12]: https://github.com/xlgmokha/xml-kit/compare/v0.1.11...v0.1.12
|
|
77
|
+
[0.1.11]: https://github.com/xlgmokha/xml-kit/compare/v0.1.10...v0.1.11
|
|
78
|
+
[0.1.10]: https://github.com/xlgmokha/xml-kit/compare/v0.1.9...v0.1.10
|
|
79
|
+
[0.1.9]: https://github.com/xlgmokha/xml-kit/compare/v0.1.8...v0.1.9
|
|
80
|
+
[0.1.8]: https://github.com/xlgmokha/xml-kit/compare/v0.1.7...v0.1.8
|
|
81
|
+
[0.1.7]: https://github.com/xlgmokha/xml-kit/compare/v0.1.6...v0.1.7
|
|
82
|
+
[0.1.6]: https://github.com/xlgmokha/xml-kit/compare/v0.1.5...v0.1.6
|
|
83
|
+
[0.1.5]: https://github.com/xlgmokha/xml-kit/compare/v0.1.4...v0.1.5
|
|
84
|
+
[0.1.4]: https://github.com/xlgmokha/xml-kit/compare/v0.1.3...v0.1.4
|
|
85
|
+
[0.1.3]: https://github.com/xlgmokha/xml-kit/compare/v0.1.1...v0.1.3
|
|
86
|
+
[0.1.1]: https://github.com/xlgmokha/xml-kit/compare/v0.1.1...v0.1.1
|
|
87
|
+
[0.1.1]: https://github.com/xlgmokha/xml-kit/compare/v0.1.0...v0.1.1
|
|
88
|
+
[0.1.0]: https://github.com/xlgmokha/xml-kit/compare/v0.1.0...v0.1.0
|
data/Gemfile.lock
CHANGED
|
@@ -1,104 +1,148 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
xml-kit (0.
|
|
4
|
+
xml-kit (0.7.0)
|
|
5
5
|
activemodel (>= 4.2.0)
|
|
6
6
|
builder (~> 3.2)
|
|
7
|
-
nokogiri (~> 1.
|
|
7
|
+
nokogiri (~> 1.19, >= 1.19.1)
|
|
8
8
|
tilt (>= 1.4.1)
|
|
9
9
|
xmldsig (~> 0.6)
|
|
10
10
|
|
|
11
11
|
GEM
|
|
12
12
|
remote: https://rubygems.org/
|
|
13
13
|
specs:
|
|
14
|
-
activemodel (
|
|
15
|
-
activesupport (=
|
|
16
|
-
activesupport (
|
|
17
|
-
|
|
14
|
+
activemodel (8.1.4.1)
|
|
15
|
+
activesupport (= 8.1.4.1)
|
|
16
|
+
activesupport (8.1.4.1)
|
|
17
|
+
base64
|
|
18
|
+
bigdecimal
|
|
19
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
|
20
|
+
connection_pool (>= 2.2.5)
|
|
21
|
+
drb
|
|
18
22
|
i18n (>= 1.6, < 2)
|
|
23
|
+
json
|
|
24
|
+
logger (>= 1.4.2)
|
|
19
25
|
minitest (>= 5.1)
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
securerandom (>= 0.3)
|
|
27
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
|
28
|
+
uri (>= 0.13.1)
|
|
22
29
|
ast (2.4.2)
|
|
30
|
+
base64 (0.3.0)
|
|
31
|
+
bigdecimal (4.1.3)
|
|
23
32
|
builder (3.2.4)
|
|
24
|
-
bundler-audit (0.
|
|
25
|
-
bundler (>= 1.2.0
|
|
26
|
-
thor (
|
|
27
|
-
concurrent-ruby (1.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
bundler-audit (0.9.3)
|
|
34
|
+
bundler (>= 1.2.0)
|
|
35
|
+
thor (~> 1.0)
|
|
36
|
+
concurrent-ruby (1.3.8)
|
|
37
|
+
connection_pool (3.0.3)
|
|
38
|
+
diff-lcs (1.5.0)
|
|
39
|
+
docile (1.4.0)
|
|
40
|
+
drb (2.2.3)
|
|
41
|
+
ffaker (2.21.0)
|
|
42
|
+
i18n (1.12.0)
|
|
32
43
|
concurrent-ruby (~> 1.0)
|
|
33
|
-
json (2.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
44
|
+
json (3.2.0)
|
|
45
|
+
language_server-protocol (3.17.0.6)
|
|
46
|
+
lint_roller (1.1.0)
|
|
47
|
+
logger (1.7.0)
|
|
48
|
+
mini_portile2 (2.8.9)
|
|
49
|
+
minitest (6.1.0)
|
|
50
|
+
drb (~> 2.0)
|
|
51
|
+
prism (>= 1.5, < 3)
|
|
52
|
+
nokogiri (1.19.7)
|
|
53
|
+
mini_portile2 (~> 2.8.2)
|
|
38
54
|
racc (~> 1.4)
|
|
39
|
-
|
|
40
|
-
|
|
55
|
+
nokogiri (1.19.7-aarch64-linux-gnu)
|
|
56
|
+
racc (~> 1.4)
|
|
57
|
+
nokogiri (1.19.7-arm64-darwin)
|
|
58
|
+
racc (~> 1.4)
|
|
59
|
+
nokogiri (1.19.7-x86_64-darwin)
|
|
60
|
+
racc (~> 1.4)
|
|
61
|
+
nokogiri (1.19.7-x86_64-linux-gnu)
|
|
62
|
+
racc (~> 1.4)
|
|
63
|
+
parallel (1.22.1)
|
|
64
|
+
parser (3.3.14.0)
|
|
41
65
|
ast (~> 2.4.1)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
rspec
|
|
66
|
+
racc
|
|
67
|
+
prism (2.1.0)
|
|
68
|
+
prism (2.1.0-aarch64-linux-gnu)
|
|
69
|
+
prism (2.1.0-arm64-darwin)
|
|
70
|
+
prism (2.1.0-x86_64-darwin)
|
|
71
|
+
prism (2.1.0-x86_64-linux-gnu)
|
|
72
|
+
racc (1.6.0)
|
|
73
|
+
rainbow (3.1.1)
|
|
74
|
+
rake (13.4.2)
|
|
75
|
+
regexp_parser (2.13.4)
|
|
76
|
+
rexml (3.4.4)
|
|
77
|
+
rspec (3.12.0)
|
|
78
|
+
rspec-core (~> 3.12.0)
|
|
79
|
+
rspec-expectations (~> 3.12.0)
|
|
80
|
+
rspec-mocks (~> 3.12.0)
|
|
81
|
+
rspec-core (3.12.0)
|
|
82
|
+
rspec-support (~> 3.12.0)
|
|
83
|
+
rspec-expectations (3.12.0)
|
|
54
84
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
55
|
-
rspec-support (~> 3.
|
|
56
|
-
rspec-mocks (3.
|
|
85
|
+
rspec-support (~> 3.12.0)
|
|
86
|
+
rspec-mocks (3.12.0)
|
|
57
87
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
58
|
-
rspec-support (~> 3.
|
|
59
|
-
rspec-support (3.
|
|
60
|
-
rubocop (
|
|
61
|
-
|
|
62
|
-
|
|
88
|
+
rspec-support (~> 3.12.0)
|
|
89
|
+
rspec-support (3.12.0)
|
|
90
|
+
rubocop (1.92.3)
|
|
91
|
+
json (>= 2.3)
|
|
92
|
+
language_server-protocol (~> 3.17.0.2)
|
|
93
|
+
lint_roller (~> 1.1.0)
|
|
94
|
+
parallel (>= 1.10)
|
|
95
|
+
parser (>= 3.3.0.2)
|
|
63
96
|
rainbow (>= 2.2.2, < 4.0)
|
|
64
|
-
regexp_parser (>=
|
|
65
|
-
|
|
66
|
-
rubocop-ast (>= 0.6.0)
|
|
97
|
+
regexp_parser (>= 2.11.3, < 3.0)
|
|
98
|
+
rubocop-ast (>= 1.49.0, < 2.0)
|
|
67
99
|
ruby-progressbar (~> 1.7)
|
|
68
|
-
unicode-display_width (>=
|
|
69
|
-
rubocop-ast (1.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
100
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
|
101
|
+
rubocop-ast (1.53.0)
|
|
102
|
+
ast (~> 2.4)
|
|
103
|
+
parser (>= 3.3.7.2)
|
|
104
|
+
prism (>= 1.7)
|
|
105
|
+
racc
|
|
106
|
+
rubocop-rspec (3.10.2)
|
|
107
|
+
lint_roller (~> 1.1)
|
|
108
|
+
regexp_parser (>= 2.0)
|
|
109
|
+
rubocop (~> 1.86, >= 1.86.2)
|
|
74
110
|
ruby-progressbar (1.11.0)
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
simplecov-html (~> 0.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
111
|
+
securerandom (0.4.1)
|
|
112
|
+
simplecov (0.21.2)
|
|
113
|
+
docile (~> 1.1)
|
|
114
|
+
simplecov-html (~> 0.11)
|
|
115
|
+
simplecov_json_formatter (~> 0.1)
|
|
116
|
+
simplecov-html (0.12.3)
|
|
117
|
+
simplecov_json_formatter (0.1.4)
|
|
118
|
+
thor (1.2.1)
|
|
119
|
+
tilt (2.0.11)
|
|
120
|
+
tzinfo (2.0.5)
|
|
83
121
|
concurrent-ruby (~> 1.0)
|
|
84
|
-
unicode-display_width (
|
|
85
|
-
|
|
122
|
+
unicode-display_width (3.3.0)
|
|
123
|
+
unicode-emoji (~> 4.3)
|
|
124
|
+
unicode-emoji (4.3.0)
|
|
125
|
+
uri (1.1.2)
|
|
126
|
+
xmldsig (0.7.0)
|
|
86
127
|
nokogiri (>= 1.6.8, < 2.0.0)
|
|
87
|
-
zeitwerk (2.4.2)
|
|
88
128
|
|
|
89
129
|
PLATFORMS
|
|
130
|
+
aarch64-linux
|
|
131
|
+
arm64-darwin
|
|
90
132
|
ruby
|
|
133
|
+
x86_64-darwin
|
|
134
|
+
x86_64-linux
|
|
91
135
|
|
|
92
136
|
DEPENDENCIES
|
|
93
|
-
bundler (~> 2.0)
|
|
94
137
|
bundler-audit (~> 0.6)
|
|
95
138
|
ffaker (~> 2.7)
|
|
96
139
|
rake (~> 13.0)
|
|
140
|
+
rexml (~> 3.0)
|
|
97
141
|
rspec (~> 3.0)
|
|
98
|
-
rubocop (~> 0
|
|
99
|
-
rubocop-rspec (~>
|
|
100
|
-
simplecov (~> 0.
|
|
142
|
+
rubocop (~> 1.0)
|
|
143
|
+
rubocop-rspec (~> 3.0)
|
|
144
|
+
simplecov (~> 0.21.2)
|
|
101
145
|
xml-kit!
|
|
102
146
|
|
|
103
147
|
BUNDLED WITH
|
|
104
|
-
|
|
148
|
+
4.0.17
|
data/LICENSE.txt
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2017 mo
|
|
3
|
+
Copyright (c) 2017 mo khan
|
|
4
|
+
Copyright (c) 2026 2809074 Alberta Ltd.
|
|
4
5
|
|
|
5
6
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
7
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
# Xml::Kit
|
|
2
2
|
|
|
3
|
+
[](https://github.com/xlgmokha/xml-kit/actions)
|
|
3
4
|
[](https://rubygems.org/gems/xml-kit)
|
|
4
|
-
[](https://codeclimate.com/github/saml-kit/xml-kit)
|
|
5
|
-
[](https://travis-ci.org/saml-kit/xml-kit)
|
|
6
|
-
[](https://hakiri.io/github/saml-kit/xml-kit/master)
|
|
7
5
|
|
|
8
6
|
Xml::Kit is a toolkit for working with XML. It supports adding [XML Digital Signatures](https://www.w3.org/TR/xmldsig-core/)
|
|
9
7
|
and [XML Encryption](https://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html).
|
|
@@ -113,13 +111,13 @@ This will produce something like the following:
|
|
|
113
111
|
|
|
114
112
|
## Development
|
|
115
113
|
|
|
116
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `
|
|
114
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
|
117
115
|
|
|
118
116
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
119
117
|
|
|
120
118
|
## Contributing
|
|
121
119
|
|
|
122
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
120
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/xlgmokha/xml-kit.
|
|
123
121
|
|
|
124
122
|
## License
|
|
125
123
|
|
data/Rakefile
CHANGED
data/bin/audit
ADDED
data/bin/setup
CHANGED
data/bin/style
ADDED
data/bin/test
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
#!/bin/sh
|
|
2
2
|
|
|
3
|
-
# script/test: Run test suite for application. Optionally pass in a path to an
|
|
4
|
-
# individual test file to run a single test.
|
|
5
|
-
|
|
6
|
-
|
|
7
3
|
set -e
|
|
8
|
-
|
|
9
|
-
cd "$(dirname "$0")/.."
|
|
10
|
-
|
|
11
4
|
[ -z "$DEBUG" ] || set -x
|
|
12
5
|
|
|
13
|
-
|
|
14
|
-
bin/setup
|
|
6
|
+
cd "$(dirname "$0")/.."
|
|
15
7
|
|
|
16
|
-
echo [$(date "+%H:%M:%S")] "==> Running tests…"
|
|
17
8
|
bundle exec rake spec
|
|
@@ -10,15 +10,15 @@ module Xml
|
|
|
10
10
|
}.freeze
|
|
11
11
|
attr_reader :algorithm, :key
|
|
12
12
|
|
|
13
|
+
def self.matches?(algorithm)
|
|
14
|
+
ALGORITHMS[algorithm]
|
|
15
|
+
end
|
|
16
|
+
|
|
13
17
|
def initialize(algorithm, key)
|
|
14
18
|
@algorithm = algorithm
|
|
15
19
|
@key = key
|
|
16
20
|
end
|
|
17
21
|
|
|
18
|
-
def self.matches?(algorithm)
|
|
19
|
-
ALGORITHMS[algorithm]
|
|
20
|
-
end
|
|
21
|
-
|
|
22
22
|
def encrypt(plain_text)
|
|
23
23
|
@key.public_encrypt(plain_text, padding)
|
|
24
24
|
end
|
|
@@ -7,15 +7,15 @@ module Xml
|
|
|
7
7
|
ALGORITHM = "#{::Xml::Kit::Namespaces::XMLENC}rsa-1_5"
|
|
8
8
|
attr_reader :algorithm, :key
|
|
9
9
|
|
|
10
|
+
def self.matches?(algorithm)
|
|
11
|
+
ALGORITHM == algorithm
|
|
12
|
+
end
|
|
13
|
+
|
|
10
14
|
def initialize(algorithm, key)
|
|
11
15
|
@algorithm = algorithm
|
|
12
16
|
@key = key
|
|
13
17
|
end
|
|
14
18
|
|
|
15
|
-
def self.matches?(algorithm)
|
|
16
|
-
ALGORITHM == algorithm
|
|
17
|
-
end
|
|
18
|
-
|
|
19
19
|
def encrypt(plain_text)
|
|
20
20
|
@key.public_encrypt(plain_text)
|
|
21
21
|
end
|
|
@@ -14,16 +14,16 @@ module Xml
|
|
|
14
14
|
|
|
15
15
|
attr_reader :algorithm, :key, :padding
|
|
16
16
|
|
|
17
|
+
def self.matches?(algorithm)
|
|
18
|
+
ALGORITHMS[algorithm]
|
|
19
|
+
end
|
|
20
|
+
|
|
17
21
|
def initialize(algorithm = DEFAULT_ALGORITHM, key = nil, padding = nil)
|
|
18
22
|
@algorithm = algorithm
|
|
19
23
|
@key = key || cipher.random_key
|
|
20
24
|
@padding = padding
|
|
21
25
|
end
|
|
22
26
|
|
|
23
|
-
def self.matches?(algorithm)
|
|
24
|
-
ALGORITHMS[algorithm]
|
|
25
|
-
end
|
|
26
|
-
|
|
27
27
|
def encrypt(plain_text)
|
|
28
28
|
cipher.encrypt
|
|
29
29
|
cipher.key = @key
|
|
@@ -6,17 +6,17 @@ module Xml
|
|
|
6
6
|
class UnknownCipher
|
|
7
7
|
attr_reader :algorithm, :key
|
|
8
8
|
|
|
9
|
+
def self.matches?(_algorithm)
|
|
10
|
+
true
|
|
11
|
+
end
|
|
12
|
+
|
|
9
13
|
def initialize(algorithm, key)
|
|
10
14
|
@algorithm = algorithm
|
|
11
15
|
@key = key
|
|
12
16
|
end
|
|
13
17
|
|
|
14
|
-
def
|
|
15
|
-
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def decrypt(cipher_text)
|
|
19
|
-
cipher_text
|
|
18
|
+
def decrypt(_cipher_text)
|
|
19
|
+
raise ::Xml::Kit::Error, "Unknown algorithm: #{algorithm.inspect}"
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
end
|
data/lib/xml/kit/decryption.rb
CHANGED
|
@@ -4,6 +4,16 @@ module Xml
|
|
|
4
4
|
module Kit
|
|
5
5
|
# {include:file:spec/xml/kit/decryption_spec.rb}
|
|
6
6
|
class Decryption
|
|
7
|
+
ELEMENTS = %w[
|
|
8
|
+
xenc:EncryptionMethod
|
|
9
|
+
ds:KeyInfo[not(parent::xenc:EncryptedKey)]
|
|
10
|
+
xenc:EncryptedKey
|
|
11
|
+
xenc:CipherData
|
|
12
|
+
xenc:CipherValue
|
|
13
|
+
].join('|').freeze
|
|
14
|
+
NAMESPACES = { 'ds' => Namespaces::XMLDSIG, 'xenc' => Namespaces::XMLENC }.freeze
|
|
15
|
+
private_constant :ELEMENTS, :NAMESPACES
|
|
16
|
+
|
|
7
17
|
# The list of private keys to use to attempt to decrypt the document.
|
|
8
18
|
attr_reader :cipher_registry, :private_keys
|
|
9
19
|
|
|
@@ -27,7 +37,7 @@ module Xml
|
|
|
27
37
|
#
|
|
28
38
|
# @param raw_xml [String] the XML document as a string.
|
|
29
39
|
def decrypt_xml(raw_xml)
|
|
30
|
-
|
|
40
|
+
decrypt_element(Nokogiri::XML(raw_xml, &:strict).root)
|
|
31
41
|
end
|
|
32
42
|
|
|
33
43
|
# Decrypts an EncryptedData section of an XML document.
|
|
@@ -35,11 +45,9 @@ module Xml
|
|
|
35
45
|
# @param hash [Hash] the XML document converted to a [Hash] using Hash.from_xml.
|
|
36
46
|
def decrypt_hash(hash)
|
|
37
47
|
data = hash['EncryptedData']
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
data['EncryptionMethod']['Algorithm']
|
|
42
|
-
)
|
|
48
|
+
with_each_private_key do |private_key|
|
|
49
|
+
to_plaintext(data, to_plaintext(data['KeyInfo']['EncryptedKey'], private_key))
|
|
50
|
+
end
|
|
43
51
|
end
|
|
44
52
|
|
|
45
53
|
# Decrypts an EncryptedData Nokogiri::XML::Element.
|
|
@@ -48,31 +56,39 @@ module Xml
|
|
|
48
56
|
def decrypt_node(node)
|
|
49
57
|
return node unless !node.nil? && node.name == 'EncryptedData'
|
|
50
58
|
|
|
51
|
-
node.parent.replace(
|
|
59
|
+
node.parent.replace(decrypt_element(node))[0]
|
|
52
60
|
end
|
|
53
61
|
|
|
54
62
|
private
|
|
55
63
|
|
|
56
|
-
def
|
|
57
|
-
|
|
64
|
+
def decrypt_element(element)
|
|
65
|
+
decrypt_hash(element.name => hash_from(element))
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def hash_from(element)
|
|
69
|
+
return element.text if element.name == 'CipherValue'
|
|
70
|
+
|
|
71
|
+
children = element.xpath(ELEMENTS, NAMESPACES)
|
|
72
|
+
raise Error, "#{element.name} contains repeated elements" if children.uniq(&:name).size < children.size
|
|
73
|
+
|
|
74
|
+
hash = children.to_h { |child| [child.name, hash_from(child)] }
|
|
75
|
+
hash.merge('Algorithm' => element['Algorithm']).compact.presence
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
def with_each_private_key(attempts = private_keys.count)
|
|
58
79
|
private_keys.each do |private_key|
|
|
59
80
|
attempts -= 1
|
|
60
|
-
return
|
|
61
|
-
rescue OpenSSL::
|
|
81
|
+
return yield(private_key)
|
|
82
|
+
rescue OpenSSL::OpenSSLError, ArgumentError
|
|
62
83
|
raise if attempts.zero?
|
|
63
84
|
end
|
|
64
85
|
raise DecryptionError, private_keys
|
|
65
86
|
end
|
|
66
87
|
|
|
67
|
-
def to_plaintext(
|
|
68
|
-
cipher_registry
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def cipher_and_algorithm_from(encrypted_key)
|
|
72
|
-
[
|
|
73
|
-
Base64.decode64(encrypted_key['CipherData']['CipherValue']),
|
|
74
|
-
encrypted_key['EncryptionMethod']['Algorithm']
|
|
75
|
-
]
|
|
88
|
+
def to_plaintext(element, key)
|
|
89
|
+
cipher_registry
|
|
90
|
+
.cipher_for(element['EncryptionMethod']['Algorithm'], key)
|
|
91
|
+
.decrypt(Base64.decode64(element['CipherData']['CipherValue']))
|
|
76
92
|
end
|
|
77
93
|
end
|
|
78
94
|
end
|
data/lib/xml/kit/key_pair.rb
CHANGED
|
@@ -7,6 +7,22 @@ module Xml
|
|
|
7
7
|
attr_reader :private_key
|
|
8
8
|
attr_reader :public_key
|
|
9
9
|
|
|
10
|
+
# Returns a generated self signed certificate with private key.
|
|
11
|
+
#
|
|
12
|
+
# @param use [Symbol] Can be either `:signing` or `:encryption`.
|
|
13
|
+
# @param passphrase [String] the passphrase to use to encrypt the private key.
|
|
14
|
+
# @param algorithm [String] the symmetric algorithm to use for encrypting the private key.
|
|
15
|
+
def self.generate(use:,
|
|
16
|
+
passphrase: SecureRandom.uuid,
|
|
17
|
+
algorithm: Crypto::SymmetricCipher::DEFAULT_ALGORITHM)
|
|
18
|
+
algorithm = Crypto::SymmetricCipher::ALGORITHMS[algorithm]
|
|
19
|
+
certificate, private_key = SelfSignedCertificate.new.create(
|
|
20
|
+
algorithm: algorithm,
|
|
21
|
+
passphrase: passphrase
|
|
22
|
+
)
|
|
23
|
+
new(certificate, private_key, passphrase, use)
|
|
24
|
+
end
|
|
25
|
+
|
|
10
26
|
def initialize(certificate, private_key, passphrase, use)
|
|
11
27
|
@certificate = ::Xml::Kit::Certificate.new(certificate, use: use)
|
|
12
28
|
@private_key =
|
|
@@ -24,22 +40,6 @@ module Xml
|
|
|
24
40
|
def for?(use)
|
|
25
41
|
certificate.for?(use)
|
|
26
42
|
end
|
|
27
|
-
|
|
28
|
-
# Returns a generated self signed certificate with private key.
|
|
29
|
-
#
|
|
30
|
-
# @param use [Symbol] Can be either `:signing` or `:encryption`.
|
|
31
|
-
# @param passphrase [String] the passphrase to use to encrypt the private key.
|
|
32
|
-
# @param algorithm [String] the symmetric algorithm to use for encrypting the private key.
|
|
33
|
-
def self.generate(use:,
|
|
34
|
-
passphrase: SecureRandom.uuid,
|
|
35
|
-
algorithm: Crypto::SymmetricCipher::DEFAULT_ALGORITHM)
|
|
36
|
-
algorithm = Crypto::SymmetricCipher::ALGORITHMS[algorithm]
|
|
37
|
-
certificate, private_key = SelfSignedCertificate.new.create(
|
|
38
|
-
algorithm: algorithm,
|
|
39
|
-
passphrase: passphrase
|
|
40
|
-
)
|
|
41
|
-
new(certificate, private_key, passphrase, use)
|
|
42
|
-
end
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
end
|
data/lib/xml/kit/signatures.rb
CHANGED
|
@@ -6,6 +6,20 @@ module Xml
|
|
|
6
6
|
class Signatures # :nodoc:
|
|
7
7
|
attr_reader :key_pair, :signature_method, :digest_method
|
|
8
8
|
|
|
9
|
+
# @!visibility private
|
|
10
|
+
def self.sign(xml: ::Builder::XmlMarkup.new,
|
|
11
|
+
key_pair:,
|
|
12
|
+
signature_method: :SHA256,
|
|
13
|
+
digest_method: :SHA256)
|
|
14
|
+
signatures = new(
|
|
15
|
+
key_pair: key_pair,
|
|
16
|
+
signature_method: signature_method,
|
|
17
|
+
digest_method: digest_method
|
|
18
|
+
)
|
|
19
|
+
yield xml, XmlSignatureTemplate.new(xml, signatures)
|
|
20
|
+
signatures.complete(xml.target!)
|
|
21
|
+
end
|
|
22
|
+
|
|
9
23
|
# @!visibility private
|
|
10
24
|
def initialize(key_pair:, signature_method:, digest_method:)
|
|
11
25
|
@digest_method = digest_method
|
|
@@ -38,20 +52,6 @@ module Xml
|
|
|
38
52
|
Xmldsig::SignedDocument.new(raw_xml).sign(private_key, false)
|
|
39
53
|
end
|
|
40
54
|
|
|
41
|
-
# @!visibility private
|
|
42
|
-
def self.sign(xml: ::Builder::XmlMarkup.new,
|
|
43
|
-
key_pair:,
|
|
44
|
-
signature_method: :SHA256,
|
|
45
|
-
digest_method: :SHA256)
|
|
46
|
-
signatures = new(
|
|
47
|
-
key_pair: key_pair,
|
|
48
|
-
signature_method: signature_method,
|
|
49
|
-
digest_method: digest_method
|
|
50
|
-
)
|
|
51
|
-
yield xml, XmlSignatureTemplate.new(xml, signatures)
|
|
52
|
-
signatures.complete(xml.target!)
|
|
53
|
-
end
|
|
54
|
-
|
|
55
55
|
class XmlSignatureTemplate # :nodoc:
|
|
56
56
|
# @!visibility private
|
|
57
57
|
attr_reader :signatures, :xml
|
data/lib/xml/kit/version.rb
CHANGED
data/xml-kit.gemspec
CHANGED
|
@@ -12,29 +12,33 @@ Gem::Specification.new do |spec|
|
|
|
12
12
|
|
|
13
13
|
spec.summary = 'A simple toolkit for working with XML.'
|
|
14
14
|
spec.description = 'A simple toolkit for working with XML.'
|
|
15
|
-
spec.homepage = 'https://github.com/
|
|
15
|
+
spec.homepage = 'https://github.com/mokhan-ca/xml-kit'
|
|
16
16
|
spec.license = 'MIT'
|
|
17
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 2.
|
|
17
|
+
spec.required_ruby_version = Gem::Requirement.new('>= 3.2.0')
|
|
18
18
|
|
|
19
19
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
|
20
20
|
f.match(%r{^(test|spec|features)/})
|
|
21
21
|
end
|
|
22
22
|
spec.metadata['yard.run'] = 'yri'
|
|
23
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
|
24
|
+
spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/main/CHANGELOG.md"
|
|
25
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
26
|
+
spec.metadata['source_code_uri'] = spec.homepage
|
|
23
27
|
spec.bindir = 'exe'
|
|
24
28
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
25
29
|
spec.require_paths = ['lib']
|
|
26
30
|
|
|
27
31
|
spec.add_dependency 'activemodel', '>= 4.2.0'
|
|
28
32
|
spec.add_dependency 'builder', '~> 3.2'
|
|
29
|
-
spec.add_dependency 'nokogiri', '~> 1.
|
|
33
|
+
spec.add_dependency 'nokogiri', '~> 1.19', '>= 1.19.1'
|
|
30
34
|
spec.add_dependency 'tilt', '>= 1.4.1'
|
|
31
35
|
spec.add_dependency 'xmldsig', '~> 0.6'
|
|
32
|
-
spec.add_development_dependency 'bundler', '~> 2.0'
|
|
33
36
|
spec.add_development_dependency 'bundler-audit', '~> 0.6'
|
|
34
37
|
spec.add_development_dependency 'ffaker', '~> 2.7'
|
|
35
38
|
spec.add_development_dependency 'rake', '~> 13.0'
|
|
39
|
+
spec.add_development_dependency 'rexml', '~> 3.0'
|
|
36
40
|
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
37
|
-
spec.add_development_dependency 'rubocop', '~> 0
|
|
38
|
-
spec.add_development_dependency 'rubocop-rspec', '~>
|
|
39
|
-
spec.add_development_dependency 'simplecov', '~> 0.
|
|
41
|
+
spec.add_development_dependency 'rubocop', '~> 1.0'
|
|
42
|
+
spec.add_development_dependency 'rubocop-rspec', '~> 3.0'
|
|
43
|
+
spec.add_development_dependency 'simplecov', '~> 0.21.2'
|
|
40
44
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xml-kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- mo khan
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activemodel
|
|
@@ -44,14 +43,20 @@ dependencies:
|
|
|
44
43
|
requirements:
|
|
45
44
|
- - "~>"
|
|
46
45
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '1.
|
|
46
|
+
version: '1.19'
|
|
47
|
+
- - ">="
|
|
48
|
+
- !ruby/object:Gem::Version
|
|
49
|
+
version: 1.19.1
|
|
48
50
|
type: :runtime
|
|
49
51
|
prerelease: false
|
|
50
52
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
53
|
requirements:
|
|
52
54
|
- - "~>"
|
|
53
55
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '1.
|
|
56
|
+
version: '1.19'
|
|
57
|
+
- - ">="
|
|
58
|
+
- !ruby/object:Gem::Version
|
|
59
|
+
version: 1.19.1
|
|
55
60
|
- !ruby/object:Gem::Dependency
|
|
56
61
|
name: tilt
|
|
57
62
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -81,61 +86,61 @@ dependencies:
|
|
|
81
86
|
- !ruby/object:Gem::Version
|
|
82
87
|
version: '0.6'
|
|
83
88
|
- !ruby/object:Gem::Dependency
|
|
84
|
-
name: bundler
|
|
89
|
+
name: bundler-audit
|
|
85
90
|
requirement: !ruby/object:Gem::Requirement
|
|
86
91
|
requirements:
|
|
87
92
|
- - "~>"
|
|
88
93
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: '
|
|
94
|
+
version: '0.6'
|
|
90
95
|
type: :development
|
|
91
96
|
prerelease: false
|
|
92
97
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
98
|
requirements:
|
|
94
99
|
- - "~>"
|
|
95
100
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: '
|
|
101
|
+
version: '0.6'
|
|
97
102
|
- !ruby/object:Gem::Dependency
|
|
98
|
-
name:
|
|
103
|
+
name: ffaker
|
|
99
104
|
requirement: !ruby/object:Gem::Requirement
|
|
100
105
|
requirements:
|
|
101
106
|
- - "~>"
|
|
102
107
|
- !ruby/object:Gem::Version
|
|
103
|
-
version: '
|
|
108
|
+
version: '2.7'
|
|
104
109
|
type: :development
|
|
105
110
|
prerelease: false
|
|
106
111
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
112
|
requirements:
|
|
108
113
|
- - "~>"
|
|
109
114
|
- !ruby/object:Gem::Version
|
|
110
|
-
version: '
|
|
115
|
+
version: '2.7'
|
|
111
116
|
- !ruby/object:Gem::Dependency
|
|
112
|
-
name:
|
|
117
|
+
name: rake
|
|
113
118
|
requirement: !ruby/object:Gem::Requirement
|
|
114
119
|
requirements:
|
|
115
120
|
- - "~>"
|
|
116
121
|
- !ruby/object:Gem::Version
|
|
117
|
-
version: '
|
|
122
|
+
version: '13.0'
|
|
118
123
|
type: :development
|
|
119
124
|
prerelease: false
|
|
120
125
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
126
|
requirements:
|
|
122
127
|
- - "~>"
|
|
123
128
|
- !ruby/object:Gem::Version
|
|
124
|
-
version: '
|
|
129
|
+
version: '13.0'
|
|
125
130
|
- !ruby/object:Gem::Dependency
|
|
126
|
-
name:
|
|
131
|
+
name: rexml
|
|
127
132
|
requirement: !ruby/object:Gem::Requirement
|
|
128
133
|
requirements:
|
|
129
134
|
- - "~>"
|
|
130
135
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: '
|
|
136
|
+
version: '3.0'
|
|
132
137
|
type: :development
|
|
133
138
|
prerelease: false
|
|
134
139
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
140
|
requirements:
|
|
136
141
|
- - "~>"
|
|
137
142
|
- !ruby/object:Gem::Version
|
|
138
|
-
version: '
|
|
143
|
+
version: '3.0'
|
|
139
144
|
- !ruby/object:Gem::Dependency
|
|
140
145
|
name: rspec
|
|
141
146
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -156,42 +161,42 @@ dependencies:
|
|
|
156
161
|
requirements:
|
|
157
162
|
- - "~>"
|
|
158
163
|
- !ruby/object:Gem::Version
|
|
159
|
-
version: '0
|
|
164
|
+
version: '1.0'
|
|
160
165
|
type: :development
|
|
161
166
|
prerelease: false
|
|
162
167
|
version_requirements: !ruby/object:Gem::Requirement
|
|
163
168
|
requirements:
|
|
164
169
|
- - "~>"
|
|
165
170
|
- !ruby/object:Gem::Version
|
|
166
|
-
version: '0
|
|
171
|
+
version: '1.0'
|
|
167
172
|
- !ruby/object:Gem::Dependency
|
|
168
173
|
name: rubocop-rspec
|
|
169
174
|
requirement: !ruby/object:Gem::Requirement
|
|
170
175
|
requirements:
|
|
171
176
|
- - "~>"
|
|
172
177
|
- !ruby/object:Gem::Version
|
|
173
|
-
version: '
|
|
178
|
+
version: '3.0'
|
|
174
179
|
type: :development
|
|
175
180
|
prerelease: false
|
|
176
181
|
version_requirements: !ruby/object:Gem::Requirement
|
|
177
182
|
requirements:
|
|
178
183
|
- - "~>"
|
|
179
184
|
- !ruby/object:Gem::Version
|
|
180
|
-
version: '
|
|
185
|
+
version: '3.0'
|
|
181
186
|
- !ruby/object:Gem::Dependency
|
|
182
187
|
name: simplecov
|
|
183
188
|
requirement: !ruby/object:Gem::Requirement
|
|
184
189
|
requirements:
|
|
185
190
|
- - "~>"
|
|
186
191
|
- !ruby/object:Gem::Version
|
|
187
|
-
version: 0.
|
|
192
|
+
version: 0.21.2
|
|
188
193
|
type: :development
|
|
189
194
|
prerelease: false
|
|
190
195
|
version_requirements: !ruby/object:Gem::Requirement
|
|
191
196
|
requirements:
|
|
192
197
|
- - "~>"
|
|
193
198
|
- !ruby/object:Gem::Version
|
|
194
|
-
version: 0.
|
|
199
|
+
version: 0.21.2
|
|
195
200
|
description: A simple toolkit for working with XML.
|
|
196
201
|
email:
|
|
197
202
|
- mo@mokhan.ca
|
|
@@ -199,21 +204,23 @@ executables: []
|
|
|
199
204
|
extensions: []
|
|
200
205
|
extra_rdoc_files: []
|
|
201
206
|
files:
|
|
207
|
+
- ".github/workflows/audit.yml"
|
|
208
|
+
- ".github/workflows/ci.yml"
|
|
209
|
+
- ".github/workflows/release.yml"
|
|
202
210
|
- ".gitignore"
|
|
203
|
-
- ".
|
|
211
|
+
- ".release-please-manifest.json"
|
|
204
212
|
- ".rspec"
|
|
205
213
|
- ".rubocop.yml"
|
|
206
|
-
- ".travis.yml"
|
|
207
214
|
- CHANGELOG.md
|
|
208
215
|
- Gemfile
|
|
209
216
|
- Gemfile.lock
|
|
210
217
|
- LICENSE.txt
|
|
211
218
|
- README.md
|
|
212
219
|
- Rakefile
|
|
213
|
-
- bin/
|
|
220
|
+
- bin/audit
|
|
214
221
|
- bin/console
|
|
215
|
-
- bin/lint
|
|
216
222
|
- bin/setup
|
|
223
|
+
- bin/style
|
|
217
224
|
- bin/test
|
|
218
225
|
- lib/xml-kit.rb
|
|
219
226
|
- lib/xml/kit.rb
|
|
@@ -252,13 +259,17 @@ files:
|
|
|
252
259
|
- lib/xml/kit/templates/rsa_key_value.builder
|
|
253
260
|
- lib/xml/kit/templates/signature.builder
|
|
254
261
|
- lib/xml/kit/version.rb
|
|
262
|
+
- release-please-config.json
|
|
255
263
|
- xml-kit.gemspec
|
|
256
|
-
homepage: https://github.com/
|
|
264
|
+
homepage: https://github.com/mokhan-ca/xml-kit
|
|
257
265
|
licenses:
|
|
258
266
|
- MIT
|
|
259
267
|
metadata:
|
|
260
268
|
yard.run: yri
|
|
261
|
-
|
|
269
|
+
allowed_push_host: https://rubygems.org
|
|
270
|
+
changelog_uri: https://github.com/mokhan-ca/xml-kit/blob/main/CHANGELOG.md
|
|
271
|
+
rubygems_mfa_required: 'true'
|
|
272
|
+
source_code_uri: https://github.com/mokhan-ca/xml-kit
|
|
262
273
|
rdoc_options: []
|
|
263
274
|
require_paths:
|
|
264
275
|
- lib
|
|
@@ -266,15 +277,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
266
277
|
requirements:
|
|
267
278
|
- - ">="
|
|
268
279
|
- !ruby/object:Gem::Version
|
|
269
|
-
version: 2.
|
|
280
|
+
version: 3.2.0
|
|
270
281
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
282
|
requirements:
|
|
272
283
|
- - ">="
|
|
273
284
|
- !ruby/object:Gem::Version
|
|
274
285
|
version: '0'
|
|
275
286
|
requirements: []
|
|
276
|
-
rubygems_version:
|
|
277
|
-
signing_key:
|
|
287
|
+
rubygems_version: 4.0.20
|
|
278
288
|
specification_version: 4
|
|
279
289
|
summary: A simple toolkit for working with XML.
|
|
280
290
|
test_files: []
|
data/.gitlab-ci.yml
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
image: ruby:2.2
|
|
2
|
-
|
|
3
|
-
before_script:
|
|
4
|
-
- apt-get update && apt-get install -y locales
|
|
5
|
-
- echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
|
|
6
|
-
- locale-gen
|
|
7
|
-
- export LC_ALL=en_US.UTF-8
|
|
8
|
-
|
|
9
|
-
rspec:
|
|
10
|
-
script:
|
|
11
|
-
- bin/cibuild
|
|
12
|
-
|
|
13
|
-
lint:
|
|
14
|
-
script:
|
|
15
|
-
- bin/lint
|
data/.travis.yml
DELETED
data/bin/cibuild
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
|
|
3
|
-
# script/cibuild: Setup environment for CI to run tests. This is primarily
|
|
4
|
-
# designed to run on the continuous integration server.
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
cd "$(dirname "$0")/.."
|
|
9
|
-
|
|
10
|
-
echo [$(date "+%H:%M:%S")] "==> Started at…"
|
|
11
|
-
|
|
12
|
-
# GC customizations
|
|
13
|
-
export RUBY_GC_MALLOC_LIMIT=79000000
|
|
14
|
-
export RUBY_GC_HEAP_INIT_SLOTS=800000
|
|
15
|
-
export RUBY_HEAP_FREE_MIN=100000
|
|
16
|
-
export RUBY_HEAP_SLOTS_INCREMENT=400000
|
|
17
|
-
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
|
|
18
|
-
|
|
19
|
-
ruby -v
|
|
20
|
-
gem install bundler --conservative -v '~> 2.0'
|
|
21
|
-
bin/test
|