issuer

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilIssuer = errors.New("issuer cannot be nil")
)

Functions

This section is empty.

Types

type Ed25519Issuer

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

Ed25519Issuer handles JWT tokens issuing with ED25519 private key

func NewEd25519Issuer

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

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

Parameters:

  • privateKey: The ED25519 private key in PEM format

Returns:

  • *Ed25519Issuer: The created issuer
  • error: An error if the private key could not be parsed or is of an invalid type

func (Ed25519Issuer) IssueToken

func (i Ed25519Issuer) IssueToken(claims jwt.Claims) (string, error)

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

Parameters:

  • claims: The claims to include in the token

Returns:

  • string: The issued token as a string
  • error: An error if the token could not be created or signed

type Issuer

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

Issuer is the interface for JWT tokens issuing

Jump to

Keyboard shortcuts

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