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
- Host: GitHub
- URL: https://github.com/malcolmstill/biscuit-zig
- Owner: malcolmstill
- License: apache-2.0
- Created: 2023-09-27T23:45:58.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-12T00:55:54.000Z (about 2 years ago)
- Last Synced: 2025-10-10T12:48:58.257Z (8 months ago)
- Topics: zig, zig-package
- Language: Zig
- Homepage:
- Size: 140 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
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);
```