Skip to main content

create_grant

Function create_grant 

Source
pub fn create_grant(
    current: &mut Murk,
    name: &str,
    agent_pubkey: &str,
    scope: &[String],
    issuer_pubkey: &str,
    issued_at: DateTime<Utc>,
    ttl: Duration,
) -> Result<GrantEntry, MurkError>
Expand description

Create an agent grant in the working state. The caller mints the ephemeral identity, adds agent_pubkey to the vault recipients, and registers its display name before calling this. Encrypts a private copy of each scope key’s shared value to the agent and records the grant metadata.

Errors if the name is invalid or already used, the scope is empty, or a scope key has no shared value the operator can read (e.g. an unknown key, or one that is group/scoped-only). Returns the recorded types::GrantEntry.