svid

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2022 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DefaultRotatorInterval = 5 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Observer

type Observer interface {
	State() State
}

Observer is a convenience interface for subsystems that only want to observer the current SVID state but don't care about other rotator methods.

type ObserverFunc

type ObserverFunc func() State

func (ObserverFunc) State

func (fn ObserverFunc) State() State

type Rotator

type Rotator struct {
	// contains filtered or unexported fields
}

func NewRotator

func NewRotator(c *RotatorConfig) *Rotator

func (*Rotator) Initialize

func (r *Rotator) Initialize(ctx context.Context) error

Start generates a new SVID and then starts the rotator.

func (*Rotator) Interval added in v0.11.0

func (r *Rotator) Interval() time.Duration

func (*Rotator) Run

func (r *Rotator) Run(ctx context.Context) error

Run starts a ticker which monitors the server SVID for expiration and rotates the SVID as necessary.

func (*Rotator) State

func (r *Rotator) State() State

func (*Rotator) Subscribe

func (r *Rotator) Subscribe() observer.Stream

type RotatorConfig

type RotatorConfig struct {
	Log         logrus.FieldLogger
	Metrics     telemetry.Metrics
	TrustDomain spiffeid.TrustDomain
	ServerCA    ca.ServerCA
	Clock       clock.Clock
	KeyType     keymanager.KeyType

	// How long to wait between expiry checks
	Interval time.Duration
}

type State

type State struct {
	SVID []*x509.Certificate
	Key  crypto.Signer
}

State is the current SVID and key

Jump to

Keyboard shortcuts

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