authentication_service

package
v0.0.0-...-0eeeb36 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService struct {
	MailService       mail_service.IMailService
	RepositoriesGroup *repository.RepositoriesGroup
}

func DefaultAuthService

func DefaultAuthService(rg *repository.RepositoriesGroup, mailService *mail_service.MailService) *AuthService

func (*AuthService) AuthUser

func (as *AuthService) AuthUser(email string, password string) (*user_model.User, bool)

func (*AuthService) GetRandomCode

func (as *AuthService) GetRandomCode(length int64) (string, string, error)

func (*AuthService) HashPassword

func (as *AuthService) HashPassword(password string) (string, error)

func (*AuthService) PasswordIsComplex

func (as *AuthService) PasswordIsComplex(password string) bool

func (*AuthService) SendPasswordResetCode

func (as *AuthService) SendPasswordResetCode(email string) error

func (*AuthService) SendTwoFactorCode

func (as *AuthService) SendTwoFactorCode(user *user_model.User) error

func (*AuthService) VerifyPassword

func (as *AuthService) VerifyPassword(passwordHash string, password string) bool

func (*AuthService) VerifyPasswordResetCode

func (as *AuthService) VerifyPasswordResetCode(id int64, code string) bool

func (*AuthService) VerifyTwoFactorCode

func (as *AuthService) VerifyTwoFactorCode(id int64, code string) bool

type IAuthService

type IAuthService interface {
	AuthUser(string, string) (*user_model.User, bool)
	HashPassword(string) (string, error)
	SendPasswordResetCode(string) error
	VerifyPassword(string, string) bool
	VerifyPasswordResetCode(int64, string) bool
	SendTwoFactorCode(*user_model.User) error
	VerifyTwoFactorCode(int64, string) bool
	PasswordIsComplex(string) bool
	GetRandomCode(int64) (string, string, error)
}

Jump to

Keyboard shortcuts

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