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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ae49f7f6ef6a2bb537a159116337a058c5c1f0c4624989391a9ead28792881b
4
- data.tar.gz: 3205f4a5bb26b79e47e4cef4c37ee8615dfde8668276c865151a0efd308b1011
3
+ metadata.gz: b543cb75c4082fb0e2edcb41fa511e4ef2e2b26bfcc3435a3fc2c065836e7978
4
+ data.tar.gz: 16b7aee45c382fe7a560f3c7ef4dc80c2fd72c1e35f037ffe79f0fba549d1a76
5
5
  SHA512:
6
- metadata.gz: 4603a113307396cb3cde7c2cfb27abf349efe594b9445a446bb367d972a5fddf3d3f3c60d64082eb2ad4d8c7b17d1921a93853fe6a09f1570b9893adf52f885c
7
- data.tar.gz: 79827ac9ab51c432b08ac6b605f72ef8e834f4b8fa1f432d1ce3248b2e8e455a7d824ec5a83182a2b014daa6d98734670830c655567c117c53715fd9aa54e743
6
+ metadata.gz: e650af15675e5cc6998870cd3f7b899eb82a4b9204a1b3841ac060ee6c1832b1b51ef7dd933bb9e1e8c687195b369a887d1df148bedaab48704903e6c8941865
7
+ data.tar.gz: 3ea0c7af82c0d4f70796dfba478f6b7108113c3f00c3a1bdc27d39ae25f5a7dc2577fe8ffc38c23e03188087a3317555c4a10642ce768219d914fc8dc190a79b
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.7.0"
2
+ ".": "0.7.1"
3
3
  }
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
  [![Gem Version](https://badge.fury.io/rb/jwt-eddsa.svg)](https://badge.fury.io/rb/jwt-eddsa)
4
- [![Build Status](https://github.com/anakinj/jwt-eddsa/workflows/test/badge.svg?branch=main)](https://github.com/anakinj/jwt-eddsa/actions?query=branch%3Amain+workflow%3Atest)
4
+ [![Build status](https://github.com/anakinj/jwt-eddsa/actions/workflows/test.yml/badge.svg)](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
 
@@ -3,35 +3,37 @@
3
3
  module JWT
4
4
  module EdDSA
5
5
  # EdDSA algorithm implementation
6
- module Algo
7
- include JWT::JWA::SignatureAlgorithm
6
+ class Algo
7
+ include JWT::JWA::SigningAlgorithm
8
8
 
9
- register_algorithm("EdDSA")
10
- register_algorithm("ED25519")
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
- key.sign(msg)
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
- def verify(_alg, public_key, signing_input, signature)
22
- unless public_key.is_a?(Ed25519::VerifyKey)
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
- public_key.verify(signature, signing_input)
27
- rescue Ed25519::VerifyError
28
- false
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
- def header(*)
32
- { "alg" => "EdDSA" }
33
- end
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module JWT
4
4
  module EdDSA
5
- VERSION = "0.7.0"
5
+ VERSION = "0.7.1"
6
6
  end
7
7
  end
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.0
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-04 00:00:00.000000000 Z
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.0/CHANGELOG.md
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: []