Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

wall: add rust e2e test

Neeraj Guptaa40572ecee66
diff --git a/rust/e2e/Cargo.lock b/rust/e2e/Cargo.lock
index 020e4cbfce..da8141004f 100644
--- a/rust/e2e/Cargo.lock
+++ b/rust/e2e/Cargo.lock
@@ -622,11 +622,11 @@ version = "0.0.1"
dependencies = [
"base64",
"ente-core",
+ "futures-timer",
"log",
"serde",
"serde_json",
"thiserror 2.0.18",
- "tokio",
"urlencoding",
"uuid",
"zeroize",
@@ -680,6 +680,7 @@ dependencies = [
"ente-contacts",
"ente-core",
"ente-rs",
+ "ente-wall",
"hmac",
"reqwest",
"serde",
@@ -717,6 +718,19 @@ dependencies = [
"zip",
]
+[[package]]
+name = "ente-wall"
+version = "0.0.1"
+dependencies = [
+ "base64",
+ "ente-core",
+ "serde",
+ "sha2",
+ "thiserror 2.0.18",
+ "url",
+ "urlencoding",
+]
+
[[package]]
name = "env_filter"
version = "1.0.1"
@@ -903,6 +917,12 @@ version = "0.3.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393"
+[[package]]
+name = "futures-timer"
+version = "3.0.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24"
+
[[package]]
name = "futures-util"
version = "0.3.32"
diff --git a/rust/e2e/Cargo.toml b/rust/e2e/Cargo.toml
index 5065836106..fd71de228c 100644
--- a/rust/e2e/Cargo.toml
+++ b/rust/e2e/Cargo.toml
@@ -9,6 +9,7 @@ ente-rs = { path = "../cli" }
ente-accounts = { path = "../accounts" }
ente-contacts = { path = "../contacts" }
ente-core = { path = "../core", features = ["srp"] }
+ente-wall = { path = "../wall" }
tokio = { version = "1", features = ["macros", "rt-multi-thread", "sync", "time"] }
reqwest = { version = "0.12", features = ["json", "rustls-tls-native-roots"] }
zeroize = { version = "1.8", features = ["derive"] }
diff --git a/rust/e2e/tests/full_e2e.rs b/rust/e2e/tests/full_e2e.rs
index 62dca0a3f6..76872499f9 100644
--- a/rust/e2e/tests/full_e2e.rs
+++ b/rust/e2e/tests/full_e2e.rs
@@ -1,8 +1,8 @@
mod support;
+use ente_accounts::Error as CliError;
use ente_contacts::legacy_models::{LegacyContactState, LegacyRecoveryStatus};
use ente_contacts::models::ContactData;
-use ente_accounts::Error as CliError;
use ente_core::http::Error as CoreHttpError;
use support::{auth, contacts, legacy};
diff --git a/rust/e2e/tests/support/auth.rs b/rust/e2e/tests/support/auth.rs
index 1bd7460772..67ab2961df 100644
--- a/rust/e2e/tests/support/auth.rs
+++ b/rust/e2e/tests/support/auth.rs
@@ -1,3 +1,5 @@
+#![allow(dead_code)]
+
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use base64::{Engine, engine::general_purpose::URL_SAFE};
@@ -21,6 +23,8 @@ pub struct TestAccount {
pub user_id: i64,
pub auth_token: String,
pub master_key: Vec<u8>,
+ pub secret_key: Vec<u8>,
+ pub public_key: Vec<u8>,
pub key_attributes: KeyAttributes,
}
@@ -183,10 +187,7 @@ pub async fn fetch_two_factor_status(endpoint: &str, account: &TestAccount) -> C
fetch_two_factor_status_with_token(endpoint, &account.auth_token).await
}
-async fn fetch_two_factor_status_with_token(
- endpoint: &str,
- auth_token: &str,
-) -> CliResult<bool> {
+async fn fetch_two_factor_status_with_token(endpoint: &str, auth_token: &str) -> CliResult<bool> {
let client = accounts_client(endpoint)?;
client.set_auth_token(Some(auth_token.to_string()));
client.get_two_factor_status().await
@@ -212,6 +213,8 @@ pub fn test_account_from_authenticated(
user_id: authenticated.user_id,
auth_token: auth_token_from_authenticated(&authenticated),
master_key: authenticated.secrets.master_key.clone(),
+ secret_key: authenticated.secrets.secret_key.clone(),
+ public_key: authenticated.secrets.public_key.clone(),
key_attributes: authenticated.key_attributes,
}
}
diff --git a/rust/e2e/tests/support/contacts.rs b/rust/e2e/tests/support/contacts.rs
index 0f42453a4e..eadddcc960 100644
--- a/rust/e2e/tests/support/contacts.rs
+++ b/rust/e2e/tests/support/contacts.rs
@@ -1,8 +1,10 @@
+#![allow(dead_code)]
+
+use ente_accounts::KeyAttributes as ApiKeyAttributes;
use ente_contacts::{
client::{ContactsCtx, OpenContactsCtxInput},
legacy_models::{LegacyContactRecord, LegacyInfo, LegacyRecoverySession},
};
-use ente_accounts::KeyAttributes as ApiKeyAttributes;
use ente_core::auth::KeyAttributes as CoreKeyAttributes;
use ente_rs::models::account::App;
diff --git a/rust/e2e/tests/support/legacy.rs b/rust/e2e/tests/support/legacy.rs
index 3735fd117d..5b54883ade 100644
--- a/rust/e2e/tests/support/legacy.rs
+++ b/rust/e2e/tests/support/legacy.rs
@@ -1,3 +1,5 @@
+#![allow(dead_code)]
+
use ente_contacts::client::ContactsCtx;
use crate::support::{
diff --git a/rust/e2e/tests/support/mod.rs b/rust/e2e/tests/support/mod.rs
index e4824f0d48..a1365c2c4c 100644
--- a/rust/e2e/tests/support/mod.rs
+++ b/rust/e2e/tests/support/mod.rs
@@ -1,6 +1,7 @@
pub mod auth;
pub mod contacts;
pub mod legacy;
+pub mod wall;
use uuid::Uuid;
diff --git a/rust/e2e/tests/support/wall.rs b/rust/e2e/tests/support/wall.rs
new file mode 100644
index 0000000000..6f223cde48
--- /dev/null
+++ b/rust/e2e/tests/support/wall.rs
@@ -0,0 +1,45 @@
+use ente_core::http::Error as HttpError;
+use ente_rs::models::account::App;
+use ente_wall::{
+ AccountWallCtx, OpenAccountWallCtxInput, PostObjectPayload, PrivateKeySource, WallError,
+};
+
+use crate::support::auth::TestAccount;
+
+pub fn open_ctx(endpoint: &str, account: &TestAccount) -> AccountWallCtx {
+ AccountWallCtx::open(OpenAccountWallCtxInput {
+ base_url: endpoint.to_string(),
+ auth_token: account.auth_token.clone(),
+ master_key: account.master_key.clone(),
+ public_key: account.public_key.clone(),
+ private_key_source: PrivateKeySource::Plain(account.secret_key.clone()),
+ user_id: Some(account.user_id),
+ user_agent: Some("ente-e2e".to_string()),
+ client_package: Some(App::Photos.client_package().to_string()),
+ client_version: Some("ente-e2e".to_string()),
+ })
+ .expect("wall context should open")
+}
+
+pub fn profile_payload(display_name: &str, bio: &str) -> Vec<u8> {
+ format!(r#"{{"displayName":"{display_name}","bio":"{bio}"}}"#).into_bytes()
+}
+
+pub fn fake_post_object(name: &str) -> PostObjectPayload {
+ PostObjectPayload {
+ object_key: format!("wall-e2e/{name}"),
+ content_type: Some("image/jpeg".to_string()),
+ size: Some(1),
+ position: Some(0),
+ blur_hash_cipher: None,
+ variant: Some("full".to_string()),
+ }
+}
+
+pub fn assert_http_status<T>(result: Result<T, WallError>, expected_status: u16) {
+ match result {
+ Err(WallError::Http(HttpError::Http { status, .. })) if status == expected_status => {}
+ Err(error) => panic!("expected HTTP {expected_status}, got {error:?}"),
+ Ok(_) => panic!("expected HTTP {expected_status}, got success"),
+ }
+}
diff --git a/rust/e2e/tests/wall_e2e.rs b/rust/e2e/tests/wall_e2e.rs
new file mode 100644
index 0000000000..099eb07ec8
--- /dev/null
+++ b/rust/e2e/tests/wall_e2e.rs
@@ -0,0 +1,250 @@
+mod support;
+
+use ente_wall::{OpenWallLinkCtxInput, WallLinkCtx};
+
+use support::{auth, wall};
+
+#[tokio::test]
+#[ignore = "requires local Museum at ENTE_E2E_ENDPOINT or http://localhost:8080"]
+async fn wall_bootstrap_posts_follow_share_and_link_suite() {
+ let endpoint = support::endpoint();
+ if !support::assert_server_or_skip(&endpoint, "wall rust e2e suite").await {
+ return;
+ }
+
+ let owner = auth::create_account(
+ &endpoint,
+ support::unique_test_email("wall-owner"),
+ support::unique_password("WallOwner"),
+ )
+ .await;
+ let follower = auth::create_account(
+ &endpoint,
+ support::unique_test_email("wall-follower"),
+ support::unique_password("WallFollower"),
+ )
+ .await;
+ let outsider = auth::create_account(
+ &endpoint,
+ support::unique_test_email("wall-outsider"),
+ support::unique_password("WallOutsider"),
+ )
+ .await;
+
+ let owner_ctx = wall::open_ctx(&endpoint, &owner);
+ let follower_ctx = wall::open_ctx(&endpoint, &follower);
+ let outsider_ctx = wall::open_ctx(&endpoint, &outsider);
+
+ let owner_slug = format!("owner-{}", owner.user_id);
+ let follower_slug = format!("follower-{}", follower.user_id);
+ let outsider_slug = format!("outsider-{}", outsider.user_id);
+
+ let owner_profile = wall::profile_payload("Owner", "Owner bio");
+ let owner_wall = owner_ctx
+ .create_wall(&owner_slug, &owner_profile)
+ .await
+ .expect("owner wall creation failed");
+ follower_ctx
+ .create_wall(
+ &follower_slug,
+ &wall::profile_payload("Follower", "Follower bio"),
+ )
+ .await
+ .expect("follower wall creation failed");
+ outsider_ctx
+ .create_wall(
+ &outsider_slug,
+ &wall::profile_payload("Outsider", "Outsider bio"),
+ )
+ .await
+ .expect("outsider wall creation failed");
+
+ let owned = owner_ctx
+ .list_owned_walls()
+ .await
+ .expect("owned walls should load");
+ assert_eq!(owned.len(), 1);
+ assert_eq!(owned[0].wall_id, owner_wall.wall_id);
+
+ let decrypted_profile = owner_ctx
+ .get_wall_profile_decrypted(&owner_wall.wall_id, None)
+ .await
+ .expect("owner should decrypt profile");
+ assert_eq!(decrypted_profile.profile, owner_profile);
+ assert_eq!(decrypted_profile.wall_slug, owner_slug);
+
+ wall::assert_http_status(
+ outsider_ctx
+ .get_wall_profile_raw(&owner_wall.wall_id, None)
+ .await,
+ 403,
+ );
+
+ let updated_slug = format!("{owner_slug}-updated");
+ owner_ctx
+ .update_wall_slug(&owner_wall.wall_id, &updated_slug)
+ .await
+ .expect("slug update should succeed");
+ let updated_profile = wall::profile_payload("Owner Updated", "Bio v2");
+ owner_ctx
+ .update_wall_profile(&owner_wall.wall_id, &updated_profile, None, false)
+ .await
+ .expect("profile update should succeed");
+ let looked_up = outsider_ctx
+ .lookup_wall_by_slug(&updated_slug)
+ .await
+ .expect("public slug lookup should succeed");
+ assert_eq!(looked_up.wall_id, owner_wall.wall_id);
+ assert_eq!(looked_up.wall_slug, updated_slug);
+
+ let object = wall::fake_post_object("post-1");
+ let (post_id, post_key) = owner_ctx
+ .create_post(
+ &owner_wall.wall_id,
+ &[object],
+ Some(br#"{"caption":"hello world"}"#),
+ None,
+ )
+ .await
+ .expect("post creation should succeed");
+ let owner_post = owner_ctx
+ .fetch_post_decrypted(post_id)
+ .await
+ .expect("owner should decrypt post");
+ assert_eq!(
+ owner_post.caption_plaintext.as_deref(),
+ Some(br#"{"caption":"hello world"}"#.as_slice())
+ );
+
+ wall::assert_http_status(
+ follower_ctx
+ .get_wall_profile_raw(&owner_wall.wall_id, None)
+ .await,
+ 403,
+ );
+
+ follower_ctx
+ .request_follow_by_wall(&owner_wall.wall_id)
+ .await
+ .expect("follow request should succeed");
+ let incoming = owner_ctx
+ .list_incoming_follow_requests()
+ .await
+ .expect("incoming follow requests should load");
+ assert_eq!(incoming.len(), 1);
+ assert_eq!(incoming[0].wall_id, owner_wall.wall_id);
+ owner_ctx
+ .approve_follow_request(&incoming[0])
+ .await
+ .expect("follow approval should succeed");
+
+ let shares = follower_ctx
+ .list_follow_shares()
+ .await
+ .expect("follow shares should load");
+ assert_eq!(shares.len(), 1);
+ let decrypted_share = follower_ctx
+ .decrypt_follow_share(&shares[0])
+ .expect("follow share should decrypt");
+ assert_eq!(decrypted_share.wall_id, owner_wall.wall_id);
+
+ let hydrated = follower_ctx
+ .hydrate_wall_keys()
+ .await
+ .expect("wall keys should hydrate");
+ assert_eq!(hydrated.owned.len(), 1);
+ assert_eq!(hydrated.followed.len(), 1);
+ assert_eq!(hydrated.followed[0].wall_id, owner_wall.wall_id);
+
+ let follower_profile = follower_ctx
+ .get_wall_profile_decrypted(&owner_wall.wall_id, None)
+ .await
+ .expect("approved follower should decrypt profile");
+ assert_eq!(follower_profile.profile, updated_profile);
+ assert_eq!(follower_profile.wall_slug, updated_slug);
+
+ let feed = follower_ctx
+ .list_feed(None, Some(10))
+ .await
+ .expect("feed should load after follow approval");
+ assert_eq!(feed.items.len(), 1);
+ assert_eq!(feed.items[0].post_id, post_id);
+ let feed_post = follower_ctx
+ .decrypt_feed_item(&feed.items[0])
+ .await
+ .expect("feed item should decrypt");
+ assert_eq!(
+ feed_post.caption_plaintext.as_deref(),
+ Some(br#"{"caption":"hello world"}"#.as_slice())
+ );
+
+ let liked = follower_ctx
+ .like_post(post_id, true)
+ .await
+ .expect("liking post should succeed");
+ assert!(liked.liked);
+ let top_level = follower_ctx
+ .create_comment(post_id, &post_key, b"looks great", None)
+ .await
+ .expect("comment creation should succeed");
+ owner_ctx
+ .create_comment(post_id, &post_key, b"thanks", Some(top_level.comment_id))
+ .await
+ .expect("reply creation should succeed");
+
+ let comments = follower_ctx
+ .list_comments(post_id, None, None)
+ .await
+ .expect("comments should load");
+ assert_eq!(comments.comments.len(), 1);
+ assert_eq!(comments.comments[0].replies.len(), 1);
+ let parent = follower_ctx
+ .decrypt_comment(&post_key, &comments.comments[0])
+ .expect("parent comment should decrypt");
+ let reply = follower_ctx
+ .decrypt_comment(&post_key, &comments.comments[0].replies[0])
+ .expect("reply comment should decrypt");
+ assert_eq!(parent.plaintext, b"looks great");
+ assert_eq!(reply.plaintext, b"thanks");
+
+ wall::assert_http_status(outsider_ctx.fetch_post_decrypted(post_id).await, 403);
+
+ let link = owner_ctx
+ .create_wall_link(&updated_slug, &owner_wall.wall_id)
+ .await
+ .expect("wall link should be created");
+ let link_ctx = WallLinkCtx::open(OpenWallLinkCtxInput {
+ base_url: endpoint.clone(),
+ wall_id: owner_wall.wall_id.clone(),
+ secret: link.secret.clone(),
+ user_agent: Some("ente-e2e".to_string()),
+ client_package: Some("io.ente.photos".to_string()),
+ client_version: Some("ente-e2e".to_string()),
+ })
+ .await
+ .expect("wall link should open");
+ let link_profile = link_ctx
+ .get_wall_profile_decrypted(None)
+ .await
+ .expect("link session should decrypt profile");
+ assert_eq!(link_profile.profile, updated_profile);
+ let link_posts = link_ctx
+ .list_posts(None)
+ .await
+ .expect("link session should list posts");
+ assert_eq!(link_posts.len(), 1);
+ let link_post = link_ctx
+ .decrypt_post(&link_posts[0])
+ .await
+ .expect("link session should decrypt post");
+ assert_eq!(
+ link_post.caption_plaintext.as_deref(),
+ Some(br#"{"caption":"hello world"}"#.as_slice())
+ );
+
+ owner_ctx
+ .delete_wall_link(&owner_wall.wall_id)
+ .await
+ .expect("wall link deletion should succeed");
+ wall::assert_http_status(link_ctx.get_wall_profile_raw(None).await, 401);
+}
diff --git a/rust/wall/src/client.rs b/rust/wall/src/client.rs
index 592549440c..89b120f490 100644
--- a/rust/wall/src/client.rs
+++ b/rust/wall/src/client.rs
@@ -27,7 +27,7 @@ use crate::transport::{
use ente_core::crypto::{sealed, secretbox};
use ente_core::http::{Error as HttpError, HttpClient, HttpConfig};
-const ROOT_WALL_KEY_TYPE: &str = "root_wall_key";
+const ROOT_WALL_KEY_TYPE: &str = "wall";
const WALL_LINK_AUTH_LABEL: &str = "wall-link-login-v1";
const WALL_LINK_WRAP_LABEL: &str = "wall-link-view-v1";
const UPLOAD_PURPOSE_AVATAR: &str = "avatar";
@@ -40,7 +40,6 @@ struct ResolvedWallAccess {
pub struct AccountWallCtx {
client: HttpClient,
- base_url: String,
master_key: Vec<u8>,
public_key: Vec<u8>,
private_key: Vec<u8>,
@@ -49,7 +48,6 @@ pub struct AccountWallCtx {
pub struct WallLinkCtx {
client: HttpClient,
- base_url: String,
owner_handle: String,
wall_id: String,
wall_slug: String,
@@ -69,7 +67,6 @@ impl AccountWallCtx {
let private_key = decrypt_private_key(&input.master_key, input.private_key_source)?;
Ok(Self {
client,
- base_url: input.base_url,
master_key: input.master_key,
public_key: input.public_key,
private_key,
@@ -105,7 +102,7 @@ impl AccountWallCtx {
.await?;
Ok(payload.map(|value| EntityKeyPayload {
encrypted_key: value.encrypted_key,
- nonce: value.nonce,
+ header: value.header,
}))
}
@@ -117,13 +114,9 @@ impl AccountWallCtx {
let request = CreateEntityKeyRequest {
key_type: key_type.to_owned(),
encrypted_key: payload.encrypted_key.clone(),
- nonce: payload.nonce.clone(),
+ header: payload.header.clone(),
};
- match self
- .client
- .post_json::<StatusResponse, _>("/user-entity/key", &request)
- .await
- {
+ match self.client.post_empty("/user-entity/key", &request).await {
Ok(_) => Ok(()),
Err(HttpError::Http { status: 409, .. }) => Err(WallError::EntityKeyConflict),
Err(err) => Err(err.into()),
@@ -990,7 +983,7 @@ impl AccountWallCtx {
pub async fn delete_wall_link(&self, wall_id: &str) -> Result<()> {
let path = format!("/wall/links/{wall_id}");
- let _: StatusResponse = self.client.delete_json(&path, &[]).await?;
+ self.client.delete_empty(&path, &[]).await?;
Ok(())
}
@@ -1094,7 +1087,6 @@ impl WallLinkCtx {
decrypt_secretbox_packed(&wrap_key, &decode_b64(&response.encrypted_wall_key)?)?;
Ok(Self {
client,
- base_url: input.base_url,
owner_handle: response.owner,
wall_id: response.wall_id,
wall_slug: response.wall_slug,
@@ -1436,7 +1428,7 @@ mod tests {
json!({
"type": ROOT_WALL_KEY_TYPE,
"encryptedKey": payload.encrypted_key,
- "nonce": payload.nonce,
+ "header": payload.header,
})
.to_string(),
)
@@ -1483,8 +1475,7 @@ mod tests {
"owner": "owner-handle",
"keyVersion": 3,
"encryptedWallKey": encrypted_wall_key,
- "encryptedPublicProfile": "",
- "encryptedPrivateProfile": "",
+ "encryptedProfile": "",
})
.to_string(),
)
@@ -1703,7 +1694,7 @@ mod tests {
json!({
"type": ROOT_WALL_KEY_TYPE,
"encryptedKey": entity_payload.encrypted_key,
- "nonce": entity_payload.nonce,
+ "header": entity_payload.header,
})
.to_string(),
)
@@ -1718,8 +1709,7 @@ mod tests {
"wallId": "wall_owner_gallery",
"wallSlug": "owner-gallery",
"encryptedWallKey": encode_b64(&encrypt_secretbox_packed(&root_wall_key, &wall_key).expect("wall key wrap")),
- "encryptedPublicProfile": "",
- "encryptedPrivateProfile": "",
+ "encryptedProfile": "",
"keyVersion": 3
}])
.to_string(),
@@ -1789,7 +1779,7 @@ mod tests {
json!({
"type": ROOT_WALL_KEY_TYPE,
"encryptedKey": entity_payload.encrypted_key,
- "nonce": entity_payload.nonce,
+ "header": entity_payload.header,
})
.to_string(),
)
@@ -1804,8 +1794,7 @@ mod tests {
"wallId": "wall_owner_gallery",
"wallSlug": "owner-gallery",
"encryptedWallKey": encode_b64(&encrypt_secretbox_packed(&root_wall_key, &owned_wall_key).expect("owned wrap")),
- "encryptedPublicProfile": "",
- "encryptedPrivateProfile": "",
+ "encryptedProfile": "",
"keyVersion": 1
}])
.to_string(),
@@ -1822,8 +1811,7 @@ mod tests {
"wallId": "wall_shared_gallery",
"wallSlug": "shared-gallery",
"encryptedWallKey": encode_b64(&pack_payload(&sealed_share, &[])),
- "encryptedPublicProfile": "",
- "encryptedPrivateProfile": "",
+ "encryptedProfile": "",
"keyVersion": 4
}])
.to_string(),
diff --git a/rust/wall/src/crypto.rs b/rust/wall/src/crypto.rs
index bbd0a18b0b..a673dc6a4c 100644
--- a/rust/wall/src/crypto.rs
+++ b/rust/wall/src/crypto.rs
@@ -65,13 +65,13 @@ pub fn encrypt_entity_key(master_key: &[u8], plaintext: &[u8]) -> Result<EntityK
let (ciphertext, nonce) = encrypt_secretbox_split(master_key, plaintext)?;
Ok(EntityKeyPayload {
encrypted_key: encode_b64(&ciphertext),
- nonce: encode_b64(&nonce),
+ header: encode_b64(&nonce),
})
}
pub fn decrypt_entity_key(master_key: &[u8], payload: &EntityKeyPayload) -> Result<Vec<u8>> {
let ciphertext = decode_b64(&payload.encrypted_key)?;
- let nonce = decode_b64(&payload.nonce)?;
+ let nonce = decode_b64(&payload.header)?;
decrypt_secretbox_split(master_key, &ciphertext, &nonce)
}
diff --git a/rust/wall/src/transport.rs b/rust/wall/src/transport.rs
index ee91f4bf7c..659d239485 100644
--- a/rust/wall/src/transport.rs
+++ b/rust/wall/src/transport.rs
@@ -8,7 +8,7 @@ fn is_false(value: &bool) -> bool {
#[serde(rename_all = "camelCase")]
pub struct EntityKeyPayload {
pub encrypted_key: String,
- pub nonce: String,
+ pub header: String,
}
#[derive(Debug, Clone, Deserialize)]
@@ -17,7 +17,7 @@ pub struct EntityKeyResponse {
#[serde(rename = "type")]
pub key_type: String,
pub encrypted_key: String,
- pub nonce: String,
+ pub header: String,
}
#[derive(Debug, Clone, Serialize)]
@@ -26,7 +26,7 @@ pub struct CreateEntityKeyRequest {
#[serde(rename = "type")]
pub key_type: String,
pub encrypted_key: String,
- pub nonce: String,
+ pub header: String,
}
#[derive(Debug, Clone, Deserialize)]
diff --git a/server/wall/controller/helpers.go b/server/wall/controller/helpers.go
index e8f6c60503..73d3e71ba6 100644
--- a/server/wall/controller/helpers.go
+++ b/server/wall/controller/helpers.go
@@ -66,6 +66,7 @@ func toPostResponse(post *wallrepo.WallPostRecord, assets []wallrepo.WallPostAss
PostID: post.PostID,
WallID: post.WallID,
WallSlug: post.WallSlug,
+ OwnerUserID: post.OwnerID,
Author: post.Author,
EncryptedPostKey: post.EncryptedPostKey,
CaptionCipher: post.CaptionCipher,
diff --git a/server/wall/models/models.go b/server/wall/models/models.go
index 8135d8e53c..32e2e514ad 100644
--- a/server/wall/models/models.go
+++ b/server/wall/models/models.go
@@ -261,6 +261,7 @@ type PostResponse struct {
PostID int64 `json:"postId"`
WallID string `json:"wallId"`
WallSlug string `json:"wallSlug"`
+ OwnerUserID int64 `json:"ownerUserId"`
Author string `json:"author"`
EncryptedPostKey string `json:"encryptedPostKey"`
CaptionCipher string `json:"captionCipher,omitempty"`