auth

package
v0.0.0-...-418667d Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Handler

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

func ProvideHandler

func ProvideHandler(svc model.AuthSessionService, validate *validator.Validate) *Handler

func (*Handler) GetAccessToken

func (hdl *Handler) GetAccessToken() http.HandlerFunc

func (*Handler) Login

func (hdl *Handler) Login() http.HandlerFunc

func (*Handler) Logout

func (hdl *Handler) Logout() http.HandlerFunc

type Repository

type Repository struct{}

func ProvideRepository

func ProvideRepository() *Repository

func (*Repository) CheckRefreshToken

func (rpo *Repository) CheckRefreshToken(ctx context.Context, tx *sql.Tx, userID string, userAgent string) (*model.AuthSession, error)

func (*Repository) RevokeSession

func (rpo *Repository) RevokeSession(ctx context.Context, tx *sql.Tx, userID string, userAgent string)

func (*Repository) SaveSession

func (rpo *Repository) SaveSession(ctx context.Context, tx *sql.Tx, data *model.AuthSession)

type Router

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

func ProvideRoute

func ProvideRoute(hdl model.AuthSessionHandler) *Router

func Wire

func Wire(validate *validator.Validate, db *sql.DB) *Router

func (*Router) InitializeRoutes

func (router *Router) InitializeRoutes(route chi.Router)

type Service

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

func (*Service) GetAccessToken

func (svc *Service) GetAccessToken(ctx context.Context, claims jwt.MapClaims, userAgent string) model.TokenResponse

func (*Service) Login

func (svc *Service) Login(ctx context.Context, request *model.LoginRequest, userAgent string) model.TokenResponse

func (*Service) Logout

func (svc *Service) Logout(ctx context.Context, claims jwt.MapClaims, userAgent string)

Jump to

Keyboard shortcuts

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