Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProofChain ¶
func ProofChain(ctx context.Context, matchDelegations DelegationMatcherFunc, aud did.DID, cmd ucan.Command, sub did.DID) ([]ucan.Delegation, []cid.Cid, error)
ProofChain recursively builds a proof chain of delegations from the given audience to the given subject for the specified command. It returns the list of delegations and their corresponding links in the order required for invocation. i.e. starting from the root Delegation (issued by the Subject), in strict sequence where the aud of the previous Delegation matches the iss of the next Delegation.
Types ¶
type ContainerProofStore ¶
type ContainerProofStore struct {
// contains filtered or unexported fields
}
ContainerProofStore is a proof store backed by an in-memory container.
func NewContainerProofStore ¶
func NewContainerProofStore(ct ucan.Container) *ContainerProofStore
NewContainerProofStore creates a proof store backed by an in-memory container.
type DelegationListerFunc ¶
type DelegationListerFunc func(ctx context.Context, aud did.DID, cmd ucan.Command, sub did.DID) iter.Seq2[ucan.Delegation, error]
DelegationListerFunc lists delegations for the given audience, command, and subject. It differs from DelegationMatcherFunc in that it only retrieves delegations for the EXACT audience, command and subject.
Note: the subject parameter MAY be did.Undef to indicate powerline.
type DelegationMatcherFunc ¶
type DelegationMatcherFunc func(ctx context.Context, aud did.DID, cmd ucan.Command, sub did.DID) iter.Seq2[ucan.Delegation, error]
DelegationMatcherFunc finds all delegations matching the given audience, command, and subject.
The subject parameter MUST not be did.Undef, but matching delegations MAY include powerline delegations (with did.Undef subject) and delegations where command is a matching parent of the passed command e.g. if passed command is "/read/file", delegations with command "/read", and "/" may be returned.
func NewDelegationMatcher ¶
func NewDelegationMatcher(listDelegations DelegationListerFunc) DelegationMatcherFunc
NewDelegationMatcher creates a simple delegation matcher that queries the passed finder to retrieve delegations matching the given audience, command, and subject.
type ProofStore ¶
type ProofStore interface {
// ProofChain recursively builds a proof chain of delegations from the given
// audience to the given subject for the specified command. It returns the
// list of delegations and their corresponding links in the order required for
// invocation. i.e. starting from the root Delegation (issued by the Subject),
// in strict sequence where the aud of the previous Delegation matches the iss
// of the next Delegation.
ProofChain(ctx context.Context, aud did.DID, cmd ucan.Command, sub did.DID) ([]ucan.Delegation, []cid.Cid, error)
}