biscuit-rust
biscuit-rust copied to clipboard
Non-deterministic output of `Authorizer.dump_code()`
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
I am working on a fix for missing facts and rules in Authorizer.to_string()