access

package
v0.0.0-...-eb26d87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InvalidAccessConfirmSubjectErrorName = "InvalidAccessConfirmSubject"
	InvalidAccessConfirmIssuerErrorName  = "InvalidAccessConfirmIssuer"
)
View Source
const (
	DelegationNotFoundErrorName  = "DelegationNotFound"
	InsufficientStorageErrorName = "InsufficientStorage"
)
View Source
const (
	UnknownAbilityErrorName    = "UnknownAbility"
	MissingCapabilityErrorName = "MissingCapability"
	UnknownCauseErrorName      = "UnknownCause"
	MissingCauseErrorName      = "MissingCause"
	InvalidCauseErrorName      = "InvalidCause"
	UnauthorizedCauseErrorName = "UnauthorizedCause"
)
View Source
const (
	InvalidAuthorizationAccountErrorName  = "InvalidAuthorizationAccount"
	InvalidAuthorizationAudienceErrorName = "InvalidAuthorizationAudience"
)
View Source
const ConfirmMetaKey = "accessConfirm"

ConfirmMetaKey is the key in metadata in any delegation created by a successful access request. The value is a link back to the `/access/confirm` invocation.

View Source
const GrantCommand = "/access/grant"
View Source
const RequestMetaKey = "accessRequest"

RequestFactKey is the key in metadata in any delegation created by a successful access request. The value is a link back to the `/access/request` invocation.

Variables

View Source
var (
	ErrInvalidAccessConfirmSubject = errors.New(InvalidAccessConfirmSubjectErrorName, "the subject of an access confirm invocation must be the service itself")
	ErrInvalidAccessConfirmIssuer  = errors.New(InvalidAccessConfirmIssuerErrorName, "the issuer of an access confirm invocation must be a valid mailto DID")
)
View Source
var (
	ErrMissingCapability = errors.New(MissingCapabilityErrorName, "grant requires one or more capabilities")
	ErrMissingCause      = errors.New(MissingCauseErrorName, "grant requires a supporting contextual invocation")
	ErrUnknownCause      = errors.New(UnknownCauseErrorName, "unknown cause invocation")
)
View Source
var Claim = binding.Bind[*ClaimArguments, *ClaimOK](command.MustParse("/access/claim"))

Claim can be invoked by an agent to claim a set of delegations from the account.

View Source
var Confirm = binding.Bind[*ConfirmArguments, *ConfirmOK](command.MustParse("/access/confirm"))

Confirm can be invoked by an agent to confirm an access request.

View Source
var Delegate = binding.Bind[*DelegateArguments, *DelegateOK](command.MustParse("/access/delegate"))

Delegate can be invoked by an agent to delegate a set of capabilities that may be subsequently claimed by another agent.

Grant can be invoked by an agent to request that a set of capabilities be granted directly. Unlike Request -> Confirm, Grant is one-shot: the executor decides immediately whether to issue the delegation.

View Source
var Request = binding.Bind[*RequestArguments, *RequestOK](command.MustParse("/access/request"))

Request can be invoked by an agent to request set of capabilities from the account.

Functions

This section is empty.

Types

type CapabilityRequest

type CapabilityRequest struct {
	Command ucan.Command `cborgen:"cmd" dagjsongen:"cmd"`
}

func (*CapabilityRequest) MarshalCBOR

func (t *CapabilityRequest) MarshalCBOR(w io.Writer) error

func (*CapabilityRequest) MarshalDagJSON

func (t *CapabilityRequest) MarshalDagJSON(w io.Writer) error

func (*CapabilityRequest) UnmarshalCBOR

func (t *CapabilityRequest) UnmarshalCBOR(r io.Reader) (err error)

func (*CapabilityRequest) UnmarshalDagJSON

func (t *CapabilityRequest) UnmarshalDagJSON(r io.Reader) (err error)

type ClaimArguments

type ClaimArguments = commands.Unit

type ClaimOK

type ClaimOK struct {
	// Delegations is a list of the CIDs of delegations granted for the request.
	Delegations []cid.Cid `cborgen:"delegations" dagjsongen:"delegations"`
}

func (*ClaimOK) MarshalCBOR

func (t *ClaimOK) MarshalCBOR(w io.Writer) error

func (*ClaimOK) MarshalDagJSON

func (t *ClaimOK) MarshalDagJSON(w io.Writer) error

func (*ClaimOK) UnmarshalCBOR

func (t *ClaimOK) UnmarshalCBOR(r io.Reader) (err error)

func (*ClaimOK) UnmarshalDagJSON

func (t *ClaimOK) UnmarshalDagJSON(r io.Reader) (err error)

type ConfirmArguments

