rotation

package
v0.0.0-...-b180f38 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RotationConfig

type RotationConfig struct {
	Interval          time.Duration
	MaxKeyAge         time.Duration
	EmergencyRotation bool
	Algorithms        []string
}

type RotationPolicy

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

func NewRotationPolicy

func NewRotationPolicy(
	keyStore *keystore.HSMKeyStore,
	metrics *metrics.QuantumStorageMetrics,
	tracer tracing.Tracer,
	config RotationConfig,
) *RotationPolicy

func (*RotationPolicy) EmergencyRotation

func (r *RotationPolicy) EmergencyRotation(ctx context.Context, keyID string) error

func (*RotationPolicy) Start

func (r *RotationPolicy) Start(ctx context.Context) error

func (*RotationPolicy) Stop

func (r *RotationPolicy) Stop()

type RotationSchedule

type RotationSchedule struct {
	ID           string
	KeyPattern   string
	CronExpr     string
	MaxAge       time.Duration
	LastRotation time.Time
	Status       ScheduleStatus
	Metadata     map[string]string
	CronID       cron.EntryID
}

type RotationScheduler

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

func NewRotationScheduler

func NewRotationScheduler(
	policy *RotationPolicy,
	keyStore *keystore.HSMKeyStore,
	metrics *metrics.QuantumStorageMetrics,
	tracer tracing.Tracer,
) *RotationScheduler

func (*RotationScheduler) AddSchedule

func (rs *RotationScheduler) AddSchedule(ctx context.Context, schedule *RotationSchedule) error

func (*RotationScheduler) Start

func (rs *RotationScheduler) Start()

func (*RotationScheduler) Stop

func (rs *RotationScheduler) Stop()

type ScheduleStatus

type ScheduleStatus string
const (
	ScheduleStatusActive   ScheduleStatus = "active"
	ScheduleStatusInactive ScheduleStatus = "inactive"
	ScheduleStatusError    ScheduleStatus = "error"
)

Jump to

Keyboard shortcuts

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