vaultstorage

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = module.Module{
	{Constructor: newService},
}

Module storage constructor nolint:gochecknoglobals

Functions

func Defaults

func Defaults(ctx *cli.Context, v *viper.Viper) error

Defaults for the storage service.

Types

type Key

type Key struct {
	ID        uint64 `db:"id"`
	PublicID  string `db:"public_id"`
	Created   string `db:"created"`
	PrivateID string `db:"private_id"`
	AESKey    string `db:"aes_key"`
	LockCode  string `db:"lock_code"`
	Active    bool   `db:"active"`
}

Key represents secret key record in storage.

func (*Key) String

func (k *Key) String() string

type Service

type Service struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Service for vault storage.

func (*Service) DecryptOTP

func (s *Service) DecryptOTP(publicID, token string) (*common.OTP, error)

DecryptOTP Decrypt OTP using stored private AES for specified public identifier.

func (*Service) GetKey

func (s *Service) GetKey(publicID string) (*Key, error)

GetKey gets Key from storage by public id.

func (*Service) Name

func (s *Service) Name() string

Name returns name of the service.

func (*Service) Start

func (s *Service) Start(ctx context.Context) error

Start storage service.

func (*Service) Stop

func (s *Service) Stop(ctx context.Context)

Stop the storage service.

func (*Service) StoreKey

func (s *Service) StoreKey(k *Key) error

StoreKey in vault storage.

Jump to

Keyboard shortcuts

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