issuer

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateClaims added in v0.6.30

func GenerateClaims(
	jwtId string,
	userId string,
	userUUID uuid.UUID,
	issuedAt time.Time,
	expirationAt time.Time,
	isRefreshToken bool,
) *jwt.MapClaims

GenerateClaims generates a new claims object

func GetExpirationTime added in v0.6.30

func GetExpirationTime(
	issuedTime time.Time,
	duration time.Duration,
) time.Time

GetExpirationTime returns the expiration time for the given duration

Types

type Ed25519Issuer added in v0.7.0

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

Ed25519Issuer handles JWT tokens issuing with ED25519 private key

func NewEd25519Issuer added in v0.7.0

func NewEd25519Issuer(privateKey []byte) (*Ed25519Issuer, error)

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

func (*Ed25519Issuer) IssueToken added in v0.7.0

func (i *Ed25519Issuer) 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 tokens issuing

type Logger

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

Logger is the JWT issuer logger

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