Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-deterministic output of Authorizer.dump_code() #193

Open
divarvel opened this issue Oct 30, 2023 · 1 comment
Open

Non-deterministic output of Authorizer.dump_code() #193

divarvel opened this issue Oct 30, 2023 · 1 comment

Comments

@divarvel
Copy link
Collaborator

divarvel commented Oct 30, 2023

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
Copy link
Collaborator Author

divarvel commented Oct 31, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant