introspect

package
v0.21.6 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: MIT Imports: 2 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"`
	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)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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