issuer

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultIssuer

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

DefaultIssuer handles JWT issuing

func NewDefaultIssuer

func NewDefaultIssuer(privateKey []byte) (*DefaultIssuer, error)

NewDefaultIssuer creates a new issuer by parsing the given path as an ED25519 private key

func (*DefaultIssuer) GenerateClaims

func (i *DefaultIssuer) GenerateClaims(
	jwtId string, userId string, expirationTime time.Time, isRefreshToken bool,
) *jwt.MapClaims

GenerateClaims generates a new claims object

func (*DefaultIssuer) IssueToken

func (i *DefaultIssuer) IssueToken(claims *jwt.MapClaims) (string, error)

IssueToken issues a new token for the given user with the given roles

type Issuer

type Issuer interface {
	IssueToken(claims *jwt.MapClaims) (string, error)
}

Issuer is the interface for JWT issuing

type Logger

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

func NewLogger

func NewLogger(logger commonlogger.Logger) Logger

NewLogger creates a new JWT issuer logger

func (Logger) IssuedToken

func (l Logger) IssuedToken()

IssuedToken logs a message when the server issues a token

Jump to

Keyboard shortcuts

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