Enum hdk::prelude::capability::CapGrant[][src]

pub enum CapGrant {
    ChainAuthor(HoloHash<Agent>),
    RemoteAgent(ZomeCallCapGrant),
}

Represents a potentially valid access grant to a zome call. Zome call response will be Unauthorized without a valid grant.

The CapGrant is not always a dedicated entry in the chain. Notably AgentPubKey entries in the current chain act like root access to local zome calls.

A CapGrant is valid if it matches the function, agent and secret for a given zome call.

See .is_valid()

Variants

ChainAuthor(HoloHash<Agent>)

Grants the capability of calling every extern to the calling agent, provided the calling agent is the local chain author. This grant is compared to the current Entry::Agent entry on the source chain.

RemoteAgent(ZomeCallCapGrant)

Any agent other than the chain author is attempting to call an extern. The pubkey of the calling agent is secured by the cryptographic handshake at the network layer and the caller must provide a secret that we check for in a private entry in the local chain.

Implementations

impl CapGrant[src]

pub fn is_valid(
    &self,
    check_function: &(ZomeName, FunctionName),
    check_agent: &HoloHash<Agent>,
    check_secret: Option<&CapSecret>
) -> bool
[src]

Given a grant, is it valid in isolation? In a world of CRUD, some new entry might update or delete an existing one, but we can check if a grant is valid in a standalone way.

Trait Implementations

impl Clone for CapGrant[src]

impl Debug for CapGrant[src]

impl<'de> Deserialize<'de> for CapGrant[src]

impl Eq for CapGrant[src]

impl From<HoloHash<Agent>> for CapGrant[src]

impl From<ZomeCallCapGrant> for CapGrant[src]

pub fn from(zccg: ZomeCallCapGrant) -> CapGrant[src]

Create a new ZomeCall capability grant

impl PartialEq<CapGrant> for CapGrant[src]

impl Serialize for CapGrant[src]

impl StructuralEq for CapGrant[src]

impl StructuralPartialEq for CapGrant[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,