Struct biscuit_auth::UnverifiedBiscuit
source · pub struct UnverifiedBiscuit { /* private fields */ }
Expand description
A token that was parsed without cryptographic signature verification
Use this if you want to attenuate or print the content of a token without verifying it.
It can be converted to a Biscuit using UnverifiedBiscuit::check_signature, and then used for authorization
Implementations§
source§impl UnverifiedBiscuit
impl UnverifiedBiscuit
sourcepub fn from_base64<T>(slice: T) -> Result<Self, Token>
pub fn from_base64<T>(slice: T) -> Result<Self, Token>
deserializes a token from base64
sourcepub fn check_signature<F>(self, f: F) -> Result<Biscuit, Format>
pub fn check_signature<F>(self, f: F) -> Result<Biscuit, Format>
checks the signature of the token and convert it to a Biscuit for authorization
sourcepub fn append(&self, block_builder: BlockBuilder) -> Result<Self, Token>
pub fn append(&self, block_builder: BlockBuilder) -> Result<Self, Token>
adds a new block to the token
since the public key is integrated into the token, the keypair can be discarded right after calling this function
sourcepub fn to_base64(&self) -> Result<String, Token>
pub fn to_base64(&self) -> Result<String, Token>
serializes the token and encode it to a (URL safe) base64 string
sourcepub fn from_with_symbols(
slice: &[u8],
symbols: SymbolTable
) -> Result<Self, Token>
pub fn from_with_symbols( slice: &[u8], symbols: SymbolTable ) -> Result<Self, Token>
deserializes from raw bytes with a custom symbol table
sourcepub fn from_base64_with_symbols<T>(
slice: T,
symbols: SymbolTable
) -> Result<Self, Token>
pub fn from_base64_with_symbols<T>( slice: T, symbols: SymbolTable ) -> Result<Self, Token>
deserializes a token from base64 with a custom symbol table
sourcepub fn append_with_keypair(
&self,
keypair: &KeyPair,
block_builder: BlockBuilder
) -> Result<Self, Token>
pub fn append_with_keypair( &self, keypair: &KeyPair, block_builder: BlockBuilder ) -> Result<Self, Token>
adds a new block to the token
since the public key is integrated into the token, the keypair can be discarded right after calling this function
sourcepub fn root_key_id(&self) -> Option<u32>
pub fn root_key_id(&self) -> Option<u32>
returns an (optional) root key identifier. It provides a hint for public key selection during verification
sourcepub fn revocation_identifiers(&self) -> Vec<Vec<u8>>
pub fn revocation_identifiers(&self) -> Vec<Vec<u8>>
returns a list of revocation identifiers for each block, in order
revocation identifiers are unique: tokens generated separately with the same contents will have different revocation ids
sourcepub fn external_public_keys(&self) -> Vec<Option<Vec<u8>>>
pub fn external_public_keys(&self) -> Vec<Option<Vec<u8>>>
returns a list of external key for each block, in order
Blocks carrying an external public key are third-party blocks and their contents can be trusted as coming from the holder of the corresponding private key
sourcepub fn block_count(&self) -> usize
pub fn block_count(&self) -> usize
returns the number of blocks (at least 1)
sourcepub fn print_block_source(&self, index: usize) -> Result<String, Token>
pub fn print_block_source(&self, index: usize) -> Result<String, Token>
prints the content of a block as Datalog source code
sourcepub fn seal(&self) -> Result<UnverifiedBiscuit, Token>
pub fn seal(&self) -> Result<UnverifiedBiscuit, Token>
creates a sealed version of the token
sealed tokens cannot be attenuated
pub fn third_party_request(&self) -> Result<ThirdPartyRequest, Token>
pub fn append_third_party(&self, slice: &[u8]) -> Result<Self, Token>
pub fn append_third_party_base64<T>(&self, slice: T) -> Result<Self, Token>
Trait Implementations§
source§impl Clone for UnverifiedBiscuit
impl Clone for UnverifiedBiscuit
source§fn clone(&self) -> UnverifiedBiscuit
fn clone(&self) -> UnverifiedBiscuit
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more