credentials

package
v2.19.6 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyPassword

func VerifyPassword(pwd string) error

VerifyPassword checks whether the given password abides to the enforced password strength.

Types

type Credentials

type Credentials struct {
	ID     string `json:"id"`
	Secret string `json:"secret"`
}

Credentials stores and en-/decrypts credentials

func (*Credentials) Clear

func (creds *Credentials) Clear()

Clear resets the credentials.

func (*Credentials) Get

func (creds *Credentials) Get(passphrase string) (string, string, error)

Get decrypts and retrieves the stored credentials.

func (*Credentials) IsValid

func (creds *Credentials) IsValid() bool

IsValid checks whether the credentials are valid.

func (*Credentials) Set

func (creds *Credentials) Set(id, secret string, passphrase string) error

Set encrypts and sets new credentials.

type Password

type Password struct {
	Value string `json:"value"`
}

Password holds a hash password alongside its salt value.

func (*Password) Clear

func (password *Password) Clear()

Clear resets the password.

func (*Password) Compare

func (password *Password) Compare(pwd string) bool

Compare checks whether the given password string equals the stored one.

func (*Password) IsValid

func (password *Password) IsValid() bool

IsValid checks whether the password is valid.

func (*Password) Set

func (password *Password) Set(pwd string) error

Set sets a new password by hashing the plaintext version using bcrypt.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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