credential

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

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
	Reference string
	Scope     []string
}

type Response

type Response struct {
	IssuedBy      string    `json:"issued_by"`
	CredentialRef string    `json:"credential_ref"`
	IssuedAt      time.Time `json:"issued_at,omitempty"`
	ExpiresAt     time.Time `json:"expires_at,omitempty"`
	TTLSeconds    int64     `json:"ttl_seconds,omitempty"`
}

func Issue

func Issue(broker Broker, 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