Documentation
¶
Overview ¶
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Index ¶
- func Init()
- type Authentication
- func (auth *Authentication) Auth(onsuccess http.Handler, ...) http.Handler
- func (auth *Authentication) AuthViaSession(rw http.ResponseWriter, r *http.Request) (*repository.AppUser, error)
- func (auth *Authentication) Login(onfailure func(rw http.ResponseWriter, r *http.Request, loginErr error)) http.Handler
- func (auth *Authentication) Logout(onsuccess http.Handler) http.Handler
- func (auth *Authentication) SaveSession(rw http.ResponseWriter, r *http.Request, user *repository.AppUser) error
- type Authenticator
- type LocalAuthenticator
- func (la *LocalAuthenticator) CanLogin(user *repository.AppUser, username string, rw http.ResponseWriter, ...) (*repository.AppUser, bool)
- func (la *LocalAuthenticator) Init() error
- func (la *LocalAuthenticator) Login(user *repository.AppUser, rw http.ResponseWriter, r *http.Request) (*repository.AppUser, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authentication ¶
type Authentication struct { LocalAuth *LocalAuthenticator SessionMaxAge time.Duration // contains filtered or unexported fields }
func GetAuthInstance ¶
func GetAuthInstance() *Authentication
func (*Authentication) Auth ¶
func (auth *Authentication) Auth( onsuccess http.Handler, onfailure func(rw http.ResponseWriter, r *http.Request, authErr error), ) http.Handler
func (*Authentication) AuthViaSession ¶
func (auth *Authentication) AuthViaSession( rw http.ResponseWriter, r *http.Request, ) (*repository.AppUser, error)
func (*Authentication) Login ¶
func (auth *Authentication) Login( onfailure func(rw http.ResponseWriter, r *http.Request, loginErr error), ) http.Handler
func (*Authentication) Logout ¶
func (auth *Authentication) Logout(onsuccess http.Handler) http.Handler
func (*Authentication) SaveSession ¶
func (auth *Authentication) SaveSession(rw http.ResponseWriter, r *http.Request, user *repository.AppUser, ) error
type Authenticator ¶
type Authenticator interface { CanLogin(user *repository.AppUser, username string, rw http.ResponseWriter, r *http.Request) (*repository.AppUser, bool) Login(user *repository.AppUser, rw http.ResponseWriter, r *http.Request) (*repository.AppUser, error) }
type LocalAuthenticator ¶
type LocalAuthenticator struct {
// contains filtered or unexported fields
}
func (*LocalAuthenticator) CanLogin ¶
func (la *LocalAuthenticator) CanLogin( user *repository.AppUser, username string, rw http.ResponseWriter, r *http.Request, ) (*repository.AppUser, bool)
func (*LocalAuthenticator) Init ¶
func (la *LocalAuthenticator) Init() error
func (*LocalAuthenticator) Login ¶
func (la *LocalAuthenticator) Login( user *repository.AppUser, rw http.ResponseWriter, r *http.Request, ) (*repository.AppUser, error)
Click to show internal directories.
Click to hide internal directories.