spireadmin

package
v1.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrServerAddressRequired         = errors.New("spire admin: server address is required")
	ErrServerSPIFFEIDRequired        = errors.New("spire admin: server SPIFFE ID is required")
	ErrDownstreamParentIDRequired    = errors.New("spire admin: downstream parent ID is required")
	ErrDownstreamSPIFFEIDRequired    = errors.New("spire admin: downstream spiffe_id is required")
	ErrDownstreamEntryEmptyResponse  = errors.New("spire admin: unexpected empty response creating downstream entry")
	ErrDownstreamEntryMissingStatus  = errors.New("spire admin: missing status in downstream entry response")
	ErrDownstreamEntryMissingPayload = errors.New("spire admin: downstream entry missing entry payload in response")
	ErrDownstreamEntryCreateFailed   = errors.New("spire admin: downstream entry create failed")
	ErrEmptySelector                 = errors.New("empty selector")
	ErrInvalidSelectorFormat         = errors.New("invalid selector format")
	ErrBundleClientUnavailable       = errors.New("spire admin: bundle client not initialized")
	ErrBundleEmpty                   = errors.New("spire admin: bundle contains no x509 authorities")
	ErrBundleEncodeFailed            = errors.New("spire admin: bundle encode failed")
	ErrDeleteEntryEmptyResult        = errors.New("spire admin: delete entry returned empty result")
	ErrDeleteEntryMissingStatus      = errors.New("spire admin: delete entry missing status in response")
	ErrDeleteEntryFailed             = errors.New("spire admin: delete entry failed")
)

Functions

func StatusCode

func StatusCode(err error) codes.Code

StatusCode extracts the gRPC status code from an error. Primarily used by callers to differentiate AlreadyExists results.

func ToProtoSelector

func ToProtoSelector(raw string) (*types.Selector, error)

toProtoSelector converts a selector string (type:value) to a proto selector.

Types

type Client

type Client interface {
	CreateJoinToken(ctx context.Context, params JoinTokenParams) (*JoinTokenResult, error)
	CreateDownstreamEntry(ctx context.Context, params DownstreamEntryParams) (*DownstreamEntryResult, error)
	FetchBundle(ctx context.Context) ([]byte, error)
	DeleteEntry(ctx context.Context, entryID string) error
	Close() error
}

Client exposes the subset of SPIRE administrative APIs required by ServiceRadar.

func New

func New(ctx context.Context, cfg Config) (Client, error)

New instantiates a SPIRE administrative client backed by the Workload API.

type Config

type Config struct {
	WorkloadSocket string
	ServerAddress  string
	ServerSPIFFEID string
	BundlePath     string // optional bundle path (unused, reserved for future)
}

Config captures the settings required to connect to the SPIRE server using the administrative API surface.

type DownstreamEntryParams

type DownstreamEntryParams struct {
	ParentID      string
	SpiffeID      string
	Selectors     []*types.Selector
	X509SVIDTTL   time.Duration
	JWTSVIDTTL    time.Duration
	Admin         bool
	StoreSVID     bool
	DNSNames      []string
	FederatesWith []string
}

DownstreamEntryParams captures the information required to create a downstream SPIRE server registration entry.

type DownstreamEntryResult

type DownstreamEntryResult struct {
	EntryID string
}

DownstreamEntryResult contains the identifier for the registration entry created (or located) on the SPIRE server.

type JoinTokenParams

type JoinTokenParams struct {
	AgentID string
	TTL     time.Duration
}

JoinTokenParams describes a join-token issuance request.

type JoinTokenResult

type JoinTokenResult struct {
	Token    string
	Expires  time.Time
	ParentID string
}

JoinTokenResult contains the material returned from the SPIRE server after issuing a join token.

Jump to

Keyboard shortcuts

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