Struct biscuit_wasm::Biscuit
source · [−]pub struct Biscuit(_);
Expand description
a Biscuit token
it can produce an attenuated or sealed token, or be used in an authorizer along with Datalog policies
Implementations
sourceimpl Biscuit
impl Biscuit
sourcepub fn builder() -> BiscuitBuilder
pub fn builder() -> BiscuitBuilder
Creates a BiscuitBuilder
the builder can then create a new token with a root key
sourcepub fn create_block(&self) -> BlockBuilder
pub fn create_block(&self) -> BlockBuilder
Creates a BlockBuilder to prepare for attenuation
the bulder can then be given to the token’s append method to create an attenuated token
sourcepub fn append(&self, block: BlockBuilder) -> Result<Biscuit, JsValue>
pub fn append(&self, block: BlockBuilder) -> Result<Biscuit, JsValue>
Creates an attenuated token by adding the block generated by the BlockBuilder
Creates an authorizer from the token
sourcepub fn seal(&self) -> Result<Biscuit, JsValue>
pub fn seal(&self) -> Result<Biscuit, JsValue>
Seals the token
A sealed token cannot be attenuated
sourcepub fn from_bytes(data: &[u8], root: &PublicKey) -> Result<Biscuit, JsValue>
pub fn from_bytes(data: &[u8], root: &PublicKey) -> Result<Biscuit, JsValue>
Deserializes a token from raw data
This will check the signature using the root key
sourcepub fn from_base64(data: &str, root: &PublicKey) -> Result<Biscuit, JsValue>
pub fn from_base64(data: &str, root: &PublicKey) -> Result<Biscuit, JsValue>
Deserializes a token from URL safe base 64 data
This will check the signature using the root key
sourcepub fn revocation_identifiers(&self) -> Box<[JsValue]>
pub fn revocation_identifiers(&self) -> Box<[JsValue]>
Returns the list of revocation identifiers, encoded as URL safe base 64
sourcepub fn block_count(&self) -> usize
pub fn block_count(&self) -> usize
Returns the number of blocks in the token
sourcepub fn block_source(&self, index: usize) -> Option<String>
pub fn block_source(&self, index: usize) -> Option<String>
Prints a block’s content as Datalog code
Trait Implementations
sourceimpl FromWasmAbi for Biscuit
impl FromWasmAbi for Biscuit
sourceimpl IntoWasmAbi for Biscuit
impl IntoWasmAbi for Biscuit
sourceimpl OptionFromWasmAbi for Biscuit
impl OptionFromWasmAbi for Biscuit
sourceimpl OptionIntoWasmAbi for Biscuit
impl OptionIntoWasmAbi for Biscuit
sourceimpl RefFromWasmAbi for Biscuit
impl RefFromWasmAbi for Biscuit
type Anchor = Ref<'static, Biscuit>
type Anchor = Ref<'static, Biscuit>
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous. Read moresourceunsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
sourceimpl RefMutFromWasmAbi for Biscuit
impl RefMutFromWasmAbi for Biscuit
Auto Trait Implementations
impl RefUnwindSafe for Biscuit
impl Send for Biscuit
impl Sync for Biscuit
impl Unpin for Biscuit
impl UnwindSafe for Biscuit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::Abi
sourcefn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
. Read more