mfa

package
v0.3.6 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package mfa provides methods for tracking per-user MFA configurations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager is an object for tracking users and their OTP secrets. It uses the configured secrets backend for storage.

func NewManager

func NewManager(secrets *secrets.SecretEngine) *Manager

NewManager returns a new MFA manager with the given secrets engine.

func (*Manager) DeleteUserSecret

func (m *Manager) DeleteUserSecret(name string) error

DeleteUserSecret will remove OTP data for the given username.

func (*Manager) GetMFAUsers

func (m *Manager) GetMFAUsers() (map[string]bool, error)

GetMFAUsers will return a map of all MFA user names and whether they have been verified.

func (*Manager) GetUserMFAStatus

func (m *Manager) GetUserMFAStatus(name string) (string, bool, error)

GetUserMFAStatus will retrieve the OTP secret for the given user, and whether it has been verified. If there is no secret for this user, a UserNotFound error is returned.

func (*Manager) SetUserMFAStatus

func (m *Manager) SetUserMFAStatus(name, secret string, verified bool) error

SetUserMFAStatus sets the value of the user's OTP secret and whether it is verified.

Jump to

Keyboard shortcuts

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