Documentation
¶
Overview ¶
Package oidctest provides a minimal in-process OIDC provider for tests. It serves a discovery document, JWKS, an auto-approving authorization endpoint, and a token endpoint, and can mint signed ID tokens directly.
Index ¶
- Constants
- func Subject(email string) string
- type IdP
- func (p *IdP) Issuer() string
- func (p *IdP) MintIDToken(email string, expiresAt time.Time) string
- func (p *IdP) MintIDTokenWithAudience(email, aud string, expiresAt time.Time) string
- func (p *IdP) MintIDTokenWithClaims(email string, expiresAt time.Time, overrides map[string]any) string
- func (p *IdP) SetDiscoveryAvailable(available bool)
Constants ¶
View Source
const ClientID = "epithet-test-client"
ClientID is the audience carried by every minted token.
View Source
const TokenEmail = "test@example.com"
TokenEmail is the profile email minted by the /token endpoint (browser-flow path).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IdP ¶
type IdP struct {
// contains filtered or unexported fields
}
func (*IdP) MintIDTokenWithAudience ¶
func (*IdP) MintIDTokenWithClaims ¶
func (p *IdP) MintIDTokenWithClaims(email string, expiresAt time.Time, overrides map[string]any) string
MintIDTokenWithClaims overrides standard fixture claims. A nil value removes a claim, allowing malformed tokens to exercise the real validation boundary.
func (*IdP) SetDiscoveryAvailable ¶
SetDiscoveryAvailable simulates a provider outage without changing its issuer or signing keys, including while clients are attempting discovery.
Click to show internal directories.
Click to hide internal directories.