licensetoken

package
v2.935.1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package licensetoken validates registry-signed license tokens against the embedded production JWK set.

Index

Constants

This section is empty.

Variables

View Source
var ErrConflictingLicenseElection = errors.New("a license token conflicts with an AGPL election: supply one or the other")
View Source
var ErrInvalidLicenseToken = errors.New("invalid license token")

Functions

func WithToken

func WithToken(ctx context.Context, token []byte) context.Context

WithToken attaches a raw license token; the generator validates it during initialization.

Types

type TokenInfo

type TokenInfo struct {
	WorkspaceID   string
	WorkspaceSlug string
	OrgSlug       string
	Tier          string
	Targets       []string
	IssuedAt      time.Time
	ExpiresAt     time.Time
	Message       string
}

func Inspect

func Inspect(token []byte) (TokenInfo, error)

Inspect validates token exactly as generation does and returns its summary without touching a context.

func (TokenInfo) Covers

func (i TokenInfo) Covers(target string) bool

type Verification

type Verification struct {
	Targets []string
}

func ResolveGenerationAccess

func ResolveGenerationAccess(ctx context.Context) (context.Context, *Verification, error)

ResolveGenerationAccess validates an attached token into commercial access state and returns its target coverage.

func (Verification) Covers

func (v Verification) Covers(target string) bool

Jump to

Keyboard shortcuts

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