credentials

package
v0.0.0-...-1cd449f Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var P = pika.Get()

Functions

This section is empty.

Types

type JsonCredentials

type JsonCredentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type SQLiteCredentialStore

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

func Get

func Get() *SQLiteCredentialStore

func NewSQLiteCredentialStore

func NewSQLiteCredentialStore(dataBaseFile ...string) *SQLiteCredentialStore

dataBaseFile defaults to "main.db"

func (*SQLiteCredentialStore) AddAdmin

func (store *SQLiteCredentialStore) AddAdmin(user, password string) (err error)

func (*SQLiteCredentialStore) AddEntry

func (store *SQLiteCredentialStore) AddEntry(user, password string) (err error)

func (*SQLiteCredentialStore) GetEntry

func (store *SQLiteCredentialStore) GetEntry(username, password string) (*User, error)

func (*SQLiteCredentialStore) GetUser

func (store *SQLiteCredentialStore) GetUser(id string) (*User, error)

func (*SQLiteCredentialStore) GetUsers

func (store *SQLiteCredentialStore) GetUsers() ([]*User, error)

func (*SQLiteCredentialStore) Load

func (store *SQLiteCredentialStore) Load(cred_env string) (error error)

func (*SQLiteCredentialStore) RemoveEntry

func (store *SQLiteCredentialStore) RemoveEntry(id string) (err error)

func (*SQLiteCredentialStore) Valid

func (store *SQLiteCredentialStore) Valid(user, password, _ string) bool

type StaticCredentials

type StaticCredentials map[string][]byte

func (StaticCredentials) PlainTextValidator

func (s StaticCredentials) PlainTextValidator(user, password string) bool

func (StaticCredentials) SadBCryptHashValidator

func (s StaticCredentials) SadBCryptHashValidator(user, password string) bool

type User

type User struct {
	Id             string
	Username       string
	HashedPassword string
	Admin          bool
}

Jump to

Keyboard shortcuts

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