Documentation
¶
Overview ¶
Package oidctokentest provides a fake OpenID provider for tests of code that mints tokens with package oidctoken.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Issuer ¶
type Issuer struct {
Server *httptest.Server
// Response is encoded as the token endpoint's JSON body.
Response map[string]any
// contains filtered or unexported fields
}
Issuer is an in-process OpenID provider serving discovery and a token endpoint over TLS with a self-signed certificate, so sources pointed at it need InsecureSkipVerify. It records the last token request and counts the calls; Response is what the token endpoint returns and may be edited between requests.
func NewIssuer ¶
NewIssuer starts an issuer advertising the client_credentials, password, and refresh_token grants and the given token endpoint authentication methods. It is closed when the test ends.
func (*Issuer) SetResponse ¶
SetResponse replaces one field of the token response.
func (*Issuer) TokenCalls ¶
TokenCalls is how many times the token endpoint has been called.