Add vessel data structures for authentication #139
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
These data structures are based on previous solutions for authentication by @danbornside based on SubVessel (wrapped as AuthMapV) as well as Cale's idea for ErrorV which handles possibly failing queries in a way that does not expose incoherent behavior to the end-users. There is also an AuthenticatedV wrapper which glues together two view selectors which need have no relation to each other in particular, but the intended use case is to combine it with AuthMapV.
The handler provided for AuthMapV assumes that the result of the query does not depend on the specific identity making the query. This allows efficient aggregation of queries across different authenticated users. There are other sorts of authenticated queries which do depend on the specific identity, like querying for one's own profile. One way we can accommodate such queries is to extend AuthenticatedV with a third key for "Personal" queries which use AuthMapV but do not do query aggregation.
This PR should be updated once obsidiansystems/vessel#14 is merged.