Commits
Click on a commit to change the comparison rangeMerge branch 'main' into v5 Merge branch 'main' into v5 Support for closures (#202)
This introduces the closure operations to the Biscuit language, first with the `.all()` and `.any()` operations to add conditions on the elements of a set.
It is now possible to use expressions with the following format:
```
check if [1,2,3].all($p -> $p > 0);
check if [1,2,3].any($p -> $p > 2);
```
Co-authored-by: Geoffroy Couprie <contact@geoffroycouprie.com> Merge branch 'main' into v5 Merge branch 'main' into v5 Merge pull request #231 from biscuit-auth/major-minor-datalog-versions
Major minor datalog versions Merge pull request #229 from biscuit-auth/fix-param-substitution-in-closures
fix: recursively collect and apply parameters in closures Merge pull request #233 from biscuit-auth/rename-v5-detector
fix: left over renaming after #231 Merge pull request #201 from biscuit-auth/typeof
feat: add `.type()` unary method add new Array and Map types (#219)
This adds support for the array and map types, supporting more structured datalog terms, that we can generate from JSON data and explore through datalog expressions. The map type allows integers strings and parameters as key. This tries to enforce that all array elements are of the same type, but this is not very strict at the moment, it does not look at lower levels of composite types.
**breaking changes**:
- in the Datalog language, sets will now be delimited
by '{' and '}' instead of '[' and ]'. Arrays are now delimited by '['
and ']'
- parameter names now need to start with a letter
---------
Co-authored-by: Clement Delafargue <clement.delafargue@outscale.com> Merge pull request #238 from biscuit-auth/geal/merge-main-in-v5
merge the CAPI changes in V5 Merge pull request #228 from biscuit-auth/ffi
datalog foreign function interface prototype add support for ecdsa signatures (#108)
This adds suport for ECDSA signatures over the secp256r1 curve, following the specification change at https://github.com/biscuit-auth/biscuit/commit/ed1c53d6db5811dfb9d9e395e95135f7f5660dbe. Key creation now takes an algorithm argument
Co-authored-by: Clément Delafargue <clement.delafargue.ext@outscale.com> Merge pull request #246 from biscuit-auth/force-sig-v1
force using signature v1 in more cases Merge pull request #247 from biscuit-auth/remove-previous-key-from-3rd-party-request
remove previous_key from ThirdPartyBlockRequest Merge pull request #191 from biscuit-auth/better-display-for-logic-error
Better display for `errors::Logic` refactor builder modules (#249)
This splits the builders to their own files authorizer builder (#250)
This adds an `AuthorizerBuilder` struct that is used to create an `Authorizer`. All of the mutable behaviour, like adding facts or executing Datalog rules is moved into the builder, while the authorizer is limited to read-only queries (still requiring self mutability to track execution time). This will solve some awkward behaviour where the authorizer had to run Datalog rules again when facts or rules were added, but it was not done consistently. The `AuthorizerBuilder` is compatible with snapshots, to store and reuse checks and policies. It has a `build` method taking a token as argument, and a `build_unauthenticated` for authorization without token.
The builder APIs are alo changing. Before, we had the following:
```rust
let mut builder = Biscuit::builder();
builder.add_fact(r"right("file1", "read")"#)?;
builder.add_fact(r"right("file2", "read")"#)?;
let token = builder.build()?;
```
Builders are now constructed like this:
```rust
let token = Biscuit::builder()
.fact(r"right("file1", "read")"#)?
.fact(r"right("file2", "read")"#)?
.build()?;
```` Merge pull request #253 from biscuit-auth/esl2
Esl2 Merge pull request #254 from biscuit-auth/top-level-exports
API improvements Merge pull request #255 from biscuit-auth/authorizer-debug
Authorizer API improvements Merge pull request #257 from biscuit-auth/authorizer-debug
fix snapshot de-serializing