bootstrap

package
v0.1.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: May 10, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package bootstrap implements first-boot setup-token handling.

Index

Constants

View Source
const SetupTokenTTL = 24 * time.Hour

Variables

View Source
var (
	ErrBootstrapUnavailable = errors.New("bootstrap unavailable")
	ErrInvalidSetupToken    = errors.New("invalid setup token")
)

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService(db *sql.DB, logger *slog.Logger) *Service

func (*Service) CreateFirstInstanceAdmin

func (s *Service) CreateFirstInstanceAdmin(ctx context.Context, setupTokenID uuid.UUID, email, displayName string) (uuid.UUID, error)

func (*Service) CreateFirstInstanceAdminWithID

func (s *Service) CreateFirstInstanceAdminWithID(ctx context.Context, adminID, setupTokenID uuid.UUID, email, displayName string) (uuid.UUID, error)

func (*Service) IsFirstBoot

func (s *Service) IsFirstBoot(ctx context.Context) (bool, error)

func (*Service) MintSetupToken

func (s *Service) MintSetupToken(ctx context.Context) (string, error)

func (*Service) RedeemSetupToken

func (s *Service) RedeemSetupToken(ctx context.Context, plaintext string) (uuid.UUID, error)

func (*Service) RevokeSetupToken

func (s *Service) RevokeSetupToken(ctx context.Context) (string, error)

func (*Service) SetNow

func (s *Service) SetNow(now func() time.Time)

func (*Service) ValidateSetupToken

func (s *Service) ValidateSetupToken(ctx context.Context, plaintext string) error

Jump to

Keyboard shortcuts

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