Biscuit CLI
This package provides a Command Line Interface allowing to manipulate biscuit tokens.
Installation
You can install biscuit-cli with Cargo:
From source
Use
The executable carries contextual help, you can run biscuit help to list available commands, and biscuit help <command> to get help about a specific command.
All the commands support reading keys, datalog and tokens from various sources, such as files, options, or stdin.
All the commands can be used in a script, and the commands where you can provide datalog (generate, inspect and attenuate) can also be used in an interactive way,
where a text editor ($EDITOR) is started to let you input a datalog program from within a comfortable environment.
By default keys and biscuits are read and written as hex-encoded and base64-encoded strings, but the CLI supports working with raw bytes directly with dedicated flags.
Just make sure you don't leak sensitive information like private keys in your shell history
Here are a list of common use-cases:
Generate a key pair
> Generating
> Private
> Public
Generate a public key from a private key
> ed25519/2341bc530d8f074100734a41cc05cc82e4e2564eff61b0408f8e37a08f384767
Create a biscuit token
> En0KEwoFZmlsZTEYAiIICgYIBBICGAcSJAgAEiB-So8adTv5YLBK49I8MrK1JdrYLrFSiFqUkRkVsco9MhpAJzlkr2xHM4JSlFmph7c9UEJPqw_BCscMgkIasAjnXZT5BHpA58M1uo_4KUDbPZSJVtbF93P43X41W7aofjZXAiIiCiCScR0e_rBUa7VjxnKW4PT52ZjC3peMCrWOi1T0jgR0fw==
|
Inspect a biscuit token
By default, biscuit inspect only prints out the biscuit contents (datalog blocks, and revocation ids).
> Authority
> ==
> right();
>
> ==
> 526
>
> ==========
>
> π
> π
A public key can be provided to verify the biscuit signatures
> Authority
> ==
> right();
>
> ==
> 526
>
> ==========
>
> β
> π
An authorizer can be provided to check if the biscuit would be allowed in a given context (the command exits with a success code only if the signatures are verified and if the authorization suceeded).
If you want to use your text editor to type in the authorizer, you can use --authorize-interactive instead.
> Authority
> ==
> right();
>
> ==
> 526
>
> ==========
>
> β
> β
> Matched )
Attenuating a biscuit token
# this will create a new biscuit token with the provided block appended
> En0KEwoFZmlsZTEYAiIICgYIBBICGAcSJAgAEiBrhbrvPUXH9RPOzIwnLVyRWwcK64JQ97kBvz1hLJfjfBpAUmx4_6OBnLcbyt5p1tePgK0SCfIdLDMmhXxmyo_BnGOkKDkptpCuQMqEdFlGMcruRksDZ7eB08wROTQ8E5AFCRqhAQo3CgVxdWVyeQoRY2xpZW50X2lwX2FkZHJlc3MKCTEyNy4wLjAuMRgCMg4KDAoCCAgSBggJEgIYChIkCAASIL6EGw7TZQ-8sRa0RT1U0cW8mjN_GzoW0jwX_67I0zPCGkDL5ho8NPsZwskzJ86e31qR29grjcEQormtv7I3YoQy_I2aoZGNtlviX72FuBT85KlVxJtjOiLxCIOvJj4MVN0KIiIKIM6btYoZ-ONE2gKEJ2raR8Bck7SMBAUf2sK7Z8I7uM_D
Contribute
# CI ensures consistent formatting
# CI ensures that there are no outstanding clippy hints
Copyright - Licensing
Copyright 2021 ClΓ©ment Delafargue
Licensed under BSD-3-Clause