biscuit-rust icon indicating copy to clipboard operation
biscuit-rust copied to clipboard

wip: datalog foreign function interface prototype

Open divarvel opened this issue 1 year ago • 2 comments

This allows using external functions in datalog.

This makes it easy to provide custom logic without extending the spec for every use-case, at the expense of portability: behaviour is no longer guaranteed to be consistent cross languages, and some languages won’t be able to support it at all (for instance JS as of now).

Todo:

  • feature-gating if possible (does it make sense? since it will still impact protobuf serialization)
  • samples (if we consider it part of the spec?)

Open questions:

  • protobuf enum index for the FFI variants (contiguous or not?)
  • should function names be interned as well? they are currently not

Code coverage should be improved by adding samples

divarvel avatar Oct 02 '24 08:10 divarvel

CodSpeed Performance Report

Merging #228 will not alter performance

Comparing ffi (a179587) with v5 (e59f41d)

Summary

✅ 12 untouched benchmarks

codspeed-hq[bot] avatar Oct 02 '24 08:10 codspeed-hq[bot]

Codecov Report

Attention: Patch coverage is 75.54180% with 79 lines in your changes missing coverage. Please review.

Project coverage is 65.44%. Comparing base (796ba5d) to head (a179587). Report is 9 commits behind head on v5.

Files with missing lines Patch % Lines
biscuit-parser/src/builder.rs 0.00% 34 Missing :warning:
biscuit-auth/src/token/builder.rs 86.76% 18 Missing :warning:
biscuit-auth/src/format/convert.rs 74.13% 15 Missing :warning:
biscuit-auth/src/token/authorizer.rs 25.00% 6 Missing :warning:
biscuit-auth/src/datalog/expression.rs 90.90% 4 Missing :warning:
biscuit-auth/examples/testcases.rs 93.10% 2 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##               v5     #228      +/-   ##
==========================================
+ Coverage   64.82%   65.44%   +0.62%     
==========================================
  Files          25       25              
  Lines        6502     6729     +227     
==========================================
+ Hits         4215     4404     +189     
- Misses       2287     2325      +38     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features:

codecov[bot] avatar Oct 02 '24 08:10 codecov[bot]

that will be a great tool for future experimentation

Geal avatar Nov 19 '24 20:11 Geal