Documentation ¶
Index ¶
- Variables
- type Dependencies
- type GormReadWrite
- type Logger
- type Provider
- func (a *Provider) ChangePassword(ctx *fasthttp.RequestCtx) (bool, map[string]error)
- func (a *Provider) GenerateLoginToken(user UserRecord) (string, error)
- func (a *Provider) GetPermissions(ctx *fasthttp.RequestCtx) []string
- func (a *Provider) GetProviderName() string
- func (a *Provider) GetUniqueIdentifier(ctx *fasthttp.RequestCtx) string
- func (a *Provider) IsAuthenticated(ctx *fasthttp.RequestCtx) bool
- func (a *Provider) Login(ctx *fasthttp.RequestCtx) (bool, map[string]error)
- func (a *Provider) Logout(ctx *fasthttp.RequestCtx) bool
- func (a *Provider) Register(ctx *fasthttp.RequestCtx) (bool, map[string]error)
- func (a *Provider) SetAuthCookie(ctx *fasthttp.RequestCtx, user UserRecord) error
- type UserClaim
- type UserRecord
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderName = "dbauth"
Functions ¶
This section is empty.
Types ¶
type Dependencies ¶
type Dependencies struct { Db GormReadWrite Log Logger Secret string GetUserRecordsFunc func() []UserRecord SaveUserRecordFunc func(user UserRecord) error GenerateAuthHashFunc func(user UserRecord) string HashWorkFactor int }
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func New ¶
func New(dependencies Dependencies) (*Provider, error)
func (*Provider) ChangePassword ¶ added in v0.9.0
func (*Provider) GenerateLoginToken ¶ added in v0.9.0
func (a *Provider) GenerateLoginToken(user UserRecord) (string, error)
func (*Provider) GetPermissions ¶ added in v0.10.0
func (a *Provider) GetPermissions(ctx *fasthttp.RequestCtx) []string
func (*Provider) GetProviderName ¶
func (*Provider) GetUniqueIdentifier ¶
func (a *Provider) GetUniqueIdentifier(ctx *fasthttp.RequestCtx) string
func (*Provider) IsAuthenticated ¶
func (a *Provider) IsAuthenticated(ctx *fasthttp.RequestCtx) bool
func (*Provider) SetAuthCookie ¶
func (a *Provider) SetAuthCookie(ctx *fasthttp.RequestCtx, user UserRecord) error
Click to show internal directories.
Click to hide internal directories.