chore: bump dependencies

This commit is contained in:
Johanna Larsson
2026-10-07 07:41:22 +00:00
committed by Tangled
parent 2b1f9d4e37
commit c0a74b276e
8 changed files with 1423 additions and 1383 deletions
@@ -1,22 +0,0 @@
{
"db_name": "PostgreSQL",
"query": "SELECT telegram_chat_id FROM users WHERE id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "telegram_chat_id",
"type_info": "Int8"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
true
]
},
"hash": "a71a76724a3a7406e30a998c03d52554efaf649bb10b35b6e5d64ac59a479023"
}
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO signal_kv (key, value) VALUES ($1, $2)\n ON CONFLICT (key) DO UPDATE SET value = $2",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Bytea"
]
},
"nullable": []
},
"hash": "d71a56745a1fa153adea88f4227fd7c3cb139170911a21d86cee8f530bbbd237"
}
Generated
+1307 -1356
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -53,7 +53,7 @@ tranquil-api = { path = "crates/tranquil-api" }
tranquil-signal = { path = "crates/tranquil-signal", features = ["fjall-store"] }
tranquil-store = { path = "crates/tranquil-store" }
presage = { git = "https://github.com/whisperfish/presage", rev = "fe3ed54c4844ae51c3a9fa49cf80a7816a31a425", default-features = false }
presage = { git = "https://github.com/whisperfish/presage", rev = "33dd1491130793390e356e15a5711f1e6ca14fdb", default-features = false }
unicode-segmentation = "1"
@@ -147,8 +147,8 @@ x509-parser = "0.18"
ciborium = "0.2"
ctor = "0.6"
testcontainers = "0.26"
testcontainers-modules = { version = "0.14", features = ["postgres"] }
testcontainers = "0.27"
testcontainers-modules = { version = "0.15", features = ["postgres"] }
webauthn-authenticator-rs = { version = "0.5", features = ["softpasskey"] }
wiremock = "0.6"
+38 -1
View File
@@ -7,6 +7,7 @@ use presage::{
AvatarBytes,
libsignal_service::{
Profile,
libsignal_account_keys::AccountEntropyPool,
pre_keys::{KyberPreKeyStoreExt, PreKeysStore},
prelude::{Content, MasterKey, ProfileKey, SessionStoreExt, Uuid},
protocol::{
@@ -36,6 +37,8 @@ pub enum FjallStoreError {
Json(#[from] serde_json::Error),
#[error("protocol: {0}")]
Protocol(#[from] SignalProtocolError),
#[error("invalid format")]
InvalidFormat,
#[error("not found: {0}")]
NotFound(String),
}
@@ -360,6 +363,32 @@ impl StateStore for FjallSignalStore {
Ok(())
}
async fn fetch_account_entropy_pool(
&self,
) -> Result<Option<AccountEntropyPool>, FjallStoreError> {
self.ks
.get(kv_key(b"account_entropy_pool"))?
.map(|value| {
std::str::from_utf8(value.as_ref())
.map_err(|_| FjallStoreError::InvalidFormat)?
.parse()
.map_err(|_| FjallStoreError::InvalidFormat)
})
.transpose()
}
async fn store_account_entropy_pool(
&self,
aep: Option<&AccountEntropyPool>,
) -> Result<(), FjallStoreError> {
let key = kv_key(b"account_entropy_pool");
match aep {
Some(aep) => self.ks.insert(key, aep.to_string().into_bytes())?,
None => self.ks.remove(key)?,
}
Ok(())
}
async fn fetch_master_key(&self) -> Result<Option<MasterKey>, FjallStoreError> {
self.ks
.get(kv_key(b"master_key"))?
@@ -678,7 +707,7 @@ impl KyberPreKeyStore for FjallProtocolStore {
{
return Err(SignalProtocolError::InvalidMessage(
CiphertextMessageType::PreKey,
"reused base key",
"reused base key".to_string(),
));
}
self.store
@@ -973,6 +1002,14 @@ impl ContentsStore for FjallSignalStore {
Ok(std::iter::empty())
}
async fn thread_for_sender_and_timestamp(
&self,
_sender: &ServiceId,
_timestamp: u64,
) -> Result<Option<Thread>, FjallStoreError> {
Ok(None)
}
async fn clear_contacts(&mut self) -> Result<(), FjallStoreError> {
Ok(())
}
+52 -1
View File
@@ -5,6 +5,7 @@ use presage::{
AvatarBytes,
libsignal_service::{
Profile,
libsignal_account_keys::AccountEntropyPool,
pre_keys::{KyberPreKeyStoreExt, PreKeysStore},
prelude::{Content, MasterKey, ProfileKey, SessionStoreExt, Uuid},
protocol::{
@@ -290,6 +291,48 @@ impl StateStore for PgSignalStore {
Ok(())
}
async fn fetch_account_entropy_pool(&self) -> Result<Option<AccountEntropyPool>, PgStoreError> {
sqlx::query_scalar!(
"SELECT value FROM signal_kv WHERE key = $1",
"account_entropy_pool",
)
.fetch_optional(&self.db)
.await?
.map(|value| {
std::str::from_utf8(&value)
.map_err(|_| PgStoreError::InvalidFormat)?
.parse()
.map_err(|_| PgStoreError::InvalidFormat)
})
.transpose()
}
async fn store_account_entropy_pool(
&self,
aep: Option<&AccountEntropyPool>,
) -> Result<(), PgStoreError> {
match aep {
Some(aep) => {
let value = aep.to_string().into_bytes();
sqlx::query!(
"INSERT INTO signal_kv (key, value) VALUES ($1, $2)
ON CONFLICT (key) DO UPDATE SET value = $2",
"account_entropy_pool",
&value,
)
.execute(&self.db)
.await?;
}
None => {
sqlx::query("DELETE FROM signal_kv WHERE key = $1")
.bind("account_entropy_pool")
.execute(&self.db)
.await?;
}
}
Ok(())
}
async fn fetch_master_key(&self) -> Result<Option<MasterKey>, PgStoreError> {
sqlx::query_scalar!("SELECT value FROM signal_kv WHERE key = 'master_key' LIMIT 1")
.fetch_optional(&self.db)
@@ -705,7 +748,7 @@ impl KyberPreKeyStore for PgProtocolStore {
Err(sqlx::Error::Database(ref e)) if e.is_unique_violation() => {
return Err(SignalProtocolError::InvalidMessage(
CiphertextMessageType::PreKey,
"reused base key",
"reused base key".to_string(),
));
}
other => {
@@ -1035,6 +1078,14 @@ impl ContentsStore for PgSignalStore {
Ok(std::iter::empty())
}
async fn thread_for_sender_and_timestamp(
&self,
_sender: &ServiceId,
_timestamp: u64,
) -> Result<Option<Thread>, PgStoreError> {
Ok(None)
}
async fn clear_contacts(&mut self) -> Result<(), PgStoreError> {
Ok(())
}
+5
View File
@@ -25,6 +25,11 @@ async fn test_store() -> Option<PgSignalStore> {
.await
.ok()?;
sqlx::migrate!("../../migrations")
.run(&pool)
.await
.expect("Failed to run Signal test migrations");
sqlx::query("DELETE FROM signal_kv")
.execute(&pool)
.await
+3
View File
@@ -148,6 +148,9 @@ test-full *args:
test-pg *args:
SQLX_OFFLINE=true ./scripts/run-tests.sh --features tranquil-api/low-bcrypt-cost {{args}}
test-signal:
SQLX_OFFLINE=true ./scripts/run-tests.sh --features tranquil-api/low-bcrypt-cost -E 'package(tranquil-signal)'
services-up:
tranquil-dev-services up