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

Sparse mode: handle documents without their actual content #33

Closed
4 of 8 tasks
cinnamon-bun opened this issue Jul 30, 2020 · 1 comment · Fixed by #279
Closed
4 of 8 tasks

Sparse mode: handle documents without their actual content #33

cinnamon-bun opened this issue Jul 30, 2020 · 1 comment · Fixed by #279
Labels
enhancement New feature or request
Milestone

Comments

@cinnamon-bun
Copy link
Member

cinnamon-bun commented Jul 30, 2020

Document signatures should depend on the hash of the content, not the content itself.

This would let you:

  • Download documents without their content, just metadata, and still verify signatures
  • Locally delete content but keep metadata (e.g. when removing blocked content).

Add contentHash field

  • Add required contentHash field to documents
  • Compute the hash when writing a document: sha256(content)
  • Use contentHash and not content when hashing a document
  • When verifying document, check the hash matches the content

Allow content to be null

  • Allow content to be null, meaning it's missing (note, empty documents are still content: "")
  • When verifying document, check the hash matches the content OR the content is null
  • Add query option includeContent: boolean (include or omit the content itself in the returned docs)
  • Add query option hasContent: boolean (find docs with missing content, or existing content)
@cinnamon-bun cinnamon-bun added the enhancement New feature or request label Jul 30, 2020
@cinnamon-bun cinnamon-bun added this to the v1 milestone Jul 30, 2020
@cinnamon-bun
Copy link
Member Author

cinnamon-bun commented Aug 1, 2020

Content can't be null yet, otherwise this is done in e41f5c7

Allowing content to be null might change the API a bit -- I want to think about that

@cinnamon-bun cinnamon-bun changed the title Add contentHash field to allow handling docs without actual content Sparse mode: handle documents without their actual content Aug 6, 2020
@cinnamon-bun cinnamon-bun modified the milestones: acorn, bananaslug Aug 17, 2020
sgwilym pushed a commit that referenced this issue Feb 16, 2022
add storage.overwriteAllDocsByAuthor(keypair) method and tests;
@sgwilym sgwilym modified the milestones: Bananaslug, Squirrel May 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants