jwt

package
v0.0.0-...-260b785 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: Apache-2.0 Imports: 16 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 holds the required fields for jwt package

func New

func New() *JWT

New initializes the package

func (*JWT) Close

func (j *JWT) Close()

Close closes the go routine of jwk fetch routing

func (*JWT) CreateToken

func (j *JWT) CreateToken(ctx context.Context, tokenClaims model.TokenClaims) (string, error)

CreateToken create a token with primary secret

func (*JWT) ParseToken

func (j *JWT) ParseToken(ctx context.Context, token string) (map[string]interface{}, error)

ParseToken verifies the token

func (*JWT) SetSecrets

func (j *JWT) SetSecrets(secrets []*config.Secret) error

SetSecrets set the internal fields of jwt struct

Jump to

Keyboard shortcuts

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