Documentation
¶
Overview ¶
Package keyreminder sends a scheduled notice when encryption keys are older than the operator's maximum key age policy.
Index ¶
Constants ¶
View Source
const DefaultInterval = 6 * time.Hour
DefaultInterval is how often the policy is checked, not how often a notice goes out.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Channels ¶
type Channels interface {
ListNotificationChannels(ctx context.Context) ([]alerting.NotificationChannel, error)
}
Channels lists notification channels. *alerting.DB satisfies it.
type Notifier ¶
type Notifier interface {
SendNotice(ctx context.Context, c alerting.NotificationChannel, text string) error
}
Notifier sends one plain-text notice. *alerting.DeployDispatcher satisfies it.
type Reminder ¶
type Reminder struct {
Source Source
Channels Channels
Notifier Notifier
Logger *slog.Logger
Now func() time.Time
}
Reminder notifies about keys past the policy's maximum age.
type Source ¶
type Source interface {
GetSecretKeyPolicy(ctx context.Context) (store.SecretKeyPolicy, error)
MarkSecretKeyReminded(ctx context.Context, at time.Time) error
ListServiceDEKStatus(ctx context.Context) ([]store.ServiceDEKStatus, error)
GetMasterKeyRotatedAt(ctx context.Context) (time.Time, bool, error)
}
Source is the store surface the reminder reads. *store.DB satisfies it.
Click to show internal directories.
Click to hide internal directories.