Generate VAPID key pair during startup

This commit is contained in:
Vyr Cossont 2024-11-23 20:32:55 -08:00
commit 821c1da688
4 changed files with 59 additions and 25 deletions

View file

@ -68,9 +68,13 @@ type Admin interface {
// the number of pending sign-ups sitting in the backlog.
CountUnhandledSignups(ctx context.Context) (int, error)
// GetOrCreateVAPIDKeyPair creates and stores a VAPID key pair,
// or retrieves the existing VAPID key pair.
GetOrCreateVAPIDKeyPair(ctx context.Context) (*gtsmodel.VAPIDKeyPair, error)
// GetVAPIDKeyPair retrieves the existing VAPID key pair, if there is one.
// If there isn't, it returns nil.
GetVAPIDKeyPair(ctx context.Context) (*gtsmodel.VAPIDKeyPair, error)
// PutVAPIDKeyPair stores a VAPID key pair.
// This should be called at most once, during server startup.
PutVAPIDKeyPair(ctx context.Context, vapidKeyPair *gtsmodel.VAPIDKeyPair) error
/*
ACTION FUNCS