biscuit icon indicating copy to clipboard operation
biscuit copied to clipboard

file format to store and load facts, rules and caveats

Open Geal opened this issue 5 years ago • 5 comments

Right now, when generating a new token or a verifier, all of the facts and rules are entered manually in the code. We might want to load them from a file or memory instead. Since we already have protobuf definitions to transport them inside a token, I'd propose we reuse protobuf to store them

Geal avatar Sep 15 '20 08:09 Geal

Very early stage (especially compared to protobuf) but https://github.com/ClickSimply/NoProto seems interesting, although there are a few issues when integrating with sled https://github.com/ClickSimply/NoProto/issues/5

fimbault avatar Oct 06 '20 13:10 fimbault

NoProto looks interesting! But for now, Protobuf is a much safer bet, mainly because there are many good implementations in various languages (we want biscuit to be usable outside of Rust too). For some context on what led to the Protobuf choice: https://github.com/CleverCloud/biscuit/issues/18

Geal avatar Oct 08 '20 13:10 Geal

NoProto could at least work in wasm environments, and if you consider the goal of using that in a DB, it provides some insightful ideas.
But sure. I'm fine with protobuf, it's quite battleproof. Thanks for the link.

Not directly related to serialization, but since issue 18 is estimating the size of several blocks (which I tested too), I was wondering if we could potentially reduce the number of blocks, for instance concatenate blocks generated by the same authority. The issue is more present if you allow the generation/attenuation through a UI (the user might not fully understand the impact and click several times with minor changes), and therefore create larger blobs that don't fit in cookies or IndexedDB for instance.

fimbault avatar Oct 08 '20 13:10 fimbault

I'll take a look on the crypto side, I'm not sure it would be possible, even if we have the private key used to sign the previous block

Geal avatar Oct 19 '20 14:10 Geal

There is a protobuf-based format allowing to describe rules, facts & policies, as well as a format for dumping the state and contents of an authorizer.

Is this issue still relevant?

divarvel avatar Apr 25 '23 11:04 divarvel