credentials

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package credentials defines the provisioner surface used by runtimes to mint lease-bound credentials for accepted jobs.

Index

Constants

This section is empty.

Variables

View Source
var BudgetExhausted = arcp.ErrBudgetExhausted

BudgetExhausted maps upstream per-credential budget exhaustion to the ARCP boundary error.

View Source
var ErrNoRevocation = arcp.Newf(arcp.CodeInternalError, "provisioner lacks durable revocation path")

ErrNoRevocation signals that a provisioner cannot provide a revocation path acceptable for provisioned_credentials.

Functions

This section is empty.

Types

type IssueRequest

type IssueRequest struct {
	JobID       string
	Principal   string
	Agent       string
	Lease       arcp.Lease
	Budget      map[arcp.Currency]float64
	ExpiresAt   *time.Time
	ParentJobID string
}

IssueRequest carries the finalized job lease and context a provisioner needs to mint scoped upstream credentials.

type Memory

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

Memory is a deterministic in-memory Provisioner for tests, examples, and local development.

func NewMemory

func NewMemory(prefix string) *Memory

NewMemory returns an in-memory provisioner whose credential IDs are prefix + counter.

func (*Memory) Issue

func (m *Memory) Issue(_ context.Context, req IssueRequest) ([]messages.Credential, error)

Issue returns one bearer credential scoped to req's budget, model, and expiration constraints.

func (*Memory) Issued

func (m *Memory) Issued() []IssueRequest

Issued returns a snapshot of issue requests.

func (*Memory) Outstanding

func (m *Memory) Outstanding() int

Outstanding returns the number of credentials not yet revoked.

func (*Memory) Revoke

func (m *Memory) Revoke(_ context.Context, credentialID string) error

Revoke removes credentialID from the outstanding set. It is idempotent so terminal cleanup can retry safely.

func (*Memory) Revoked

func (m *Memory) Revoked() []string

Revoked returns credential IDs passed to Revoke in call order.

type Provisioner

type Provisioner interface {
	Issue(ctx context.Context, req IssueRequest) ([]messages.Credential, error)
	Revoke(ctx context.Context, credentialID string) error
}

Provisioner issues credentials after job acceptance and revokes them when the job reaches a terminal state.

Jump to

Keyboard shortcuts

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