auth

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAuthCore

func CreateAuthCore(z *zepto.Zepto, opts authcore.AuthCore) *authcore.AuthCore

Types

type AuthToken

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

func NewAuthTokenPlugin

func NewAuthTokenPlugin(opts AuthTokenOptions) *AuthToken

func (*AuthToken) AppendMiddlewares

func (at *AuthToken) AppendMiddlewares() []web.MiddlewareFunc

func (*AuthToken) Instance

func (at *AuthToken) Instance() interface{}

func (*AuthToken) Name

func (at *AuthToken) Name() string

func (*AuthToken) OnCreated

func (at *AuthToken) OnCreated(z *zepto.Zepto)

func (*AuthToken) OnZeptoInit

func (at *AuthToken) OnZeptoInit(z *zepto.Zepto)

func (*AuthToken) OnZeptoStart

func (at *AuthToken) OnZeptoStart(z *zepto.Zepto)

func (*AuthToken) OnZeptoStop

func (at *AuthToken) OnZeptoStop(z *zepto.Zepto)

func (*AuthToken) PrependMiddlewares

func (at *AuthToken) PrependMiddlewares() []web.MiddlewareFunc

type AuthTokenInstance

type AuthTokenInstance interface {
	Core() *authcore.AuthCore
	LoggedPIDFromCtx(ctx web.Context) authcore.PID
	Auth(username string, password string) (*authcore.Token, error)
	Logout(authToken string) error
	PasswordRecovery(email string) error
	ResetPassword(resetPasswordToken string, password string) error
}

func InstanceFromCtx

func InstanceFromCtx(ctx web.Context) AuthTokenInstance

type AuthTokenOptions

type AuthTokenOptions struct {
	Datasource     authcore.AuthDatasource
	TokenEncoder   authcore.AuthEncoder
	Store          authcore.AuthStore
	Notifier       authcore.AuthNotifier
	AuthContextKey string
}

type DefaultAuthTokenInstance

type DefaultAuthTokenInstance struct {
	AuthCore       *authcore.AuthCore
	AuthContextKey string
}

func (*DefaultAuthTokenInstance) Auth

func (d *DefaultAuthTokenInstance) Auth(username string, password string) (*authcore.Token, error)

func (*DefaultAuthTokenInstance) Core

func (*DefaultAuthTokenInstance) LoggedPIDFromCtx

func (d *DefaultAuthTokenInstance) LoggedPIDFromCtx(ctx web.Context) authcore.PID

func (*DefaultAuthTokenInstance) Logout

func (d *DefaultAuthTokenInstance) Logout(authToken string) error

func (*DefaultAuthTokenInstance) PasswordRecovery

func (d *DefaultAuthTokenInstance) PasswordRecovery(email string) error

func (*DefaultAuthTokenInstance) ResetPassword

func (d *DefaultAuthTokenInstance) ResetPassword(resetPasswordToken string, password string) error

Directories

Path Synopsis
datasources
encoders
notifiers
stores
tests

Jump to

Keyboard shortcuts

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