auth

package module
v0.0.0-...-dc6ae1d Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(ctx context.Context, db *sql.DB, login, token_type string, expiresAt time.Time) (string, error)

func ExtractTokenID

func ExtractTokenID(t string) (string, error)

func InitDB

func InitDB(ctx context.Context, db *sql.DB) error

InitDB creates the required tables on the given db object

func Login

func Login(ctx context.Context, db *sql.DB, login string, plainPass []byte) (string, error)

Login user

func OpenDir

func OpenDir(ctx context.Context, dir string) (*sql.DB, error)

func OpenMemory

func OpenMemory(ctx context.Context) (*sql.DB, error)

func RegisterUser

func RegisterUser(ctx context.Context, db *sql.DB, login string, passwd []byte) (string, error)

RegisterUser with the given login and password

func ReplacePassword

func ReplacePassword(ctx context.Context, db *sql.DB, login string, newpass []byte) error

ReplacePassword of given user

func RevokeToken

func RevokeToken(ctx context.Context, db *sql.DB, tokenID string) error

func TokenLogin

func TokenLogin(ctx context.Context, db *sql.DB, token string) (string, string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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