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