spiffeutil

package
v1.20210720.3 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// ErrInvalidURI is the class of error returned when parsing SPIFFE URI fails
	ErrInvalidURI = ex.Class("Invalid SPIFFE URI")
	// ErrNonKubernetesWorkload is class of error returned when parsing a SPIFFE
	// Kubernetes workload identifier fails.
	ErrNonKubernetesWorkload = ex.Class("Workload ID not in Kubernetes format")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KubernetesWorkload

type KubernetesWorkload struct {
	Namespace      string
	ServiceAccount string
}

KubernetesWorkload describes a Kubernetes workload identifier.

func ParseKubernetesWorkloadID

func ParseKubernetesWorkloadID(workloadID string) (*KubernetesWorkload, error)

ParseKubernetesWorkloadID parses a SPIFFE workload identifier that identifies Kubernetes service account, of the form `ns/{namespace}/sa/{serviceAccount}`.

type ParsedURI

type ParsedURI struct {
	TrustDomain string
	WorkloadID  string
}

ParsedURI represents a SPIFFE URI that has been parsed via `Parse()`.

func Parse

func Parse(uri string) (*ParsedURI, error)

Parse consumes a SPIFFE URI and splits out the trust domain and workload identifier. For example in `spiffe://cluster.local/ns/blend/sa/quasar` the trust domain is `cluster.local` and the workload identifier is `ns/blend/sa/quasar`.

Jump to

Keyboard shortcuts

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