pub fn create_token(
subject: String,
resource: String,
operation: String,
key: KeyPair,
) -> Result<String, Box<dyn Error>>Expand description
Creates a biscuit token with default time configuration.
This function creates a base64-encoded token string that grants the specified operation on the 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 token
§Returns
Ok(String)- The base64-encoded token if successfulErr(Box<dyn Error>)- If token creation fails