jwt

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const PurposePlayground = "playground"

PurposePlayground marks tokens minted exclusively for the dashboard playground. Purpose-tagged tokens are rejected by the admin API and only honored by the proxy-plane playground identity resolver.

Variables

View Source
var (
	ErrInvalidToken = errors.New("invalid token")
	ErrExpiredToken = errors.New("expired token")
)

Functions

This section is empty.

Types

type Claims

type Claims struct {
	TeamID    string `json:"team_id,omitempty"`
	UserID    string `json:"user_id,omitempty"`
	UserEmail string `json:"user_email,omitempty"`
	// Purpose restricts where a token is accepted. Empty means a regular
	// admin token; "playground" tokens are only valid on the proxy plane.
	Purpose string `json:"purpose,omitempty"`
	// ConsumerSlug binds a playground token to a single consumer route.
	ConsumerSlug string `json:"consumer_slug,omitempty"`
	jwt.RegisteredClaims
}

type Manager

type Manager interface {
	CreateToken() (string, error)
	ValidateToken(tokenString string) error
	DecodeToken(tokenString string) (*Claims, error)
}

func NewJwtManager

func NewJwtManager(config *config.ServerConfig) Manager

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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