Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
53f5bd8
3rd party: Update protobuf schema
divarvel Jun 15, 2022
41e6fa2
3rd party: verify third party signatures
divarvel Jun 15, 2022
130a3f9
update samples
Geal Jun 22, 2025
574069e
convert the SymbolTable to a struct
Geal Jun 22, 2025
80e583f
start setting up scopes
Geal Jun 22, 2025
213a6af
cryptographic interfaces
Geal Jun 22, 2025
0ab792b
schema update
Geal Jun 22, 2025
6eeb162
SerializedBiscuit type
Geal Jun 22, 2025
1c1fb1f
remove V2 suffix after schema update
Geal Jul 6, 2025
f2260b4
convert the the PublicKey and PrivateKey interfaces
Geal Jul 12, 2025
30a3cf0
cleanup
Geal Jul 12, 2025
750fbbb
wip scopes implementation
Geal Jul 13, 2025
bc92120
fix samples deserialization
Geal Jul 13, 2025
125844e
fix worl printing in samples
Geal Jul 14, 2025
e277b92
pass the scope tests
Geal Jul 14, 2025
b690b16
fix printing
Geal Jul 14, 2025
ec3a814
changing Set syntax
Geal Jul 14, 2025
a077026
fix fact set merging
Geal Jul 14, 2025
0f2fd40
fix set sprinting
Geal Jul 14, 2025
f92478a
block version check
Geal Oct 4, 2025
0f51e94
start support for strict equality and update set syntax
Geal Jan 25, 2026
07ba753
Handle version 3.1 serialization
Geal Jan 25, 2026
a90cbcd
handle null check kind
Geal Jan 25, 2026
9d1e42b
parse empty sets
Geal Jan 25, 2026
8d575ff
parse strict equal and not equal
Geal Jan 25, 2026
b6cc01d
parser fixes
Geal Jan 25, 2026
7f241bb
fix EmptySet capture
Geal Jan 26, 2026
f41830d
missing conversions
Geal Jan 26, 2026
0984f8c
handle empty set serialization
Geal Jan 26, 2026
3eea376
rule head variable validation
Geal Jan 28, 2026
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
445 changes: 234 additions & 211 deletions authorizer.go

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions authorizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package biscuit

import (
"crypto/ed25519"
"crypto/rand"
"testing"

Expand All @@ -13,7 +12,7 @@ import (

func TestVerifierDefaultPolicy(t *testing.T) {
rng := rand.Reader
publicRoot, privateRoot, _ := ed25519.GenerateKey(rng)
publicRoot, privateRoot, _ := NewEd25519KeyPair(rng)

builder := NewBuilder(privateRoot)
err := builder.AddAuthorityFact(Fact{Predicate{
Expand Down Expand Up @@ -42,7 +41,7 @@ func TestVerifierDefaultPolicy(t *testing.T) {

func TestVerifierPolicies(t *testing.T) {
rng := rand.Reader
publicRoot, privateRoot, _ := ed25519.GenerateKey(rng)
publicRoot, privateRoot, _ := NewEd25519KeyPair(rng)

builder := NewBuilder(privateRoot)
err := builder.AddAuthorityRule(Rule{
Expand Down Expand Up @@ -104,7 +103,7 @@ func TestVerifierPolicies(t *testing.T) {

func TestVerifierSerializeLoad(t *testing.T) {
rng := rand.Reader
publicRoot, privateRoot, _ := ed25519.GenerateKey(rng)
publicRoot, privateRoot, _ := NewEd25519KeyPair(rng)

builder := NewBuilder(privateRoot)
b, err := builder.Build()
Expand Down Expand Up @@ -150,16 +149,16 @@ func TestVerifierSerializeLoad(t *testing.T) {

v1.AddFact(fact1)
v1.AddFact(fact2)
v1.AddRule(rule1)
require.NoError(t, v1.AddRule(rule1))
v1.AddCheck(check1)
v1.AddPolicy(policy)
s, err := v1.SerializePolicies()
require.NoError(t, err)
// s, err := v1.SerializePolicies()
// require.NoError(t, err)

v2, err := b.Authorizer(publicRoot)
require.NoError(t, err)

require.NoError(t, v2.LoadPolicies(s))
// require.NoError(t, v2.LoadPolicies(s))

require.Equal(t, v1.(*authorizer).world.Facts(), v2.(*authorizer).world.Facts())
require.Equal(t, v1.(*authorizer).world.Rules(), v2.(*authorizer).world.Rules())
Expand Down
Loading