Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct { SessionHandler SessionHandler SaltSize int Iterations int KeyLength int GetUserPasswordAndSalt func(username string) (string, string, error) }
func NewAuthenticator ¶
func NewAuthenticator(getSessionFromDatabase func(sessionToken string) (Session, error), saveSessionToDatabase func(uid string, session Session) error, redirectURI string, saltSize int, iterations int, keyLength int, getUserPasswordAndSalt func(username string) (string, string, error)) Authenticator
func (*Authenticator) CheckPassword ¶
func (auth *Authenticator) CheckPassword(username string, password string) (bool, error)
CheckPassword checks if the password is correct with the data from the database
func (*Authenticator) CreateSalt ¶
func (auth *Authenticator) CreateSalt() []byte
CreateSalt Create a salt
type SessionHandler ¶
type SessionHandler struct { GetSessionFromDatabase func(sessionToken string) (Session, error) SaveSessionToDatabase func(uid string, session Session) error Config Config }
func (*SessionHandler) CreateSession ¶
func (sh *SessionHandler) CreateSession(uid string) (Session, error)
func (*SessionHandler) CreateSessionToken ¶
func (sh *SessionHandler) CreateSessionToken() string
func (*SessionHandler) ValidateSession ¶
func (sh *SessionHandler) ValidateSession(next http.Handler) http.Handler
Click to show internal directories.
Click to hide internal directories.