Commit graph

2,645 commits

Author SHA1 Message Date
nexy7574
75f12ea228 Add msc4323 version flag 2025-08-31 17:49:29 +01:00
nexy7574
df72594ef7 Implement MSC4323 requests and structs 2025-08-31 17:35:38 +01:00
Tulir Asokan
cd927c2796 event: add types for MSC4332
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-08-30 19:54:58 +03:00
fmseals
1d6bea5fe3
client: fix v3/delete_devices method (#393)
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-29 19:34:06 +03:00
Tulir Asokan
050fbbd466 bridgev2/status: change RemoteID to a UserLoginID 2025-08-29 18:32:04 +03:00
Tulir Asokan
f9e3e8a30f bridgev2/provisionutil: allow passing mxids to ResolveIdentifier
Closes #398
2025-08-29 18:32:04 +03:00
Tulir Asokan
8f464b5b76 bridgev2: move shared SNC code to provisionutil 2025-08-29 16:45:54 +03:00
Ping Chen
c18d2e2565
bridgev2/matrixinterface: add GetEvent interface for linkedin reply (#406)
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
Co-authored-by: Tulir Asokan <tulir@maunium.net>
2025-08-29 17:20:11 +09:00
Tulir Asokan
19f3b2179c pre-commit: ban log.Str(x.String()) 2025-08-29 11:07:16 +03:00
Tulir Asokan
3048d2edab bridgev2/provisioning: add minimum length for shared secret
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-08-28 02:20:41 +03:00
Tulir Asokan
359afbea2b bridgev2/matrix: remove provisioning API prefix option
Reverse proxy configuration should be used instead when adding prefixes
to the path. Changing the path entirely is not recommended even with
reverse proxies.

Fixes #403
2025-08-28 02:19:27 +03:00
Tulir Asokan
febca20dd7 bridgev2/status: use _file pattern for avatar instead of splitting url and keys
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-27 17:12:00 +03:00
Tulir Asokan
9f693702b0 federation/pdu: add extra field to internal metadata 2025-08-27 12:25:08 +03:00
Tulir Asokan
f131ae5aa4 federation/pdu: add cached event ID to internal metadata
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-27 12:24:15 +03:00
Tulir Asokan
ba16c30a8c
federation/eventauth: add v3-v12 event auth rules (#401)
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-27 01:45:33 +03:00
Tulir Asokan
0345a5356d bridgev2/database: don't set disappearing timer content to nil
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-26 17:07:16 +03:00
Tulir Asokan
7b3a60742e event: allow omitting timers from disappearing timer capability 2025-08-26 15:57:10 +03:00
Tulir Asokan
e9d4eeb332 bridgev2/status: add avatar_keys to remote profile 2025-08-26 15:56:27 +03:00
Tulir Asokan
63b654187d event: marshal zero disappearing timers as empty object
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-25 19:03:07 +03:00
Tulir Asokan
c3a422347c bridgev2/portal: validate capabilities when updating disappearing timer 2025-08-25 18:37:15 +03:00
Tulir Asokan
bca8b0528c sqlstatestore: fix GetPowerLevels returning non-nil even if power levels weren't found 2025-08-25 18:27:49 +03:00
Tulir Asokan
4f7c7dafdc bridgev2/matrix: fix encryption error notice not being redacted after retry success 2025-08-25 17:42:20 +03:00
Tulir Asokan
a6bbe978bd bridgev2/networkinterface: add interface for handling disappearing timer changes from Matrix 2025-08-25 17:35:57 +03:00
Tulir Asokan
f860b0e238 bridgev2/portal: fix send notice option when updating disappearing message timer 2025-08-25 17:23:25 +03:00
Tulir Asokan
8e703410f4 bridgev2/portal: always set timestamp for disappearing message timer update 2025-08-25 17:21:55 +03:00
Tulir Asokan
5ac8a888a3 bridgev2/portal: make UpdateDisappearingSetting more versatile 2025-08-25 17:16:18 +03:00
Tulir Asokan
0fab92dbc1 event: add third party invite state event content 2025-08-25 17:16:18 +03:00
Tulir Asokan
c04d0b6681 bridgev2: merge mentions and url previews when merging caption 2025-08-25 17:16:18 +03:00
Brad Murray
fa7c1ae2bc
crypto/sqlstore: add index to make finding megolm sessions to backup faster (#402)
```
2025-08-24T22:23:19Z debug    [MatrixBridgeV2]           {"level":"warn","component":"matrix","component":"client_loop","subcomponent":"sync_key_backup_loop","rows":0,"duration_seconds":1.046191042,"method":"EndRows","query":"SELECT room_id, sender_key, signing_key, session, forwarding_chains, ratchet_safety, received_at, max_age, max_messages, is_scheduled, key_backup_version FROM crypto_megolm_inbound_session WHERE account_id=?1 AND session IS NOT NULL AND key_backup_version != ?2","time":"2025-08-24T22:23:19.22077Z","message":"Query took long"} 
```

before:
```
sqlite> EXPLAIN SELECT room_id, sender_key, signing_key, session, forwarding_chains, ratchet_safety, received_at, max_age, max_messages, is_scheduled, key_backup_version FROM crypto_megolm_inbound_session WHERE account_id='@brad:beeper.com/CHNWOJWEUC' AND sessi
addr  opcode         p1    p2    p3    p4             p5  comment
----  -------------  ----  ----  ----  -------------  --  -------------
0     Init           0     25    0                    0   Start at 25
1     OpenRead       0     48    0     15             0   root=48 iDb=0; crypto_megolm_inbound_session
2     OpenRead       1     49    0     k(3,,,)        2   root=49 iDb=0; sqlite_autoindex_crypto_megolm_inbound_session_1
3     String8        0     1     0     @brad:beeper.com/CHNWOJWEUC 0   r[1]='@brad:beeper.com/CHNWOJWEUC'
4     SeekGE         1     24    1     1              0   key=r[1]
5       IdxGT          1     24    1     1              0   key=r[1]
6       DeferredSeek   1     0     0                    0   Move 0 to 1.rowid if needed
7       Column         0     5     2                    128 r[2]= cursor 0 column 5
8       IsNull         2     23    0                    0   if r[2]==NULL goto 23
9       Column         0     14    2                    0   r[2]=crypto_megolm_inbound_session.key_backup_version
10      Eq             3     23    2     BINARY-8       82  if r[2]==r[3] goto 23
11      Column         0     4     4                    0   r[4]= cursor 0 column 4
12      Column         0     2     5                    0   r[5]= cursor 0 column 2
13      Column         0     3     6                    0   r[6]= cursor 0 column 3
14      Column         0     5     7                    0   r[7]= cursor 0 column 5
15      Column         0     6     8                    0   r[8]= cursor 0 column 6
16      Column         0     9     9                    0   r[9]= cursor 0 column 9
17      Column         0     10    10                   0   r[10]= cursor 0 column 10
18      Column         0     11    11                   0   r[11]= cursor 0 column 11
19      Column         0     12    12                   0   r[12]= cursor 0 column 12
20      Column         0     13    13    0              0   r[13]=crypto_megolm_inbound_session.is_scheduled
21      Column         0     14    14                   0   r[14]=crypto_megolm_inbound_session.key_backup_version
22      ResultRow      4     11    0                    0   output=r[4..14]
23    Next           1     5     0                    0
24    Halt           0     0     0                    0
25    Transaction    0     0     55    0              1   usesStmtJournal=0
26    Integer        1     3     0                    0   r[3]=1
27    Goto           0     1     0                    0
sqlite> SELECT COUNT(*) FROM crypto_megolm_inbound_session ;
+----------+
| COUNT(*) |
+----------+
| 168792   |
+----------+
sqlite> SELECT COUNT(*) FROM crypto_megolm_inbound_session WHERE session IS NULL;
+----------+
| COUNT(*) |
+----------+
| 39       |
+----------+
sqlite> SELECT COUNT(*) FROM crypto_megolm_inbound_session WHERE key_backup_version != 1;
+----------+
| COUNT(*) |
+----------+
| 39       |
+----------+
```

after:
```
sqlite> CREATE INDEX idx_megolm_filtered
   ...> ON crypto_megolm_inbound_session(account_id, key_backup_version, session);
sqlite> EXPLAIN SELECT room_id, sender_key, signing_key, session, forwarding_chains, ratchet_safety, received_at, max_age, max_messages, is_scheduled, key_backup_version FROM crypto_megolm_inbound_session WHERE account_id='@brad:beeper.com/CHNWOJWEUC' AND session IS NOT NULL AND key_backup_version != 1;
addr  opcode         p1    p2    p3    p4             p5  comment
----  -------------  ----  ----  ----  -------------  --  -------------
0     Init           0     25    0                    0   Start at 25
1     OpenRead       0     48    0     15             0   root=48 iDb=0; crypto_megolm_inbound_session
2     OpenRead       1     91264 0     k(4,,,,)       2   root=91264 iDb=0; idx_megolm_filtered
3     String8        0     1     0     @brad:beeper.com/CHNWOJWEUC 0   r[1]='@brad:beeper.com/CHNWOJWEUC'
4     SeekGE         1     24    1     1              0   key=r[1]
5       IdxGT          1     24    1     1              0   key=r[1]
6       DeferredSeek   1     0     0                    0   Move 0 to 1.rowid if needed
7       Column         1     2     2                    128 r[2]= cursor 1 column 2
8       IsNull         2     23    0                    0   if r[2]==NULL goto 23
9       Column         1     1     2                    0   r[2]=crypto_megolm_inbound_session.key_backup_version
10      Eq             3     23    2     BINARY-8       82  if r[2]==r[3] goto 23
11      Column         0     4     4                    0   r[4]= cursor 0 column 4
12      Column         0     2     5                    0   r[5]= cursor 0 column 2
13      Column         0     3     6                    0   r[6]= cursor 0 column 3
14      Column         1     2     7                    0   r[7]= cursor 1 column 2
15      Column         0     6     8                    0   r[8]= cursor 0 column 6
16      Column         0     9     9                    0   r[9]= cursor 0 column 9
17      Column         0     10    10                   0   r[10]= cursor 0 column 10
18      Column         0     11    11                   0   r[11]= cursor 0 column 11
19      Column         0     12    12                   0   r[12]= cursor 0 column 12
20      Column         0     13    13    0              0   r[13]=crypto_megolm_inbound_session.is_scheduled
21      Column         1     1     14                   0   r[14]=crypto_megolm_inbound_session.key_backup_version
22      ResultRow      4     11    0                    0   output=r[4..14]
23    Next           1     5     0                    0
24    Halt           0     0     0                    0
25    Transaction    0     0     56    0              1   usesStmtJournal=0
26    Integer        1     3     0                    0   r[3]=1
27    Goto           0     1     0                    0
sqlite>
```
2025-08-25 08:03:13 -04:00
Tulir Asokan
7e07700a69 format: add MarkdownMentionRoomID helper
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-08-24 00:47:55 +03:00
Tulir Asokan
d2cad8c57e format: add MarkdownMentionWithName helper 2025-08-24 00:44:50 +03:00
Tulir Asokan
71bbbdb3c3 federation/pdu: use jsontext.Value instead of any for deprecated fields 2025-08-23 23:22:43 +03:00
Tulir Asokan
363aa94389 federation/pdu: add server name parameter to GetKeyFunc
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-23 03:13:10 +03:00
Tulir Asokan
fd20a61d87 event: add json struct tag to third party signed object 2025-08-23 03:08:44 +03:00
Tulir Asokan
35b805440f federation/pdu: add auth event selection 2025-08-22 19:37:53 +03:00
Tulir Asokan
206071ec03 federation/pdu: add redacted member event 2025-08-22 18:42:28 +03:00
Kishan Bagaria
1d484e01d0
event: implement disappearing timer types (#399)
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
Co-authored-by: Tulir Asokan <tulir@maunium.net>
2025-08-22 02:16:56 -07:00
Tulir Asokan
a547c0636c event,pushrules: replace assert.Nil with assert.NoError
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-08-21 13:19:11 +03:00
Tulir Asokan
29780ffb18 federation/pdu: refactor redaction to allow reuse of RedactContent 2025-08-21 13:18:11 +03:00
Tulir Asokan
baf54f57b6 crypto/encryptmegolm: add fallback for copying m.relates_to
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-08-19 19:44:53 +03:00
Tulir Asokan
05b711d181 federation/pdu: add more tests for signature checks
Some checks failed
Go / Lint (latest) (push) Has been cancelled
Go / Build (old, libolm) (push) Has been cancelled
Go / Build (latest, libolm) (push) Has been cancelled
Go / Build (old, goolm) (push) Has been cancelled
Go / Build (latest, goolm) (push) Has been cancelled
2025-08-18 00:53:51 +03:00
Tulir Asokan
d1004d42b0 client: add method to download media thumbnail 2025-08-18 00:24:57 +03:00
Tulir Asokan
ca4ca62249 federation/pdu: add docs for GetKeyFunc 2025-08-17 20:24:18 +03:00
Tulir Asokan
ec663b53d4 federation/pdu: reorganize code and add methods to v1 struct 2025-08-17 20:12:38 +03:00
Tulir Asokan
cc80be1500 federation/pdu: add method to convert to client event
Some checks are pending
Go / Lint (latest) (push) Waiting to run
Go / Build (old, libolm) (push) Waiting to run
Go / Build (latest, libolm) (push) Waiting to run
Go / Build (old, goolm) (push) Waiting to run
Go / Build (latest, goolm) (push) Waiting to run
2025-08-17 13:45:34 +03:00
Tulir Asokan
6eced49860 client,event: remove deprecated MSC2716 structs 2025-08-17 13:32:07 +03:00
Tulir Asokan
9b075f8bb9 ci: disable tests on goolm again 2025-08-17 13:15:53 +03:00
Tulir Asokan
0f177058c1 ci: move tags to correct place 2025-08-17 13:13:24 +03:00
Tulir Asokan
0dc957fa30 ci: fix more things 2025-08-17 13:11:26 +03:00
Tulir Asokan
31178e9f42 federation/pdu: fail on any signature check error 2025-08-17 13:02:47 +03:00