auth

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildHTTPClient

func BuildHTTPClient(
	setupCtx context.Context,
	lifecycleCtx context.Context,
	server *mcpserverapi.MCPServer,
	secrets *compstore.ComponentStore,
	jwt security.Handler,
) (*http.Client, error)

BuildHTTPClient returns an http.Client configured with:

  1. Static header injection from transport headers.
  2. OAuth2 client credentials token injection (if auth.oauth2 is set; errors if secrets is nil).
  3. SPIFFE JWT injection via the configured header (if auth.spiffe.jwt is set and jwt != nil).

OAuth2 and SPIFFE are mutually exclusive in practice; if both are configured, OAuth2 takes precedence and SPIFFE is ignored.

setupCtx controls one-shot setup work (secret fetches). lifecycleCtx controls background work that must outlive the connection setup, specifically the OAuth2 token refresher, which is invoked on every token expiry for the lifetime of the returned client.

func HTTPTransportConfig

func HTTPTransportConfig(server *mcpserverapi.MCPServer) ([]commonapi.NameValuePair, *mcpserverapi.MCPAuth)

HTTPTransportConfig extracts headers and auth from whichever HTTP transport is configured on the MCPServer. Returns nil slices/pointers for stdio.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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