biscuit-rust icon indicating copy to clipboard operation
biscuit-rust copied to clipboard

Non-deterministic output of `Authorizer.dump_code()`

Open divarvel opened this issue 2 years ago • 1 comments

Facts are stored as a HashMap internally, so their order is not defined.

The Display impl for Authorizer does sort everything, so it has a stable output. It also adds more information in comments (namely the facts and rules origins, which is extremely important).

I guess we could just call .to_string() in dump_code() to keep backwards compatibility. However, the Display implementation for Authorizer only uses facts and rules from the Datalog::World value, so it may discard facts and rules added to the authorizer before calling authorize. I guess that overlaps with #192

divarvel avatar Oct 30 '23 15:10 divarvel

I am working on a fix for missing facts and rules in Authorizer.to_string()

divarvel avatar Oct 31 '23 08:10 divarvel