Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/malcolmstill/biscuit-zig
https://github.com/malcolmstill/biscuit-zig
Last synced: 30 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/malcolmstill/biscuit-zig
- Owner: malcolmstill
- License: apache-2.0
- Created: 2023-09-27T23:45:58.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-12T00:55:54.000Z (5 months ago)
- Last Synced: 2024-06-12T09:08:56.877Z (5 months ago)
- Language: Zig
- Size: 140 KB
- Stars: 0
- 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 productionZig 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);
```