credential

package
v0.9.1-beta Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Template is the content template of a credential.
	// credentials files are .toml files.
	Template = `` /* 288-byte string literal not displayed */

)

Variables

This section is empty.

Functions

func CopyClipboard

func CopyClipboard(r io.Reader) error

CopyClipboard copies the password field to the clipboard.

func EmptyClipboard

func EmptyClipboard() error

EmptyClipboard deletes the content of the clipboard.

func GeneratePassword

func GeneratePassword() (string, error)

GeneratePassword generates a random password

func LogFields

func LogFields(r io.Reader) error

LogFields prints in the terminal the the most important fields of the credential file.

func ValidateFile

func ValidateFile(filePath string) error

ValidateFile validates a file as toml credential file.

Types

type Credential

type Credential struct {
	Login            string `toml:"login"`
	Password         string `toml:"password"`
	Email            string `toml:"email"`
	ApiKey           string `toml:"api_key"`
	ApiSecret        string `toml:"api_secret"`
	ApiName          string `toml:"api_name"`
	ApiPassphrase    string `toml:"api_passphrase"`
	VerificationCode string `toml:"verification_code"`
	TwoFactorAuth    string `toml:"two_factor_auth"`
	// All other stuff here as multiline
	Remarks string `toml:"remarks"`
}

A Credential contains all relevant information for accessing and controlling an online resource (password/s, api keys, 2FA backup code)

Jump to

Keyboard shortcuts

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