trustbloc / edv

Encrypted data vault implementation in Golang - https://identity.foundation/edv-spec/
Apache License 2.0
16 stars 17 forks source link

Support sort options on queries #231

Open DRK3 opened 2 years ago

DRK3 commented 2 years ago

The order of results returned from a call to EDV is currently determined by the underlying storage provider. We'd like a way to allow a client to control this.

This is tricky because all the documents stored in EDV are encrypted by the client, so the EDV server doesn't really have anything (useful) it can base a sort order on. Encrypted index name + values are encrypted hash values, and so there's no real useful order there.

Probably the only thing it could sort on is based on the time the data was inserted into the underlying database.

Also, the EDV spec doesn't specify sort order options. If we add this capability, we should get it in the spec.

If we want to do this, there are some options...

  1. Allow sort based on the limited information EDV knows (insertion time)
  2. Investigate the possibility of allowing limited plaintext metadata to be used with encrypted documents. This will be tricky from a standards compliance point of view.