Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FallbackEnabledSessionCrypto ¶ added in v0.5.0
type FallbackEnabledSessionCrypto struct {
Primary, Fallback SessionCrypto
}
FallbackEnabledSessionCrypto tries to decrypt using the primary SessionCrypto first for decryption. If that fails and a fallback SessionCrypto is provided, it tries to decrypt using the fallback.
type ProxyConfig ¶
type ProxyConfig struct {
// contains filtered or unexported fields
}
ProxyConfig holds the main MCP proxy configuration. This implements filterapi.ConfigReceiver to gets the up-to-date configuration.
func NewMCPProxy ¶
func NewMCPProxy(l *slog.Logger, mcpMetrics metrics.MCPMetrics, tracer tracingapi.MCPTracer, sessionCrypto SessionCrypto, logRequestHeaderAttributes map[string]string) (*ProxyConfig, *http.ServeMux, error)
NewMCPProxy creates a new MCPProxy instance.
func (*ProxyConfig) LoadConfig ¶
LoadConfig implements [extproc.ConfigReceiver.LoadConfig] which will be called when the configuration is updated on the file system.
type SessionCrypto ¶
type SessionCrypto interface {
// Encrypt encrypts the given plaintext string and returns ciphertext.
Encrypt(plaintext string) (string, error)
// Decrypt decrypts the given ciphertext string and returns plaintext bytes.
Decrypt(encrypted string) (string, error)
}
SessionCrypto provides methods to encrypt and decrypt session data.
func NewPBKDF2AesGcmSessionCrypto ¶ added in v0.5.0
func NewPBKDF2AesGcmSessionCrypto(seed string, iterations int) SessionCrypto
NewPBKDF2AesGcmSessionCrypto creates a SessionCrypto using PBKDF2 for key derivation and AES-GCM for encryption.