Documentation
¶
Overview ¶
Package testing makes the keys and proofs that tests of DPoP need.
A proof is assembled here by hand rather than through utils_go's token encoder, so that a test can write what no conforming client would: an "alg" of "none", a "jwk" naming a key other than the one that signed, an "iat" an hour old. The defaults are what a conforming client sends.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func KeyThumbprint ¶
KeyThumbprint is the key's RFC 7638 thumbprint as utils_go computes it, which is a second implementation to hold the one under test to rather than a copy of it.
func MakeProof ¶
func MakeProof( privateKey *ecdsa.PrivateKey, method string, targetUri string, accessToken string, mutate func(header map[string]any, payload map[string]any), ) string
MakeProof makes a proof for a request: method and targetUri as "htm" and "htu", a fresh "jti", "iat" now, and "ath" when accessToken is not empty. mutate, when not nil, may change the header and payload before they are signed by privateKey.
func NewKey ¶
func NewKey() *ecdsa.PrivateKey
NewKey makes a P-256 key, the kind a client holds in Android Keystore or a key manager.
Types ¶
This section is empty.