digitalbazaar / edv-client

An Encrypted Data Vault Client
BSD 3-Clause "New" or "Revised" License
13 stars 9 forks source link

EdvClient support for get all edvs for controller #67

Closed OR13 closed 4 years ago

OR13 commented 4 years ago

https://github.com/digitalbazaar/edv-client/blob/master/EdvClient.js#L771

The client should probably always return an array... returning null creates an unnecessary type.

The client should NOT return an object or an array.

OR13 commented 4 years ago

servers can hack around this by returning a nested array, but that will lead to a response type of Object || Array || null... which is bad.

dlongley commented 4 years ago

I think findConfig only ever returns an object (which may be null if no config is found). I don't think it ever returns an array -- there can be only one config for a given controller and reference ID. The findConfigs call can return multiple configs, but it already always returns an array which may potentially be empty. However, I tend to think that this latter call should be changed to always return an object with an array underneath a configs property (could be bikeshedded) to allow for other meta properties in the future.

mattcollier commented 4 years ago

@OR13 does the existing findConfigs API suite your needs? https://github.com/digitalbazaar/edv-client/blob/master/EdvClient.js#L795

OR13 commented 4 years ago

ahh, didn't realize that api existed. I will test, but it looks like this can be closed.

mattcollier commented 4 years ago

Great, closing.