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

dpoptest

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package dpoptest mints DPoP proofs for tests. It lives under internal/ so the enforcement tests in middleware, extension and authprovider can share one minting path instead of copying the JWS assembly into every package that needs to present a proof.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Key

func Key(t *testing.T) *ecdsa.PrivateKey

Key generates an ES256 key pair for a test client to hold.

func MintProof

func MintProof(t *testing.T, key *ecdsa.PrivateKey, alg string, claims map[string]any) string

MintProof builds a signed DPoP proof. Claims left out of claims are simply absent, so a test can produce a proof missing exactly one claim.

func Thumbprint

func Thumbprint(t *testing.T, key *ecdsa.PrivateKey) string

Thumbprint computes the RFC 7638 thumbprint a proof minted with key will carry, so a test can bind a session to it up front.

func ValidClaims

func ValidClaims(method, htu string) map[string]any

ValidClaims builds the mandatory claim set for a proof covering method against htu. Callers add ath themselves, since a proof presented at a protected resource needs it and a proof presented at a token endpoint does not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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