credentials

package
v2.46.9 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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