authorizer: always display authorizer facts and rules #195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
impl Display for Authorizer
only used the datalog world for displaying facts. When calling.to_string()
on an authorizer before.authorize()
, authorizer facts and rules were not displayed (authorizer facts and rules are added to the datalog world only in.authorize()
).After authorization, authorizer facts and rules are both in the world and the block, so deduplication is needed.
See #193 and #194
Note: the output of
.to_string()
is still not a faithful representation of the snapshot contents, since the authorizer block can have a block-wide scope annotation, which is not displayed. Maybe displaying a snapshot as a single datalog snippet does not even make sense (after all, we are already using comments to annotate stuff). We could display blocks faithfully (not using the datalog world), and then display generated facts in a separate way (we would still have to deduplicate facts to only display generated facts and not facts coming directly from blocks.