introspect

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2024 License: MIT Imports: 5 Imported by: 0

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"`
	Audience   string `json:"aud,omitempty"`
	ClientID   string `json:"client_id,omitempty"`
	Expiration int    `json:"exp,omitempty"`
	IssuedAt   int    `json:"iat,omitempty"`
	Issuer     string `json:"iss,omitempty"`
	JWTID      string `json:"jti,omitempty"`
	NotBefore  int    `json:"nbf,omitempty"`
	Scope      string `json:"scope,omitempty"`
	Subject    string `json:"sub,omitempty"`
	TokenType  string `json:"token_type,omitempty"`
	Username   string `json:"username,omitempty"`
}

IntrospectResponse is defined in RFC-7662: https://datatracker.ietf.org/doc/html/rfc7662

func (IntrospectResponse) Clone added in v0.21.8

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) error

func (MockServer) NewServeMux

func (ms MockServer) NewServeMux() *http.ServeMux

func (MockServer) PostIntrospect

func (ms MockServer) PostIntrospect(w http.ResponseWriter, r *http.Request)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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