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

Reject if #199

Merged
merged 4 commits into from
May 12, 2024
Merged

Reject if #199

merged 4 commits into from
May 12, 2024

Conversation

divarvel
Copy link
Collaborator

@divarvel divarvel commented Dec 28, 2023

See biscuit-auth/biscuit#141

This adds reject if support to the parser as well as the serialization layer, raising the block version to 5 when used.

This PR does not introduce an equivalent to reject if all because i'm not sure what it would look like and whether it would be useful.

This acts like the opposite of `check if`: if there is a match, then authorization fails.

Using `reject if` raises the block version to 5
The file contained trailing slashes that made rustfmt crash
biscuit-auth/src/datalog/mod.rs Show resolved Hide resolved
let mut contains_check_all = false;
let mut contains_reject_if = false;

for c in checks.iter() {

Choose a reason for hiding this comment

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

Couldn't be simplified with a contains ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we are setting two separate flags, so using contains (or any as before) would require traversing the list twice.

biscuit-auth/src/datalog/mod.rs Show resolved Hide resolved
biscuit-auth/src/format/convert.rs Show resolved Hide resolved
biscuit-auth/src/datalog/mod.rs Show resolved Hide resolved
@Geal Geal changed the base branch from main to v5 May 12, 2024 11:34
@Geal Geal changed the base branch from v5 to main May 12, 2024 11:34
@Geal Geal changed the base branch from main to v5 May 12, 2024 11:34
@Geal Geal merged commit 0a3de7e into v5 May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants