oidctest

package
v0.1.4607 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package oidctest serves an OIDC issuer on an httptest TLS server for the tests of package oidc and the gateway: its discovery document, its keys and the tokens it signs, never reaching the network.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issuer

type Issuer struct {
	URL     string
	Fetches atomic.Int32
	Down    atomic.Bool
	// contains filtered or unexported fields
}

Issuer is one issuer. Fetches counts the times its keys were read; Down makes it answer 503.

func New

func New(t testing.TB) *Issuer

New starts an issuer with one key, "k1", and points oidc.Client at it.

func (*Issuer) AddKey

func (is *Issuer) AddKey(t testing.TB, kid string) *rsa.PrivateKey

AddKey makes the issuer sign with a new key kid as well.

func (*Issuer) Sign

func (is *Issuer) Sign(t testing.TB, kid string, claims map[string]any, key ...*rsa.PrivateKey) string

Sign makes a token with claims, signed by the key kid (alg RS256), or by key when it is given (a key the issuer doesn't list).

Jump to

Keyboard shortcuts

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