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

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

Biscuit implementation for zig
https://github.com/malcolmstill/biscuit-zig

zig zig-package

Last synced: 5 months ago
JSON representation

Biscuit implementation for zig

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