Documentation
¶
Overview ¶
Package testidp is a stand-in OpenID provider for tests: discovery, a signing key, an authorization endpoint and a token endpoint that hold a relying party to the parts of the protocol the registry depends on (the registered client, PKCE, single-use codes, the nonce), and sign real ID tokens for whoever a test says is signing in. A test signs people in through it the way a deployment's own OpenID provider would, with no directory and no password anywhere.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IdP ¶
type IdP struct {
URL string
ClientID string
ClientSecret string
// contains filtered or unexported fields
}
IdP is one running stand-in provider. Its issuer is URL; the registry is registered as ClientID with ClientSecret.
func (*IdP) Authorize ¶
Authorize is the browser's visit to the authorization URL the relying party redirected to: it returns the code and the state the provider sends back to the redirect URI, for the person SignInAs named. An authorization the provider refuses fails the test.
type Person ¶
type Person struct {
// Subject is the token's `sub`.
Subject string
// Email and EmailVerified are `email` and `email_verified`.
Email string
EmailVerified bool
// Username is `preferred_username`, omitted when empty.
Username string
// AMR is `amr`, omitted when nil.
AMR []string
// AuthTime is `auth_time`, omitted when zero.
AuthTime time.Time
// Claims ride the token as given, over the ones above.
Claims map[string]any
}
Person is who the next sign-in is for, and what the ID token says of them.