jwt-eddsa 0.7.0 → 0.7.1
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/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +7 -0
- data/README.md +1 -1
- data/lib/jwt/eddsa/algo.rb +23 -21
- data/lib/jwt/eddsa/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b543cb75c4082fb0e2edcb41fa511e4ef2e2b26bfcc3435a3fc2c065836e7978
|
4
|
+
data.tar.gz: 16b7aee45c382fe7a560f3c7ef4dc80c2fd72c1e35f037ffe79f0fba549d1a76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e650af15675e5cc6998870cd3f7b899eb82a4b9204a1b3841ac060ee6c1832b1b51ef7dd933bb9e1e8c687195b369a887d1df148bedaab48704903e6c8941865
|
7
|
+
data.tar.gz: 3ea0c7af82c0d4f70796dfba478f6b7108113c3f00c3a1bdc27d39ae25f5a7dc2577fe8ffc38c23e03188087a3317555c4a10642ce768219d914fc8dc190a79b
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.7.1](https://github.com/anakinj/jwt-eddsa/compare/v0.7.0...v0.7.1) (2024-08-24)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* Compatibility with ruby-jwt ([#17](https://github.com/anakinj/jwt-eddsa/issues/17)) ([4c674a2](https://github.com/anakinj/jwt-eddsa/commit/4c674a2d628781d6dcc873198f6334a506983cc0))
|
9
|
+
|
3
10
|
## [0.7.0](https://github.com/anakinj/jwt-eddsa/compare/v0.6.0...v0.7.0) (2024-08-04)
|
4
11
|
|
5
12
|
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# jwt-eddsa
|
2
2
|
|
3
3
|
[](https://badge.fury.io/rb/jwt-eddsa)
|
4
|
-
[](https://github.com/anakinj/jwt-eddsa/actions/workflows/test.yml)
|
5
5
|
|
6
6
|
A library extending the ruby-jwt gem with EdDSA algorithms. Based on [RFC 8037](https://datatracker.ietf.org/doc/html/rfc8037).
|
7
7
|
|
data/lib/jwt/eddsa/algo.rb
CHANGED
@@ -3,35 +3,37 @@
|
|
3
3
|
module JWT
|
4
4
|
module EdDSA
|
5
5
|
# EdDSA algorithm implementation
|
6
|
-
|
7
|
-
include JWT::JWA::
|
6
|
+
class Algo
|
7
|
+
include JWT::JWA::SigningAlgorithm
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
class << self
|
13
|
-
def sign(_alg, msg, key)
|
14
|
-
unless key.is_a?(Ed25519::SigningKey)
|
15
|
-
raise_sign_error!("Key given is a #{key.class} but needs to be a Ed25519::SigningKey")
|
16
|
-
end
|
9
|
+
def initialize(alg)
|
10
|
+
@alg = alg
|
11
|
+
end
|
17
12
|
|
18
|
-
|
13
|
+
def sign(data:, signing_key:)
|
14
|
+
unless signing_key.is_a?(Ed25519::SigningKey)
|
15
|
+
raise_sign_error!("Key given is a #{signing_key.class} but needs to be a Ed25519::SigningKey")
|
19
16
|
end
|
20
17
|
|
21
|
-
|
22
|
-
|
23
|
-
raise_verify_error!("Key given is a #{public_key.class} but needs to be a Ed25519::VerifyKey")
|
24
|
-
end
|
18
|
+
signing_key.sign(data)
|
19
|
+
end
|
25
20
|
|
26
|
-
|
27
|
-
|
28
|
-
|
21
|
+
def verify(data:, signature:, verification_key:)
|
22
|
+
unless verification_key.is_a?(Ed25519::VerifyKey)
|
23
|
+
raise_verify_error!("Key given is a #{verification_key.class} but needs to be a Ed25519::VerifyKey")
|
29
24
|
end
|
30
25
|
|
31
|
-
|
32
|
-
|
33
|
-
|
26
|
+
verification_key.verify(signature, data)
|
27
|
+
rescue Ed25519::VerifyError
|
28
|
+
false
|
34
29
|
end
|
30
|
+
|
31
|
+
def header(*)
|
32
|
+
{ "alg" => "EdDSA" }
|
33
|
+
end
|
34
|
+
|
35
|
+
register_algorithm(new("EdDSA"))
|
36
|
+
register_algorithm(new("ED25519"))
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
data/lib/jwt/eddsa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jwt-eddsa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joakim Antman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base64
|
@@ -79,7 +79,7 @@ licenses:
|
|
79
79
|
metadata:
|
80
80
|
homepage_uri: https://github.com/anakinj/jwt-eddsa
|
81
81
|
source_code_uri: https://github.com/anakinj/jwt-eddsa
|
82
|
-
changelog_uri: https://github.com/anakinj/jwt-eddsa/blob/v0.7.
|
82
|
+
changelog_uri: https://github.com/anakinj/jwt-eddsa/blob/v0.7.1/CHANGELOG.md
|
83
83
|
rubygems_mfa_required: 'true'
|
84
84
|
post_install_message:
|
85
85
|
rdoc_options: []
|