pub fn create_biscuit(
subject: String,
resource: String,
operation: String,
key: KeyPair,
time_config: TokenTimeConfig,
) -> Result<Vec<u8>, Box<dyn Error>>Expand description
Creates a new biscuit token with the specified subject and resource.
This function creates a token that grants read and write access to the specified resource for the given subject. The token will be valid for 5 minutes by default.
§Arguments
subject- The subject (user) identifierresource- The resource identifier to grant access tooperation- The operation to grant access tokey- The key pair used to sign the tokentime_config- Optional time configuration for token validity
§Returns
Ok(Vec<u8>)- The binary token data if successfulErr(Box<dyn Error>)- If token creation fails