token

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ScopeUser     = "user"
	ScopeCodeRead = "code:read"
	ScopeRefresh  = "refresh"
)

Variables

View Source
var (
	ExpiryAccessToken  = 15 * time.Minute
	ExpiryRefreshToken = 15 * 24 * time.Hour
)

Functions

func SessionAuthMiddleware

func SessionAuthMiddleware(runnerID string, service *Service) echo.MiddlewareFunc

Types

type Handler

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

func NewHandler

func NewHandler(runner *model.Runner, service *Service) *Handler

func (*Handler) HandleLogout

func (*Handler) HandleLogout(c echo.Context) error

func (*Handler) HandleRefresh

func (h *Handler) HandleRefresh(c echo.Context) error

type Service

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

func NewService

func NewService(signer *jwtutil.Signer, verifier *jwtutil.Verifier) *Service

func (*Service) GenerateToken

func (s *Service) GenerateToken(issuer string, scopes []string, user *model.User, expiry time.Duration) (string, error)

func (*Service) ReadToken

func (s *Service) ReadToken(issuer string, scope string, token string) (*model.User, error)

Jump to

Keyboard shortcuts

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