Documentation
¶
Overview ¶
Package oauthtest provides an in-memory OAuth 2.1 authorization server for tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
*httptest.Server
Codes map[string]string // code -> expected code_verifier
Refresh map[string]bool // live refresh tokens
Revoked []string
DevicePolls int32
// DeviceAnswers is consumed in order by device token polls: "authorization_pending", "slow_down", "access_denied" or "ok"
DeviceAnswers []string
TokenCalls int32
NoOAuth bool // discovery answers 404
// AcceptAnyVerifier accepts a registered code with any non-empty code_verifier (the verifier is generated by the code under test).
AcceptAnyVerifier bool
// NoRevocation omits revocation_endpoint from the discovery document.
NoRevocation bool
// TokenStatus, when non-zero, makes the token endpoint answer this status with temporarily_unavailable.
TokenStatus int
// KeepRefresh makes refresh grants answer without a refresh_token and keep the presented one live (no rotation).
KeepRefresh bool
// contains filtered or unexported fields
}
Server is a fake Webda OAuth server: discovery, token (code, refresh with rotation, device), revoke, device_authorization.
func (*Server) CurrentAccessToken ¶
CurrentAccessToken returns the last access token issued ("" before any).
Click to show internal directories.
Click to hide internal directories.