Expand description
§Meadowcap
An implementation of Meadowcap, a capability system for permissioning read and write access to the Willow data model.
Includes implementations of communal capabilities, owned capabilities, a type unifying the two, as well as the generation of McAuthorisationTokens
for use with the Willow data model’s is_authorised_write
parameter.
§Type parameters
Willow is a parametrised family of protocols, and so this crate makes heavy use of generic parameters.
The following generic parameter names are used consistently across this crate:
MCL
- Ausize
representingmax_component_length
.MCC
- Ausize
representingmax_component_count
.MPL
- Ausize
representingmax_path_length
.NamespacePublicKey
- The type used forNamespacePublicKey
(willowprotocol.org), must implement thewillow_data_model::NamespaceId
trait.NamespaceSignature
- The type used forNamespaceSignature
(willowprotocol.org).UserPublicKey
- The type used forUserPublicKey
(willowprotocol.org), must implement theSubspaceId
trait.UserSignature
- The type used forUserSignature
(willowprotocol.org).PD
- The type used forPayloadDigest
(willowprotocol.org), must implement thewillow_data_model::PayloadDigest
trait.
Structs§
- Communal
Capability - A capability which implements communal namespaces.
- Communal
Handover - Can be encoded to a bytestring to be signed for a new
Delegation
to aCommunalCapability
. - Delegation
- A delegation of access rights to a user for a given area.
- McAuthorisation
Token - To be used as the
AuthorisationToken
parameter for the Willow data model. - McSubspace
Capability - A capability that certifies read access to arbitrary SubspaceIds at some unspecified non-empty
willow_data_model::Path
. - Namespace
IsNot Communal Error - Returned when
is_communal
unexpectedly mapped a givennamespace
tofalse
. - NotA
Write Capability Error - Returned when an operation only applicable to a capability with access mode
AccessMode::Write
was called on a capability with access modeAccessMode::Read
. - Owned
Capability - A capability that implements owned namespaces.
- Owned
Handover - Can be encoded to a bytestring to be signed for a new
Delegation
to anOwnedCapability
. - Personal
Private Interest - Subspace
Delegation - A delegation of read access for arbitrary
SubspaceId
s to aUserPublicKey
.
Enums§
- Access
Mode - A mode granting read or write access to some
Area
. - Failed
Delegation Error - Returned when an attempt to delegate a capability to another
UserPublicKey
failed. - Invalid
Delegation Error - Returned when an existing delegation was an invalid successor to an existing delegation chain.
- McCapability
- A Meadowcap capability.
- Owned
Capability Creation Error - Returned when an attempt to create a new owned capability failed.
Traits§
- IsCommunal
- Maps namespace public keys to booleans, determining whether that namespace of a particular
willow_data_model::NamespaceId
is communal or owned. - McNamespace
Public Key - An extension of
NamespaceId
augmented with traits required by Meadowcap. - McPublic
User Key - An extension of
SubspaceId
augmented with traits required by Meadowcap.