useracc

package
v0.0.0-...-7fb4ca9 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: ISC Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func HashPassword

func HashPassword(password string) (string, error)

Types

type CreatedUserDTO

type CreatedUserDTO struct {
	Id       string `json:"id"`
	Username string `json:"username"`
}

type LoginResponseDTO

type LoginResponseDTO struct {
	AccessToken string `json:"access_token"`
}

type UserAccount

type UserAccount struct {
	Id           string `json:"id"`
	Username     string `json:"username"`
	PasswordHash string `json:"password_hash"`
}

type UserAccountHandlers

type UserAccountHandlers struct {
	TenantRepository      tenant.TenantRepository
	UserAccountRepository UserAccountRepository
}

func NewHandlers

func NewHandlers(tenantRepository tenant.TenantRepository, userAccountRepository UserAccountRepository) *UserAccountHandlers

NewHandlers initializes and returns a new Handlers instance

func (*UserAccountHandlers) CreateNewUserHandler

func (h *UserAccountHandlers) CreateNewUserHandler(w http.ResponseWriter, r *http.Request)

func (*UserAccountHandlers) GetAuthorizerContextHandler

func (h *UserAccountHandlers) GetAuthorizerContextHandler(w http.ResponseWriter, r *http.Request)

func (*UserAccountHandlers) LoginHandler

func (h *UserAccountHandlers) LoginHandler(w http.ResponseWriter, r *http.Request)

func (*UserAccountHandlers) TokenAuthorizerHandler

func (h *UserAccountHandlers) TokenAuthorizerHandler(w http.ResponseWriter, r *http.Request) error

type UserAccountRepository

type UserAccountRepository interface {
	InsertUserAccount(userAccount UserAccount) error
	SelectByUsername(username string) (*UserAccount, error)
}

type UserAccountRepositoryImpl

type UserAccountRepositoryImpl struct {
	DB *sql.DB
}

func NewUserAccountRepository

func NewUserAccountRepository(db *sql.DB) *UserAccountRepositoryImpl

func (*UserAccountRepositoryImpl) InsertUserAccount

func (r *UserAccountRepositoryImpl) InsertUserAccount(userAccount UserAccount) error

func (*UserAccountRepositoryImpl) SelectByUsername

func (r *UserAccountRepositoryImpl) SelectByUsername(username string) (*UserAccount, error)

type UserPassDTO

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

Jump to

Keyboard shortcuts

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