Help us shape the future of Go! Take the 2026 Go Developer Survey

oidctest

package
v0.31.2 Latest Latest
Warning

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

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

Documentation

Overview

Package oidctest provides a minimal in-process OIDC provider for tests. It serves a discovery document, JWKS, an auto-approving authorization endpoint, and a token endpoint, and can mint signed ID tokens directly.

Index

Constants

View Source
const ClientID = "epithet-test-client"

ClientID is the audience carried by every minted token.

View Source
const TokenEmail = "test@example.com"

TokenEmail is the profile email minted by the /token endpoint (browser-flow path).

Variables

This section is empty.

Functions

func Subject added in v0.27.0

func Subject(email string) string

Subject returns a deterministic test-only subject distinct from the email.

Types

type IdP

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

func New

func New(t *testing.T) *IdP

func (*IdP) Issuer

func (p *IdP) Issuer() string

func (*IdP) MintIDToken

func (p *IdP) MintIDToken(email string, expiresAt time.Time) string

func (*IdP) MintIDTokenWithAudience

func (p *IdP) MintIDTokenWithAudience(email, aud string, expiresAt time.Time) string

func (*IdP) MintIDTokenWithClaims added in v0.27.0

func (p *IdP) MintIDTokenWithClaims(email string, expiresAt time.Time, overrides map[string]any) string

MintIDTokenWithClaims overrides standard fixture claims. A nil value removes a claim, allowing malformed tokens to exercise the real validation boundary.

Jump to

Keyboard shortcuts

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