authentication

package
Version: v0.0.0-...-6bf1803 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidCredentialsError

func IsInvalidCredentialsError(err error) bool

IsInvalidCredentialsError verifies if a given error refers to incalid credentials

func NewInvalidCredentials

func NewInvalidCredentials(username string) error

NewInvalidCredentials created a new Invalid Credentials error

Types

type User

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

User manages any user related actions

func New

func New(storage UserRegistry) *User

New creates a new User instance

func (*User) GetEmailForUser deprecated

func (u *User) GetEmailForUser(id uint) (string, error)

Deprecated: do not use this

func (*User) IsValid

func (u *User) IsValid(username, password string) error

IsValid checks if a username

type UserRegistry

type UserRegistry interface {
	GetPasswordFor(email string) (string, error)
}

UserRegistry abstracts aways the storage from the logic

Directories

Path Synopsis
Package mock_authentication is a generated GoMock package.
Package mock_authentication is a generated GoMock package.

Jump to

Keyboard shortcuts

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