pkgtest

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 11 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 pkgtest provides utilities for testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateTestJWTExpiresAt

func GenerateTestJWTExpiresAt(exp time.Time) string

GenerateTestJWTExpiresAt generates a JWT with the given expiration time. The generated JWT is signed with the testKey.

func NewRequest added in v0.4.1

func NewRequest(method, target string, body io.Reader) *http.Request

NewRequest returns a new http.Request with a context containing an empty replacer.

func NewTestVerifier

func NewTestVerifier(clock func() time.Time) *oidc.IDTokenVerifier

NewTestVerifier returns a new IDTokenVerifier that uses the testKey for signing.

Types

type TestOIDCConfiguration

type TestOIDCConfiguration struct {
	Verifier      *oidc.IDTokenVerifier
	UsernameClaim string
	// contains filtered or unexported fields
}

TestOIDCConfiguration is a test implementation of OIDCConfiguration.

func (*TestOIDCConfiguration) GetUsernameClaim

func (c *TestOIDCConfiguration) GetUsernameClaim() string

func (*TestOIDCConfiguration) GetVerifier

func (*TestOIDCConfiguration) Now

func (c *TestOIDCConfiguration) Now() time.Time

Jump to

Keyboard shortcuts

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