credential

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCredentialUnavailable = errors.New("credential unavailable")

Functions

func RequestDigest added in v1.4.0

func RequestDigest(request Request) (string, error)

Types

type Broker

type Broker interface {
	Name() string
	Issue(Request) (Response, error)
}

func ResolveBroker

func ResolveBroker(name string, envPrefix string, command string, commandArgs []string) (Broker, error)

type CommandBroker

type CommandBroker struct {
	Command string
	Args    []string
	Timeout time.Duration
}

func (CommandBroker) Issue

func (b CommandBroker) Issue(request Request) (Response, error)

func (CommandBroker) Name

func (b CommandBroker) Name() string

type EnvBroker

type EnvBroker struct {
	Prefix string
}

func (EnvBroker) Issue

func (b EnvBroker) Issue(request Request) (Response, error)

func (EnvBroker) Name

func (b EnvBroker) Name() string

type Request

type Request struct {
	ToolName                                                                              string
	Identity                                                                              string
	Workspace                                                                             string
	SessionID                                                                             string
	RequestID                                                                             string
	RunID                                                                                 string
	JobID                                                                                 string
	Reference                                                                             string
	Scope                                                                                 []string
	TargetBinding                                                                         string
	ContractFamilyID, ContractID                                                          string
	ContractRevision                                                                      int
	ProposalDigest, ActivationDigest, PolicyDigest, ApprovalTokenDigest, DelegationDigest string
	ExpectedOutcome                                                                       string
	EffectScope, ContainmentScope                                                         []string
}

type Response

type Response struct {
	IssuedBy            string    `json:"issued_by"`
	Source              string    `json:"source,omitempty"`
	AccessType          string    `json:"access_type,omitempty"`
	Issuer              string    `json:"issuer,omitempty"`
	Subject             string    `json:"subject,omitempty"`
	Owner               string    `json:"owner,omitempty"`
	Scope               []string  `json:"scope,omitempty"`
	CredentialRef       string    `json:"credential_ref"`
	TargetBinding       string    `json:"target_binding,omitempty"`
	RunBinding          string    `json:"run_binding,omitempty"`
	JobBinding          string    `json:"job_binding,omitempty"`
	RequestDigest       string    `json:"request_digest,omitempty"`
	IssuedAt            time.Time `json:"issued_at,omitempty"`
	ExpiresAt           time.Time `json:"expires_at,omitempty"`
	TTLSeconds          int64     `json:"ttl_seconds,omitempty"`
	ContractFamilyID    string    `json:"contract_family_id,omitempty"`
	ContractID          string    `json:"contract_id,omitempty"`
	ContractRevision    int       `json:"contract_revision,omitempty"`
	ProposalDigest      string    `json:"proposal_digest,omitempty"`
	ActivationDigest    string    `json:"activation_digest,omitempty"`
	PolicyDigest        string    `json:"policy_digest,omitempty"`
	ApprovalTokenDigest string    `json:"approval_token_digest,omitempty"`
	DelegationDigest    string    `json:"delegation_digest,omitempty"`
	ExpectedOutcome     string    `json:"expected_outcome,omitempty"`
	EffectScope         []string  `json:"effect_scope,omitempty"`
	ContainmentScope    []string  `json:"containment_scope,omitempty"`
}

func Issue

func Issue(broker Broker, request Request) (Response, error)

func NormalizeProviderReceipt added in v1.4.0

func NormalizeProviderReceipt(provider string, payload []byte, request Request) (Response, error)

type StubBroker

type StubBroker struct{}

func (StubBroker) Issue

func (StubBroker) Issue(request Request) (Response, error)

func (StubBroker) Name

func (StubBroker) Name() string

Jump to

Keyboard shortcuts

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