Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deserialization error in DocumentMetadataResult without permission to decrypt #239

Open
giarc3 opened this issue May 13, 2021 · 0 comments

Comments

@giarc3
Copy link
Member

giarc3 commented May 13, 2021

When trying to get the metadata of a document you don't have permission to decrypt, you get an error from serde: serde error was: invalid type: null, expected struct TransformedEncryptedValue. This field should be optional for deserialization.

Test made to show issue:

// create a user
let sdk = initialize_sdk().await?;
// create a group
let group = sdk.group_create(&GroupCreateOpts::default()).await?;
// encrypt a document to the group, not to self
let doc_result = sdk
    .document_encrypt(
        &[0u8; 64],
        &DocumentEncryptOpts::with_explicit_grants(None, None, false, vec![group.id().into()]),
    )
    .await?;
// revoke group's access to the document
sdk.document_revoke_access(doc_result.id(), &vec![group.id().into()])
    .await?;
// attempt to get metadata of the document
sdk.document_get_metadata(doc_result.id()).await?;
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

No branches or pull requests

1 participant