issuer

package
v0.3.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issuer

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

Issuer handles JWT issuing

func NewIssuer

func NewIssuer(privateKeyPath string) (*Issuer, error)

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

func (*Issuer) GenerateClaims added in v0.3.4

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

GenerateClaims generates a new claims object

func (*Issuer) IssueToken

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

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

type Logger added in v0.3.4

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

func NewLogger added in v0.3.4

func NewLogger(name string) *Logger

NewLogger creates a new JWT issuer logger

func (*Logger) IssuedToken added in v0.3.4

func (e *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