Documentation ¶
Overview ¶
Package auth is for the abstraction of the authentication method. this enables the application developer to seperate the authentication from the authentication itself.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account interface { Get(constants.AccountConstant) any List() []constants.AccountConstant Anonymous() bool Redirect(c *gin.Context) }
Account is an interface that gives the application access to infos about the user.
type AnonAccount ¶
type AnonAccount struct{}
AnonAccount is an simple Account-interface implementation. It is always Anonymous
func (*AnonAccount) Get ¶
func (*AnonAccount) Get(key constants.AccountConstant) (in any)
Get returns only AccountAnon = true
func (*AnonAccount) List ¶
func (*AnonAccount) List() []constants.AccountConstant
List return only AccountAnon as the only Listitem
func (*AnonAccount) Redirect ¶
func (*AnonAccount) Redirect(c *gin.Context)
Redirect should point to an login, but since its not possible for this handler it sends an 401 Page
type AnonAccountHandler ¶
type AnonAccountHandler struct{}
AnonAccountHandler is an simple struct that fullfills the AuthenticationHandler Interface
type AuthenticationHandler ¶
AuthenticationHandler is an interface that is used to give the account of the request. it is set into the context using gin.Context.Set. The context must be reused for the redirect. Account NEVER returns nil. Not loggedin Users have return Anonymous() = true and get() = nil and List() = []string{}