authhttp

package
v0.0.0-...-ae5b880 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 13 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

View Source
const RegisterPath = "/oauth/register"

RegisterPath is the dynamic client registration endpoint.

Variables

This section is empty.

Functions

This section is empty.

Types

type OAuthClientRegistrar

type OAuthClientRegistrar interface {
	Execute(ctx context.Context, name string, redirectURIs []string) (*authservice.OAuthClient, error)
}

OAuthClientRegistrar registers OAuth clients.

type OAuthCodeExchanger

type OAuthCodeExchanger interface {
	Execute(ctx context.Context, code, verifier, clientID, redirectURI string) (*authservice.OAuthTokens, error)
}

OAuthCodeExchanger exchanges authorization codes for tokens.

type OAuthHTTPHandler

type OAuthHTTPHandler struct {
	// contains filtered or unexported fields
}

OAuthHTTPHandler serves the OAuth discovery, registration and token endpoints.

func NewOAuthHTTPHandler

func NewOAuthHTTPHandler(urls OAuthURLs, limiter RequestLimiter, register OAuthClientRegistrar, exchange OAuthCodeExchanger, refresh OAuthTokenRefresher) *OAuthHTTPHandler

NewOAuthHTTPHandler serves the OAuth endpoints. limiter limits client registration, which needs no credentials, per client IP under the key RegisterPath.

func (*OAuthHTTPHandler) Register

func (h *OAuthHTTPHandler) Register(router *mux.Router)

type OAuthTokenRefresher

type OAuthTokenRefresher interface {
	Execute(ctx context.Context, refreshToken, clientID string) (*authservice.OAuthTokens, error)
}

OAuthTokenRefresher rotates refresh tokens.

type OAuthURLs

type OAuthURLs struct {
	// Public is the base URL of the MCP server: the protected resource, the
	// issuer and the host of the token and registration endpoints.
	Public string
	// UI is the base URL of the main UI, which serves /oauth/authorize. Empty
	// leaves the authorization server metadata unserved.
	UI string
}

OAuthURLs are the base URLs the OAuth metadata names.

type OIDCHTTPHandler

type OIDCHTTPHandler struct {
	// contains filtered or unexported fields
}

OIDCHTTPHandler provides plain HTTP endpoints for OIDC login/callback flows.

func NewOIDCHTTPHandler

func NewOIDCHTTPHandler(startOIDCLogin *authservice.StartOIDCLogin, handleOIDCCallback *authservice.HandleOIDCCallback, frontendURL string, logger *logging.Logger, cookieConfig connectutil.CookieConfig, stateTTL time.Duration) *OIDCHTTPHandler

NewOIDCHTTPHandler creates a new OIDC HTTP handler. stateTTL is how long a started login stays valid.

func (*OIDCHTTPHandler) Register

func (h *OIDCHTTPHandler) Register(router *mux.Router)

type RequestLimiter

type RequestLimiter interface {
	// AllowRequest reports whether a request to the endpoint key may proceed.
	AllowRequest(key string, r *http.Request) bool
}

RequestLimiter rate-limits plain HTTP endpoints per client.

Jump to

Keyboard shortcuts

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