backupcodes

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: 8 Imported by: 0

Documentation

Overview

Package backupcodes implements one-time recovery codes for users and instance admins.

Index

Constants

View Source
const CodeCount = 10

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct{ DB *sql.DB }

func (Service) ConsumeForInstanceAdmin

func (s Service) ConsumeForInstanceAdmin(ctx context.Context, instanceAdminID uuid.UUID, code string) (bool, error)

func (Service) ConsumeForUser

func (s Service) ConsumeForUser(ctx context.Context, userID uuid.UUID, code string) (bool, error)

func (Service) RegenerateForInstanceAdmin

func (s Service) RegenerateForInstanceAdmin(ctx context.Context, instanceAdminID uuid.UUID) ([]string, error)

func (Service) RegenerateForUser

func (s Service) RegenerateForUser(ctx context.Context, tenantID, userID uuid.UUID) ([]string, error)

Jump to

Keyboard shortcuts

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