fluree / db

Fluree database library
https://fluree.github.io/db/
Other
334 stars 21 forks source link

Feature/credential apis #825

Closed bplatz closed 1 month ago

bplatz commented 1 month ago

This PR creates the remaining credential/signature specific APIs. Now queries, transactions, etc. that are wrapped in signatures have an independent API.

The primary motivation for this work right now is getting back a "zero-trust" setting for fluree/server like we had in v2 and this supports that being done. In the zero-trust (formerly called open-api: false), all interactions must happen with signatures. I also think those APIs make more sense separate as they not only have a different input format, but are quite intentional - you should know if you need it or not. I think it also helps ensure you don't accidentally do the wrong thing, as security here is of high concern.

In addition, there was some intersecting work, the biggest change is that f:txn (source transaction) only gets written to disk and included in the commit if it was originally wrapped in a signature. Storing every transaction is expensive, and it's purpose is for replayable cryptographic proof - when a ledger is being used without signatures it does nothing for that use case.

There were a number of tests that used test-utils/transact, which I assume was created before we had the fluree/transact! API - so those tests now use our external API and the helper util is removed.