Skip to content

Rust SDK: keep other folder fields when update_folder renames a folder (KSM-1893) - #1334

Open
stas-schaller wants to merge 1 commit into
release/sdk/rust/v18.0.0from
feature/KSM-1893-rust-rename-keeps-data
Open

stas-schaller wants to merge 1 commit into
release/sdk/rust/v18.0.0from
feature/KSM-1893-rust-rename-keeps-data

Conversation

@stas-schaller

Copy link
Copy Markdown
Collaborator

Summary

Rust SDK: update_folder now keeps every field of the folder data except the name. Before, a rename sent the name alone, and the server replaced the whole encrypted folder data with it. That removed the folder color and any other field. The SDK reads the folder data, encrypts it again with the folder key in the folder's own cipher (AES-CBC or AES-GCM), and sends it. Nothing new is sent in plaintext, and no key leaves the client.

Changes

Fixed

  • KeeperFolder has a new public field data: Option<HashMap<String, Value>>. KeeperFolder::new fills it with the full decrypted folder data. data is None when the decrypted bytes are not a JSON object (KSM-1893).
  • update_folder copies data, replaces name, and encrypts the result. If the matching folder has no data, it reads get_folders once more. If the data is still missing, it returns an error that names the folder UID and sends nothing.

Testing

cd sdk/rust && cargo test --test update_folder_keeps_metadata_tests

Breaking Changes

KeeperFolder has a new public field. Code that builds KeeperFolder with a struct literal must set data. Setting data: None is valid, and update_folder then refreshes the folder from get_folders. The CHANGELOG records this under 18.0.0.

Related Issues

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant