service

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidToken = fmt.Errorf("token is invalid")
	ErrTokenExpired = fmt.Errorf("token is expired")
)

Known errors.

Functions

func Module

func Module(c *di.Container)

Types

type Service

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

func NewService

func NewService(logger *zap.Logger, keysRepo db_keys.Repository) *Service

func (*Service) IssueToken

func (s *Service) IssueToken(ctx context.Context, subject string, validFor time.Duration, tokenType jwt.TokenType) (*jwt.Token, error)

func (*Service) Verify

func (s *Service) Verify(ctx context.Context, rawToken string, expectedTypes ...jwt.TokenType) (*jwt.Token, error)

Verify checks token signature and returns it's meaningful content.

Jump to

Keyboard shortcuts

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