jwt

package
v0.0.0-...-2610577 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: MIT Imports: 14 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
}

Service issues and validates jwt tokens.

func NewService

func NewService(ctx context.Context, logger logger, sqldb *sql.DB) (*Service, error)

NewService creates new jwt service instance.

func (*Service) NewToken

func (s *Service) NewToken(subject string, validFor time.Duration, typ string) (string, error)

NewToken returns new authorization.

func (*Service) Validate

func (s *Service) Validate(ctx context.Context, raw string, typ string) (string, error)

Validate returns token subject if a token is valid.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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