storage

package
v0.0.0-...-475f6a8 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

This section is empty.

Types

type App

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

func NewApp

func NewApp(db *sql.DB) *App

func (*App) Delete

func (a *App) Delete(ctx context.Context, appID string) error

func (*App) Save

func (a *App) Save(ctx context.Context, appID string, name string, hashedSecret string) error

func (*App) SecretByID

func (a *App) SecretByID(ctx context.Context, appID string) (string, error)

func (*App) UpdateSecret

func (a *App) UpdateSecret(ctx context.Context, appID string, hashedSecret string) error

type User

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

func NewUser

func NewUser(db *sql.DB) *User

func (*User) Create

func (u *User) Create(ctx context.Context, user model.User, hashedPassword string) error

func (*User) FindByEmail

func (u *User) FindByEmail(ctx context.Context, email string) (model.User, error)

func (*User) FindByID

func (u *User) FindByID(ctx context.Context, userID string) (model.User, error)

func (*User) GetAllowedApps

func (u *User) GetAllowedApps(ctx context.Context, userID string) ([]string, error)

func (*User) GetHashedPassword

func (u *User) GetHashedPassword(ctx context.Context, email string) (string, error)

func (*User) GetMFASharedSecret

func (u *User) GetMFASharedSecret(ctx context.Context, userID string) (string, error)

func (*User) GetRestoreKey

func (u *User) GetRestoreKey(ctx context.Context, email string) (string, time.Time, error)

func (*User) ResetMFA

func (u *User) ResetMFA(ctx context.Context, userID string) error

func (*User) SaveMFA

func (u *User) SaveMFA(ctx context.Context, userID string, mfa string) error

func (*User) SaveMFASharedSecret

func (u *User) SaveMFASharedSecret(ctx context.Context, userID string, secret string) error

func (*User) SaveRestoreKey

func (u *User) SaveRestoreKey(ctx context.Context, email string, restoreKey string, ttl time.Time) error

Jump to

Keyboard shortcuts

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