async-matrix 2.0.1-x86_64-linux → 2.1.0-x86_64-linux

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: bcb270a5870317bcf2f520822c51be7ec986895b42fe393399a060cc2973ed61
4
- data.tar.gz: 89272c6298430e6e1652e22a0d9db6d932c19f6796522053209ea5d57220a811
3
+ metadata.gz: ef835466d5f6581a316c297db4e2996d441168c05555a9e01eeb4115ad2c4fad
4
+ data.tar.gz: 843e809c2cce911beaed17022fdd7cda2777e6c18bc60106304616bb96abbc1b
5
5
  SHA512:
6
- metadata.gz: 6873d7693f6acda23bcae84eb23ece21e01e036e3250655373b3f2cd5c53874c3d1b0429789db311128194902fcb13b0f22591db275b3ddc2a9505c0ad6ddaa2
7
- data.tar.gz: 425bfcef07fed7045781295134bb1606502bd76642037d6ac8f0a53546122aad3d859257964a979c08795d56afab99bea4d81ded8cfa9c528a053868d37e35ba
6
+ metadata.gz: c3df9aaadeb5a2942ffef4aad59dbd72176dee3268501dd280797b70c3a9cbd29641cffffc35ee772ce981263d4cabbdd0ed1910cec43a5819e7e3272b18c199
7
+ data.tar.gz: d92358ac27b0b2ab8db850f0c6fa755d1afe4a8b537b097b68c6a81882bc1a353f8fc88793dc36c6790ed7f82a7669b590f3a46a672eca7c46c686c5077fef75
@@ -56,6 +56,43 @@ __END__
56
56
  inbound.session_id.should == group.session_id
57
57
  end
58
58
 
59
+ it "imports an exported session key" do
60
+ # The path room keys take out of server-side key backup and out of
61
+ # m.forwarded_room_key. Without .import these are unusable, and a client
62
+ # can never read history it did not get a live m.room_key for.
63
+ group = Async::Matrix::E2EE::GroupSession.new
64
+ inbound = Async::Matrix::E2EE::InboundGroupSession.new(group.session_key)
65
+ message = group.encrypt("restored from backup")
66
+
67
+ exported = inbound.export_at_first_known_index
68
+ restored = Async::Matrix::E2EE::InboundGroupSession.import(exported)
69
+
70
+ restored.session_id.should == group.session_id
71
+ restored.decrypt(message).first.should == "restored from backup"
72
+ end
73
+
74
+ it "rejects an exported key passed to .new, which requires a signature" do
75
+ # .new takes a version-2 SessionKey and verifies its signature; an exported
76
+ # key is version 1 and unsigned, so it must go through .import instead.
77
+ group = Async::Matrix::E2EE::GroupSession.new
78
+ inbound = Async::Matrix::E2EE::InboundGroupSession.new(group.session_key)
79
+ exported = inbound.export_at_first_known_index
80
+
81
+ lambda {
82
+ Async::Matrix::E2EE::InboundGroupSession.new(exported)
83
+ }.should.raise(RuntimeError)
84
+ end
85
+
86
+ it "exports at a given message index" do
87
+ group = Async::Matrix::E2EE::GroupSession.new
88
+ inbound = Async::Matrix::E2EE::InboundGroupSession.new(group.session_key)
89
+ 3.times { |i| group.encrypt("msg #{i}") }
90
+
91
+ Async::Matrix::E2EE::InboundGroupSession
92
+ .import(inbound.export_at(0))
93
+ .first_known_index.should == 0
94
+ end
95
+
59
96
  it "round-trips an olm 1:1 message" do
60
97
  alice = Async::Matrix::E2EE::Account.new
61
98
  bob = Async::Matrix::E2EE::Account.new
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module Matrix
8
- VERSION = "2.0.1"
8
+ VERSION = "2.1.0"
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-matrix
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Nathan Kidd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-09 00:00:00.000000000 Z
11
+ date: 2026-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async
@@ -178,6 +178,20 @@ dependencies:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: '1.2'
181
+ - !ruby/object:Gem::Dependency
182
+ name: lefthook
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '2.1'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '2.1'
181
195
  description: Async-native Matrix protocol primitives built on the Socketry async ecosystem.
182
196
  Provides well-known discovery, event notification, and application service models.
183
197
  email: