Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IntrospectResponse ¶
type IntrospectResponse struct { Active bool `json:"active"` Scope string `json:"scope,omitempty"` ClientID string `json:"client_id,omitempty"` Username string `json:"username,omitempty"` Exp int `json:"exp,omitempty"` }
IntrospectResponse is defined in RFC-7662: https://datatracker.ietf.org/doc/html/rfc7662
type MockServer ¶
type MockServer struct { Response IntrospectResponse ActiveTokens map[string]int }
MockServer is a mock server that implements RFC-7662 OAuth 2.0 Introspection API endpoint for testing purposes.
func NewMockServer ¶
func NewMockServer(r IntrospectResponse, activeTokens []string) MockServer
func (MockServer) ListenAndServe ¶
func (ms MockServer) ListenAndServe(addr string)
func (MockServer) NewServeMux ¶
func (ms MockServer) NewServeMux() *http.ServeMux
func (MockServer) PostIntrospect ¶
func (ms MockServer) PostIntrospect(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.