jwt_manager

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidAccessToken ...
	ErrInvalidAccessToken = errors.New("invalid access token")
	// ErrUnexpectedSigningMethod ...
	ErrUnexpectedSigningMethod = errors.New("unexpected signing method")
	// ErrInvalidTokenClaims ...
	ErrInvalidTokenClaims = errors.New("invalid token claims")
)

Functions

This section is empty.

Types

type JwtManager

type JwtManager interface {
	Start() (err error)
	Generate(*m.User, ...*time.Time) (accessToken string, err error)
	Verify(string) (claims *UserClaims, err error)
	SetHmacKey(hmacKey []byte)
}

JwtManager ...

func NewJwtManager

func NewJwtManager(lc fx.Lifecycle,
	adaptors *adaptors.Adaptors) (mananger JwtManager)

NewJwtManager ...

type UserClaims

type UserClaims struct {
	UserId   int64  `json:"i,omitempty"`
	Username string `json:"n,omitempty"`
	RoleName string `json:"r,omitempty"`
}

UserClaims ...

Jump to

Keyboard shortcuts

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