Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientInfo ¶
type Config ¶
type Config struct {
// The optional path component of the issuer URL.
// If non-empty, it should start with a "/". It should not end with a "/".
// It affects the paths of the server endpoints.
IssuerPath string
// Configuration of the metadata endpoint.
MetadataEndpointConfig *MetadataEndpointConfig
// Configuration for client registration.
RegistrationConfig *RegistrationConfig
}
Config holds configuration for FakeAuthorizationServer.
type FakeAuthorizationServer ¶
type FakeAuthorizationServer struct {
Mux *http.ServeMux
// contains filtered or unexported fields
}
FakeAuthorizationServer is a fake OAuth 2.0 Authorization Server for testing.
func NewFakeAuthorizationServer ¶
func NewFakeAuthorizationServer(config Config) *FakeAuthorizationServer
NewFakeAuthorizationServer creates a new FakeAuthorizationServer. The server is simple and should not be used outside of testing. It supports: - Only the authorization Code Grant - PKCE verification - Client tracking & dynamic registration - Client authentication
func (*FakeAuthorizationServer) Start ¶
func (s *FakeAuthorizationServer) Start(t testing.TB)
Start starts the HTTP server and registers a cleanup function on t to close the server.
func (*FakeAuthorizationServer) URL ¶
func (s *FakeAuthorizationServer) URL() string
URL returns the base URL of the server (Issuer).
type MetadataEndpointConfig ¶
type MetadataEndpointConfig struct {
// Whether to serve the OAuth Authorization Server Metadata at
// /.well-known/oauth-authorization-server + issuerPath.
ServeOAuthInsertedEndpoint bool
// Whether to serve the OAuth Authorization Server Metadata at
// /.well-known/openid-configuration + issuerPath.
ServeOpenIDInsertedEndpoint bool
// Whether to serve the OAuth Authorization Server Metadata at
// issuerPath + /.well-known/openid-configuration.
// Should be used when issuerPath is not empty.
ServeOpenIDAppendedEndpoint bool
}
type RegistrationConfig ¶
type RegistrationConfig struct {
// Whether the client ID metadata document is supported.
ClientIDMetadataDocumentSupported bool
// PreregisteredClients is a map of valid ClientIDs to ClientSecrets.
PreregisteredClients map[string]ClientInfo
// Whether dynamic client registration is enabled.
DynamicClientRegistrationEnabled bool
}
Click to show internal directories.
Click to hide internal directories.