type ConfirmArguments struct {
	Cause        cid.Cid             `cborgen:"cause" dagjsongen:"cause"`
	Issuer       did.DID             `cborgen:"iss" dagjsongen:"iss"`
	Audience     did.DID             `cborgen:"aud" dagjsongen:"aud"`
	Attenuations []CapabilityRequest `cborgen:"att" dagjsongen:"att"`
}

func (*ConfirmArguments) MarshalCBOR

func (t *ConfirmArguments) MarshalCBOR(w io.Writer) error

func (*ConfirmArguments) MarshalDagJSON

func (t *ConfirmArguments) MarshalDagJSON(w io.Writer) error

func (*ConfirmArguments) UnmarshalCBOR

func (t *ConfirmArguments) UnmarshalCBOR(r io.Reader) (err error)

func (*ConfirmArguments) UnmarshalDagJSON

func (t *ConfirmArguments) UnmarshalDagJSON(r io.Reader) (err error)

type ConfirmOK

type ConfirmOK = ClaimOK

ConfirmOK mirrors ClaimOK — confirming an access request grants the same shape of delegations bundle as claiming them.

type DelegateArguments

type DelegateArguments struct {
	// The delegations to store.
	Delegations []cid.Cid `cborgen:"delegations" dagjsongen:"delegations"`
}

func (*DelegateArguments) MarshalCBOR

func (t *DelegateArguments) MarshalCBOR(w io.Writer) error

func (*DelegateArguments) MarshalDagJSON

func (t *DelegateArguments) MarshalDagJSON(w io.Writer) error

func (*DelegateArguments) UnmarshalCBOR

func (t *DelegateArguments) UnmarshalCBOR(r io.Reader) (err error)

func (*DelegateArguments) UnmarshalDagJSON

func (t *DelegateArguments) UnmarshalDagJSON(r io.Reader) (err error)

type DelegateOK

type DelegateOK = commands.Unit

type GrantArguments

type GrantArguments struct {
	// Attenuations are the capabilities the agent wishes to be granted.
	Attenuations []CapabilityRequest `cborgen:"att" dagjsongen:"att"`
	// Cause optionally links to a UCAN invocation that contextualizes the
	// grant request. Leave nil when no cause is needed; otherwise the
	// linked invocation MUST be present in the request container.
	Cause *cid.Cid `cborgen:"cause,omitempty" dagjsongen:"cause,omitempty"`
}

func (*GrantArguments) MarshalCBOR

func (t *GrantArguments) MarshalCBOR(w io.Writer) error

func (*GrantArguments) MarshalDagJSON

func (t *GrantArguments) MarshalDagJSON(w io.Writer) error

func (*GrantArguments) UnmarshalCBOR

func (t *GrantArguments) UnmarshalCBOR(r io.Reader) (err error)

func (*GrantArguments) UnmarshalDagJSON

func (t *GrantArguments) UnmarshalDagJSON(r io.Reader) (err error)

type GrantOK

type GrantOK = ClaimOK

GrantOK mirrors ClaimOK / ConfirmOK: a successful grant resolves into a bundle of delegation CIDs. The actual delegation envelopes ride in the receipt response container as metadata.

type RequestArguments

type RequestArguments struct {
	// DID of the Account authorization is requested from.
	Issuer did.DID `cborgen:"iss" dagjsongen:"iss"`
	// Capabilities agent wishes to be granted.
	Attenuations []CapabilityRequest `cborgen:"att" dagjsongen:"att"`
}

func (*RequestArguments) MarshalCBOR

func (t *RequestArguments) MarshalCBOR(w io.Writer) error

func (*RequestArguments) MarshalDagJSON

func (t *RequestArguments) MarshalDagJSON(w io.Writer) error

func (*RequestArguments) UnmarshalCBOR

func (t *RequestArguments) UnmarshalCBOR(r io.Reader) (err error)

func (*RequestArguments) UnmarshalDagJSON

func (t *RequestArguments) UnmarshalDagJSON(r io.Reader) (err error)

type RequestOK

type RequestOK struct {
	// Request is a link to the access request invocation.
	Request cid.Cid `cborgen:"req" dagjsongen:"req"`
	// Confirm is the task that will confirm the access request.
	Confirm promise.AwaitOK `cborgen:"confirm" dagjsongen:"confirm"`
	// Expiration is the time at which the confirmation will expire.
	Expiration int64 `cborgen:"exp" dagjsongen:"exp"`
}

func (*RequestOK) MarshalCBOR

func (t *RequestOK) MarshalCBOR(w io.Writer) error

func (*RequestOK) MarshalDagJSON

func (t *RequestOK) MarshalDagJSON(w io.Writer) error

func (*RequestOK) UnmarshalCBOR

func (t *RequestOK) UnmarshalCBOR(r io.Reader) (err error)

func (*RequestOK) UnmarshalDagJSON

func (t *RequestOK) UnmarshalDagJSON(r io.Reader) (err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL