token

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Claims

type Claims struct {
	jwt.StandardClaims
}

Claims represents the JWT claims

type Config

type Config struct {
	// TokenExpiration is the duration for which a token is valid
	TokenExpiration time.Duration
	// SecretKey is the key used to sign tokens
	SecretKey string
}

Config represents token manager configuration

type Manager

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

Manager handles token generation and validation

func NewManager

func NewManager(config Config) (*Manager, error)

NewManager creates a new token manager

func (*Manager) GenerateToken

func (m *Manager) GenerateToken() (string, error)

GenerateToken creates a new JWT token for an agent

func (*Manager) ValidateToken

func (m *Manager) ValidateToken(tokenString string) error

ValidateToken checks if a token is valid

Jump to

Keyboard shortcuts

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