Documentation ¶
Index ¶
- Variables
- func DecodeState(state string, v interface{}) error
- func EncodeState(v interface{}) (string, error)
- func SetFingerprintContext(ctx echo.Context, fp *Fingerprint)
- func SetUserContext(ctx echo.Context, user *User)
- type Auth
- type Fingerprint
- type Hook
- type Params
- type Session
- type SessionClaims
- type State
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSessionNotFound = errors.New("session not found")
Functions ¶
func DecodeState ¶
func EncodeState ¶
func SetFingerprintContext ¶
func SetFingerprintContext(ctx echo.Context, fp *Fingerprint)
SetFingerprintContext sets fingerprint (ip, ua, hwid) into http.Request
func SetUserContext ¶
func SetUserContext(ctx echo.Context, user *User)
SetUserContext sets user context into http.Request we need it because gqlgen don't knows about echo.Context and uses http.Request context but there is no easy way to set Request context.
Types ¶
type Auth ¶
type Auth struct { *Params // contains filtered or unexported fields }
func (*Auth) InitRoutes ¶
func (a *Auth) InitRoutes(g *echo.Group)
func (*Auth) Middleware ¶
func (a *Auth) Middleware(next echo.HandlerFunc) echo.HandlerFunc
Middleware returns authorization middleware for http server
type Fingerprint ¶
Fingerprint struct to store data in request context
func ExtractFingerprintContext ¶
func ExtractFingerprintContext(ctx context.Context) *Fingerprint
ExtractFingerprintContext get fingerprint (ip, ua, hwid) from context
type Params ¶
type Params struct { fx.In `wire:"-"` UserRepo repository.UserRepository UserParamLogRepo repository.UserParamLogRepository AuthLog repository.AuthLogRepository Env *auth.Env }
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func (*Session) DropAllByExternalID ¶
type SessionClaims ¶
type State ¶
func (State) MarshalLogObject ¶
func (s State) MarshalLogObject(e zapcore.ObjectEncoder) error
type User ¶
User struct to store user data in request context
func ExtractUserContext ¶
ExtractUserContext get user data from context
Click to show internal directories.
Click to hide internal directories.