create_multi_party_biscuit

Function create_multi_party_biscuit 

Source
pub fn create_multi_party_biscuit(
    subject: String,
    resource: String,
    operation: String,
    key: KeyPair,
    multi_party_nodes: &Vec<ServiceNode>,
) -> Result<Vec<u8>, Box<dyn Error>>
Expand description

Creates a new biscuit token with multi-party attestations.

This function creates a token that grants access to the specified resource for the given subject, includes attestations for each multi-party node in the chain. The token will be valid for 5 minutes by default.

The key difference between a multi-party biscuit and a service chain biscuit is that a multi-party biscuit is not valid until it has been attested by all the parties.

§Arguments

  • subject - The subject (user) identifier
  • resource - The resource identifier to grant access to
  • operation - The operation to grant access to
  • key - The key pair used to sign the token
  • multi_party_nodes - Vector of multi-party nodes that will attest to the token

§Returns

  • Ok(Vec<u8>) - The binary token data if successful
  • Err(Box<dyn Error>) - If token creation fails