middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetAccountExtractorMiddlewareProvider

func SetAccountExtractorMiddlewareProvider(provider AccountExtractorMiddlewareProvider)

SetAccountExtractorMiddlewareProvider allows setting a custom account extractor middleware provider This is useful for testing or custom implementations

func WithHarnessScope

func WithHarnessScope(config *config.McpServerConfig) server.ToolHandlerMiddleware

WithHarnessScope creates a middleware that extracts the scope from the request and adds it to the context for all tool handlers

Types

type AccountExtractorMiddlewareProvider

type AccountExtractorMiddlewareProvider interface {
	// AccountExtractorMiddleware creates an HTTP middleware that injects the account scope into the context
	// For external mode, authentication is handled via API keys in the HTTP client
	CreateAccountExtractorMiddleware(ctx context.Context, config *config.McpServerConfig, next http.Handler) http.Handler
}

AccountExtractorMiddlewareProvider is the interface for creating authentication middleware Different implementations can be provided for internal and external modes

var DefaultAccountExtractorMiddlewareProvider AccountExtractorMiddlewareProvider

DefaultAccountExtractorMiddlewareProvider holds the active account extractor middleware provider implementation This will be set by the specific implementation (internal or external) during initialization

Jump to

Keyboard shortcuts

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