create_multi_party_token

Function create_multi_party_token 

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

Creates a new multi-party biscuit token with default time configuration.

This function creates a token that grants access to the specified resource for the given subject, includes attestations for each multi-party node, and uses the default time configuration (5 minutes).

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(String) - The base64-encoded token if successful
  • Err(Box<dyn Error>) - If token creation fails