introspection

package
v0.0.1-dev.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(backend Backend, bearer string) http.Handler

Handler serves the RFC 7662 §2 introspection endpoint. The caller authenticates with a bearer token, which RFC 7662 §2.1 allows in place of client authentication.

Types

type Backend

type Backend interface {
	Introspect(context.Context, string) (Result, error)
}

type Result

type Result struct {
	Active    bool                       `json:"active"`
	TokenType string                     `json:"token_type,omitempty"`
	Issuer    string                     `json:"iss,omitempty"`
	Subject   string                     `json:"sub,omitempty"`
	ClientID  string                     `json:"client_id,omitempty"`
	Expiry    int64                      `json:"exp,omitempty"`
	NotBefore int64                      `json:"nbf,omitempty"`
	Audience  []string                   `json:"aud,omitempty"`
	Scope     string                     `json:"scope,omitempty"`
	Act       json.RawMessage            `json:"act,omitempty"`
	Claims    map[string]json.RawMessage `json:"-"`
}

Result uses RFC 7662 §2.2 introspection fields; only active is universally required. The act extension is defined by RFC 8693 §4.1.

func (Result) MarshalJSON

func (r Result) MarshalJSON() ([]byte, error)

func (*Result) UnmarshalJSON

func (r *Result) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL