Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 804 Bytes

README.md

File metadata and controls

38 lines (25 loc) · 804 Bytes

biscuit-zig

Warning

The implementation is WIP and should not be used in production

Zig implementation of https://www.biscuitsec.org/

Usage

Authorizing a token

var biscuit = try Biscuit.fromBytes(allocator, token, root_public_key);
defer biscuit.deinit();

var authorizer = try biscuit.authorizer();
defer authorizer.deinit();

var errors = std.ArrayList(AuthorizerError).init(allocator);
defer errors.deinit();

try authorizer.authorize(&errors);

Attenuating a token

var biscuit = try Biscuit.fromBytes(allocator, token, root_public_key);
defer biscuit.deinit();

var authorizer = try biscuit.authorizer();
defer authorizer.deinit();

var errors = std.ArrayList(AuthorizerError).init(allocator);
defer errors.deinit();

try authorizer.authorize(&errors);