Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/malcolmstill/biscuit-zig


https://github.com/malcolmstill/biscuit-zig

Last synced: 30 days ago
JSON representation

Awesome Lists containing this project

README

        

# 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

```zig
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

```zig
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);
```