tokenizer

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JwtService

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

func NewJwtService

func NewJwtService(
	ctx context.Context,
	logger logger.Logger,
	blockedTokenRepository repository.BlockedToken,
	jwtTokenAcceptedIssuers []string,
	jwtSecretSalt string,
	jwtTokenIssuer string,
	jwtTokenEncryptAlgo string,
	jwtTokenExpiresAfter int64,
) *JwtService

func (*JwtService) Block

func (s *JwtService) Block(token string) error

Block will mark the token as blocked into the storage.

func (*JwtService) New

func (s *JwtService) New(user *agg.User) (token string, err error)

New will generate a new JWT.

func (*JwtService) Validate

func (s *JwtService) Validate(token string) (userID vo.ID, err error)

Validate will decode the token and return a user ID or error, if it was occurred.

Jump to

Keyboard shortcuts

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