Documentation
¶
Index ¶
- type Arguments
- type Capability
- func (c *Capability[A]) Command() ucan.Command
- func (c *Capability[A]) Delegate(issuer ucan.Signer, audience did.DID, subject did.DID, ...) (*delegation.Delegation, error)
- func (c *Capability[A]) Invoke(issuer ucan.Signer, subject did.DID, arguments A, options ...invocation.Option) (*invocation.Invocation, error)
- func (c *Capability[A]) Match(inv ucan.Invocation, proofs map[cid.Cid]ucan.Delegation) (*capability.Match, error)
- func (c *Capability[A]) Policy() ucan.Policy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arguments ¶
type Arguments interface {
cbg.CBORMarshaler
cbg.CBORUnmarshaler
}
type Capability ¶
type Capability[A Arguments] struct { // contains filtered or unexported fields }
Capability that can be used to validate an invocation against proof policies.
func New ¶
func New[A Arguments](cmd ucan.Command, options ...capability.Option) (*Capability[A], error)
New creates a new capability definition that can be used to validate an invocation against proof policies.
func (*Capability[A]) Command ¶
func (c *Capability[A]) Command() ucan.Command
func (*Capability[A]) Delegate ¶
func (c *Capability[A]) Delegate(issuer ucan.Signer, audience did.DID, subject did.DID, options ...delegation.Option) (*delegation.Delegation, error)
func (*Capability[A]) Invoke ¶
func (c *Capability[A]) Invoke(issuer ucan.Signer, subject did.DID, arguments A, options ...invocation.Option) (*invocation.Invocation, error)
func (*Capability[A]) Match ¶
func (c *Capability[A]) Match(inv ucan.Invocation, proofs map[cid.Cid]ucan.Delegation) (*capability.Match, error)
Match an invocation against the capability, resulting in a match, which is the task from the invocation, verified to be matching with delegation policies.
Match also ensures the invocation arguments can be bound to the specified Arguments type A.
func (*Capability[A]) Policy ¶
func (c *Capability[A]) Policy() ucan.Policy
Click to show internal directories.
Click to hide internal directories.