licensingtest

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package licensingtest signs licenses with ephemeral keys for tests. Keys exist only in memory for the duration of a test process.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Claims

func Claims(features ...licensing.Feature) map[string]any

Claims returns valid claims for a license that is active now and grants the features.

func EnterpriseService

func EnterpriseService(features ...licensing.Feature) *licensing.Service

EnterpriseService returns a loaded license service with an active license that grants the features.

func Header(keyID string) map[string]any

func JWKS

func JWKS(issuers ...*Issuer) []byte

JWKS returns the public JWKS document for the issuers.

func KeyListClaims

func KeyListClaims(version int64, signers ...*Issuer) map[string]any

KeyListClaims returns valid key list claims that trust the signers.

func KeyListHeader

func KeyListHeader(keyID string) map[string]any

func KeySet

func KeySet(issuers ...*Issuer) *licensing.KeySet

Types

type Issuer

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

func NewIssuer

func NewIssuer(keyID string) *Issuer

func (*Issuer) KeyList

func (i *Issuer) KeyList(version int64, signers ...*Issuer) []byte

KeyList signs, as a root key, a key list that trusts the signers.

func (*Issuer) License

func (i *Issuer) License(features ...licensing.Feature) []byte

License signs a valid license that grants the features.

func (*Issuer) RevocationList

func (i *Issuer) RevocationList(version int64, ids ...uuid.UUID) []byte

RevocationList signs, as a root key, a revocation list that names the ids.

func (*Issuer) Sign

func (i *Issuer) Sign(claims map[string]any) []byte

Sign returns a compact JWS license for the claims.

func (*Issuer) SignWithHeader

func (i *Issuer) SignWithHeader(header map[string]any, claims map[string]any) []byte

type StaticSource

type StaticSource struct {
	Raw []byte
}

StaticSource is a read-only license source for tests.

func (StaticSource) Kind

func (StaticSource) Read

func (s StaticSource) Read(context.Context) ([]byte, error)

Jump to

Keyboard shortcuts

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