auth

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

func NewService

func NewService(application contracts.Application) *Service

func (*Service) Login

func (s *Service) Login(ctx *web.Context, user *models.User) error

func (*Service) Logout

func (s *Service) Logout(ctx *web.Context) error

func (*Service) RegisterGuard

func (s *Service) RegisterGuard(name string, constructor contracts.AuthGuardConstructor) error

func (*Service) User

func (s *Service) User(ctx *web.Context) (*models.User, error)

type SessionGuard

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

func NewSessionGuard

func NewSessionGuard(service contracts.SessionService) *SessionGuard

func (*SessionGuard) Login

func (g *SessionGuard) Login(ctx *web.Context, user *models.User) error

func (*SessionGuard) Logout

func (g *SessionGuard) Logout(ctx *web.Context) error

func (*SessionGuard) SetUser

func (g *SessionGuard) SetUser(ctx *web.Context, user *models.User)

func (*SessionGuard) User

func (g *SessionGuard) User(ctx *web.Context) *models.User

type UserSessionData

type UserSessionData struct {
	Id                string        `json:"id"`
	Name              string        `json:"name"`
	PreferredUsername string        `json:"preferred_username"`
	Email             string        `json:"email"`
	Phone             string        `json:"phone"`
	Picture           string        `json:"picture"`
	Roles             []models.Role `json:"roles"`
	ImpersonatorId    *string       `json:"impersonator_id"`
}

Jump to

Keyboard shortcuts

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