auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package auth provides fail-closed authentication middleware wrapping MCP tool, resource, and prompt handlers.

Index

Constants

This section is empty.

Variables

View Source
var ErrAuthenticationNotValidated = errors.New("TheHive authentication failed: credentials were not validated")

ErrAuthenticationNotValidated is returned when a request reaches a handler without the authentication marker set by the transport context function.

Functions

func AuthenticatedPromptHandlerFunc

func AuthenticatedPromptHandlerFunc(handler func(ctx context.Context, request mcp.GetPromptRequest) (*mcp.GetPromptResult, error)) func(ctx context.Context, request mcp.GetPromptRequest) (*mcp.GetPromptResult, error)

AuthenticatedPromptHandlerFunc wraps a prompt handler with authentication checking

func AuthenticationMiddleware

func AuthenticationMiddleware() server.ToolHandlerMiddleware

AuthenticationMiddleware returns a middleware function that requires a successful authentication marker before allowing tool operations to proceed

func ResourceAuthenticationMiddleware

func ResourceAuthenticationMiddleware() server.ResourceHandlerMiddleware

ResourceAuthenticationMiddleware returns a middleware function that requires a successful authentication marker before allowing resource operations to proceed

Types

This section is empty.

Jump to

Keyboard shortcuts

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