jwt

package
v0.0.0-...-0046f9d Latest Latest
Warning

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

Go to latest
Published: May 15, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JWT

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

JWT will handle creating and validating of access, refresh and fresh tokens.

func New

func New(log *zap.Logger) *JWT

New returns new JWT.

func (JWT) AccessAndRefresh

func (j JWT) AccessAndRefresh(
	ctx context.Context, id string, scopes []string) (string, string, error)

AccessAndRefresh returns access and refresh token

func (*JWT) Disconnect

func (j *JWT) Disconnect()

Disconnect will disconnect from service.

func (JWT) Fresh

func (j JWT) Fresh(ctx context.Context, id string) (string, error)

Fresh returns fresh access token.

func (JWT) Refresh

func (j JWT) Refresh(
	ctx context.Context, token string) (string, string, string, error)

Refresh returns new access and refresh token based on old refresh token.

func (JWT) Validate

func (j JWT) Validate(
	ctx context.Context,
	token string,
	tokenType proto.TokenType) (proto.Claims, string, error)

Validate validates a token.

Jump to

Keyboard shortcuts

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