kittest

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package kittest is the test JWKS issuer a module's tests use to mint bearers for modulekit.TokenVerifier: an RSA key pair, an httptest JWKS server and a signer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issuer

type Issuer struct {
	JWKS *httptest.Server
	Key  jwk.Key
}

Issuer serves one public key at JWKS.URL and signs with its private half.

func NewIssuer

func NewIssuer(t *testing.T) *Issuer

NewIssuer generates an RS256 key pair (kid "test-key") and starts the JWKS server; both are released on t.Cleanup.

func (*Issuer) Sign

func (i *Issuer) Sign(t *testing.T, issuer, audience, sub string, exp time.Time) string

Sign mints a signed token with the given issuer, audience, subject and expiry.

Jump to

Keyboard shortcuts

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