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

Better display for errors::Logic #191

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

divarvel
Copy link
Collaborator

@divarvel divarvel commented Oct 26, 2023

authorization failed: an allow policy matched (policy index: 0), and the following checks failed: [Authorizer(FailedAuthorizerCheck { check_id: 0, rule: "check if right(\"efgh\")" }), Block(FailedBlockCheck { block_id: 1, check_id: 0, rule: "check if operation(\"read\")" })]

@@ -168,9 +171,9 @@ pub enum Signature {
#[derive(Error, Clone, Debug, PartialEq, Eq)]
#[cfg_attr(feature = "serde-error", derive(serde::Serialize, serde::Deserialize))]
pub enum Logic {
#[error("a rule provided by a block is generating facts with the authority or ambient tag, or has head variables not used in its body")]
#[error("a rule provided by a block is producing a fact with unbound variables")]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wanted to completely remove it, but it's still used. the strange thing is that it explicitly mentions block rules. Where is the error for authorizer rules with unbound variables in facts?

@divarvel divarvel changed the title Better display for logic error Better display for logic errors Oct 27, 2023
@divarvel divarvel changed the title Better display for logic errors Better display for errors::Logic Oct 27, 2023
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

Successfully merging this pull request may close these issues.

None yet

1 participant