auth

package
v0.0.0-...-b289748 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

func NewAuth

func NewAuth(ua AuthArgs) *Auth

func (*Auth) AddRecord

func (a *Auth) AddRecord(uid types.Uid, scheme, unique string, authLvl t.Level, secret []byte, expires time.Time) error

AddRecord creates new authentication record

func (*Auth) DelAllRecords

func (a *Auth) DelAllRecords(user types.Uid) (int, error)

DelAllRecords deletes all authentication records for the user.

func (*Auth) DelScheme

func (a *Auth) DelScheme(user types.Uid, scheme string) error

DelScheme deletes an existing authentication scheme for the user.

func (*Auth) GetRecord

func (a *Auth) GetRecord(uid types.Uid, scheme string) (string, t.Level, []byte, time.Time, error)

GetRecord returns authentication record given user ID and method.

func (*Auth) GetUniqueRecord

func (a *Auth) GetUniqueRecord(unique string) (types.Uid, t.Level, []byte, time.Time, error)

GetUniqueRecord returns user_id, auth level, secret, expire for a given unique value i.e. login.

func (*Auth) UpdRecord

func (a *Auth) UpdRecord(uid types.Uid, scheme, unique string, authLvl t.Level, secret []byte, expires time.Time) error

UpdRecord modifies an authentication record. Only non-default/non-zero values are updated.

type AuthArgs

type AuthArgs struct {
	DB     *pgxpool.Pool
	Utils  *utils.Utils
	Cfg    *config.StorePostgresConfig
	Shared *shared.Shared
	UGen   *types.UidGenerator
}

Jump to

Keyboard shortcuts

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