Versions in this module Expand all Collapse all v0 v0.1.0 Jun 20, 2026 Changes in this version + const FormContentType + const ResponseContentType + const SpecVersion + const TokenTypeHintAccessToken + const TokenTypeHintRefreshToken + var ErrInvalidResponse = errors.New("introspection: malformed response body") + var ErrTokenExpired = errors.New("introspection: token has expired") + var ErrTokenInactive = errors.New("introspection: token is not active") + var ErrTokenNotYetValid = errors.New("introspection: token is not yet valid") + var ErrUnauthorized = errors.New("introspection: endpoint rejected client authentication") + var ErrUnexpectedStatus = errors.New("introspection: unexpected response status") + var ErrValidation = errors.New("introspection: validation failed") + func WriteResponse(w http.ResponseWriter, resp *Response) error + type Audience []string + func (a *Audience) UnmarshalJSON(data []byte) error + func (a Audience) Contains(aud string) bool + func (a Audience) MarshalJSON() ([]byte, error) + type Client struct + func NewClient(endpoint string, opts ...ClientOption) *Client + func (c *Client) Introspect(ctx context.Context, req *Request) (*Response, error) + type ClientOption func(*Client) + func WithBasicAuth(clientID, clientSecret string) ClientOption + func WithHTTPClient(h *http.Client) ClientOption + type HTTPError struct + Status string + StatusCode int + func (e *HTTPError) Error() string + func (e *HTTPError) Unwrap() error + type NumericDate struct + func NewNumericDate(t time.Time) *NumericDate + func (n *NumericDate) UnmarshalJSON(data []byte) error + func (n NumericDate) MarshalJSON() ([]byte, error) + type Request struct + Token string + TokenTypeHint string + func ParseRequest(r *http.Request) (*Request, error) + func RequestFromValues(v url.Values) *Request + func (r *Request) EncodeForm() string + func (r *Request) FormValues() url.Values + type Response struct + Active bool + Audience Audience + ClientID string + Expiry *NumericDate + Extra map[string]json.RawMessage + IssuedAt *NumericDate + Issuer string + JWTID string + NotBefore *NumericDate + Scope string + Subject string + TokenType string + Username string + func (r *Response) GetExtra(name string, v any) (present bool, err error) + func (r *Response) Scopes() []string + func (r *Response) SetExtra(name string, v any) error + func (r *Response) UnmarshalJSON(data []byte) error + func (r *Response) Validate(opts ...ValidateOption) error + func (r Response) MarshalJSON() ([]byte, error) + type ValidateOption func(*validateConfig) + func WithClock(clock func() time.Time) ValidateOption + func WithLeeway(d time.Duration) ValidateOption + type ValidationError struct + Field string + Message string + func (e *ValidationError) Error() string + func (e *ValidationError) Unwrap() error