Documentation
¶
Overview ¶
Package scenario holds the godog test harness: a per-scenario context that boots the auth0-mock service in-process on a random port and provides HTTP helpers for the .feature step files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSteps ¶
func RegisterSteps(sc *godog.ScenarioContext, c *Context)
RegisterSteps wires the .feature step phrases to Go functions.
Types ¶
type Context ¶
type Context struct {
BaseURL string
BearerTok string
MFAToken string // captured from a 403 mfa_required response.
LastResp *http.Response
LastBody []byte
// SSEResp holds the response from a successful SSE subscription
// so subsequent steps (push, deliver) can read frames from its
// body without conflicting with assertions against LastResp.
SSEResp *http.Response
// contains filtered or unexported fields
}
Context is the per-scenario state passed to step definitions.
func New ¶
func New(t *testing.T, sc *godog.ScenarioContext) *Context
New constructs a fresh Context, boots the service in-process on a random localhost port, and registers cleanup hooks via godog.
func (*Context) MintBearer ¶
func (c *Context) MintBearer()
MintBearer issues a token via the live /oauth/token endpoint.
func (*Context) VerifyAccessTokenAgainstJWKS ¶
VerifyAccessTokenAgainstJWKS fetches the mock's JWKS and verifies the token's RS256 signature using golang-jwt + MicahParks/keyfunc.
Click to show internal directories.
Click to hide internal directories.