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

Biscuit v5 #162

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c1568d4
spec: support for `reject if`
divarvel Jun 29, 2023
736bf73
Merge pull request #143 from biscuit-auth/reject-if
divarvel Jul 3, 2023
f74e384
Merge branch 'main' into dev
Geal Jul 4, 2023
d7d8102
Merge branch 'main' into dev
Geal May 12, 2024
7e6e347
Reject if samples (#161)
Geal May 12, 2024
5cddb2e
Add support for the null type (#166)
Geal May 23, 2024
1514dd5
update samples and schema based on the latest v5 branch in biscuit-rust
divarvel Oct 24, 2024
79e1b69
Document lenient (heterogeneous) equality
divarvel Oct 24, 2024
e46fbbb
Document the `.type()` operation
divarvel Oct 24, 2024
27ec12a
Document closures, any/all, eager/short-circuit boolean operators
divarvel Oct 24, 2024
4c5e543
Merge pull request #172 from biscuit-auth/heterogeneous-equality
divarvel Nov 3, 2024
92d1c67
add spec and samples for map and array types
divarvel Nov 4, 2024
d815877
fix: reword supported operations on `null`
divarvel Nov 4, 2024
9e55e08
Merge pull request #173 from biscuit-auth/map-array
divarvel Nov 5, 2024
05a49da
Update schema.proto with maps and arrays
divarvel Nov 8, 2024
90fbea9
specifcy FFI operations
divarvel Nov 8, 2024
c31aa3d
Merge pull request #174 from biscuit-auth/ffi
divarvel Nov 12, 2024
7e601cb
Signature payload format v1 (#175)
Geal Nov 19, 2024
37cc137
update samples (lenient equals sample)
divarvel Nov 19, 2024
d91cae8
Merge pull request #177 from biscuit-auth/update-samples
divarvel Nov 19, 2024
1c7ca0c
ffi: intern function names
divarvel Nov 19, 2024
ddb95ca
ffi: add samples
divarvel Nov 19, 2024
0eebe9c
ffi: mention that call names are interned
divarvel Nov 19, 2024
02ee6da
Merge pull request #176 from biscuit-auth/ffi
divarvel Nov 19, 2024
ed1c53d
Support for ECDSA signatures on curve secp256r1 (#165)
Geal Nov 20, 2024
d1badff
clarify datalog versions (3.x)
divarvel Nov 20, 2024
e2d18a2
Merge pull request #178 from biscuit-auth/datalog-3.x
divarvel Nov 21, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
379 changes: 308 additions & 71 deletions SPECIFICATIONS.md

Large diffs are not rendered by default.

1,245 changes: 1,080 additions & 165 deletions samples/current/README.md

Large diffs are not rendered by default.

955 changes: 903 additions & 52 deletions samples/current/samples.json

Large diffs are not rendered by default.

Binary file modified samples/current/test017_expressions.bc
Binary file not shown.
Binary file modified samples/current/test024_third_party.bc
Binary file not shown.
Binary file modified samples/current/test026_public_keys_interning.bc
Binary file not shown.
Binary file modified samples/current/test027_integer_wraparound.bc
Binary file not shown.
Binary file added samples/current/test029_reject_if.bc
Binary file not shown.
Binary file added samples/current/test030_null.bc
Binary file not shown.
Binary file added samples/current/test031_heterogeneous_equal.bc
Binary file not shown.
Binary file added samples/current/test032_laziness_closures.bc
Binary file not shown.
Binary file added samples/current/test033_typeof.bc
Binary file not shown.
Binary file added samples/current/test034_array_map.bc
Binary file not shown.
Binary file added samples/current/test035_ffi.bc
Binary file not shown.
Binary file added samples/current/test036_secp256r1.bc
Binary file not shown.
52 changes: 49 additions & 3 deletions schema.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ message SignedBlock {
required PublicKey nextKey = 2;
required bytes signature = 3;
optional ExternalSignature externalSignature = 4;
optional uint32 version = 5;
}

message ExternalSignature {
Expand All @@ -26,6 +27,7 @@ message PublicKey {

enum Algorithm {
Ed25519 = 0;
SECP256R1 = 1;
}

required bytes key = 2;
Expand Down Expand Up @@ -80,6 +82,7 @@ message CheckV2 {
enum Kind {
One = 0;
All = 1;
Reject = 2;
}
}

Expand All @@ -97,13 +100,36 @@ message TermV2 {
bytes bytes = 5;
bool bool = 6;
TermSet set = 7;
Empty null = 8;
Array array = 9;
Map map = 10;
}
}

message TermSet {
repeated TermV2 set = 1;
}

message Array {
repeated TermV2 array = 1;
}

message Map {
repeated MapEntry entries = 1;
}

message MapEntry {
required MapKey key = 1;
required TermV2 value = 2;
}

message MapKey {
oneof Content {
int64 integer = 1;
uint64 string = 2;
}
}

message ExpressionV2 {
repeated Op ops = 1;
}
Expand All @@ -113,6 +139,7 @@ message Op {
TermV2 value = 1;
OpUnary unary = 2;
OpBinary Binary = 3;
OpClosure closure = 4;
}
}

Expand All @@ -121,9 +148,12 @@ message OpUnary {
Negate = 0;
Parens = 1;
Length = 2;
TypeOf = 3;
Ffi = 4;
}

required Kind kind = 1;
optional uint64 ffiName = 2;
}

message OpBinary {
Expand All @@ -149,9 +179,23 @@ message OpBinary {
BitwiseOr = 18;
BitwiseXor = 19;
NotEqual = 20;
HeterogeneousEqual = 21;
HeterogeneousNotEqual = 22;
LazyAnd = 23;
LazyOr = 24;
All = 25;
Any = 26;
Get = 27;
Ffi = 28;
}

required Kind kind = 1;
optional uint64 ffiName = 2;
}

message OpClosure {
repeated uint32 params = 1;
repeated Op ops = 2;
}

message Policy {
Expand All @@ -174,8 +218,10 @@ message AuthorizerPolicies {
}

message ThirdPartyBlockRequest {
required PublicKey previousKey = 1;
repeated PublicKey publicKeys = 2;
optional PublicKey legacyPreviousKey = 1;
repeated PublicKey legacyPublicKeys = 2;
required bytes previousSignature = 3;

}

message ThirdPartyBlockContents {
Expand Down Expand Up @@ -228,4 +274,4 @@ message SnapshotBlock {
repeated CheckV2 checks_v2 = 5;
repeated Scope scope = 6;
optional PublicKey externalKey = 7;
}
}