proofs

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachingProofService

type CachingProofService struct {
	// contains filtered or unexported fields
}

func NewCachingProofService

func NewCachingProofService() *CachingProofService

func (*CachingProofService) RequestAccess

func (ps *CachingProofService) RequestAccess(
	ctx context.Context,
	issuer ucan.Signer,
	audience ucan.Principal,
	ability ucan.Ability,
	cause invocation.Invocation,
	options ...Option,
) (delegation.Delegation, error)

Request access to be granted from the service for the passed ability. A cached delegation may be returned if not expired.

type Option

type Option func(*requestConfig)

func WithConnection

func WithConnection(conn client.Connection) Option

WithConnection configures the connection to use for the request. If set, the HTTP client and service URL options are ignored.

func WithHTTPClient

func WithHTTPClient(h *http.Client) Option

WithHTTPClient configures a HTTP client to use in the request.

func WithMinimumTTL

func WithMinimumTTL(minTTL time.Duration) Option

WithMinimumTTL configures the minimum TTL a cached delegation should have.

func WithServiceURL

func WithServiceURL(url *url.URL) Option

WithServiceURL configures the URL of the service to request from. If not set it will be inferred from the service DID, if it is a did:web.

type ProofService

type ProofService interface {
	// Request access to be granted from the service for the passed ability.
	RequestAccess(
		ctx context.Context,
		issuer ucan.Signer,
		audience ucan.Principal,
		ability ucan.Ability,
		cause invocation.Invocation,
		options ...Option,
	) (delegation.Delegation, error)
}

ProofService requests proofs from other UCAN enabled nodes by making `access/grant` invocations.

Jump to

Keyboard shortcuts

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