Help us shape the future of Go! Take the 2026 Go Developer Survey

broker

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Interface

	// Close closes the connection to the Broker endpoint.
	Close() error
}

Client is a SPIFFE Broker API client that also owns its connection.

func New

func New(endpoint string, brokerIDs []string, source spiffe.TLSSource) (Client, error)

New returns a client for the SPIFFE Broker API at endpoint. The endpoint must be a TCP gRPC target, e.g. dns:///spire-server.spire.svc.cluster.local:443. A target without a scheme is resolved with the dns resolver so that headless Kubernetes Services can be load-balanced across endpoints.

The connection authenticates with the X.509-SVID from source and authorizes the Broker endpoint with any of brokerIDs. Each ID may be an exact SPIFFE ID or an ID prefix, as parsed by cryptov1.ParseSPIFFEID.

type Interface

type Interface interface {
	// FetchJWTSVID fetches a JWT-SVID for ref and the given audiences from the
	// Broker. The first returned JWT-SVID is used.
	FetchJWTSVID(ctx context.Context, ref KubernetesObjectReference, audiences []string) (*jwtsvid.SVID, error)
}

Interface provides the operations used to acquire JWT-SVIDs from the SPIFFE Broker API.

type KubernetesObjectReference

type KubernetesObjectReference struct {
	Group     string
	Kind      string
	Namespace string
	Name      string
	UID       string
}

KubernetesObjectReference identifies a Kubernetes object for the SPIFFE Broker API. Group is the API group of the object, with an empty value normalized to "core" for core resources.

Kind is the singular CRD kind, e.g. "OCIRepository". The Broker API resource plural is derived from Kind using the same library and rules as controller-gen. At least one of Name or UID must be set.

Jump to

Keyboard shortcuts

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