Documentation
¶
Index ¶
- Constants
- func ResolveReuseAuthorizer(in ReuseAuthorizerResolutionInput) bool
- func ReuseAuthorizerFromContext(ctx context.Context) (*bool, bool)
- func WithReuseAuthorizer(ctx context.Context, v bool) context.Context
- func WithReuseAuthorizerMode(ctx context.Context, m Mode) context.Context
- type Mode
- type ReuseAuthorizerResolutionInput
- type ReuseModeResolutionInput
Constants ¶
const BuiltInDefaultMode = ModeBearerFirst
Built-in default mode.
const ( // BuiltInDefaultReuseAuthorizer controls behavior when no source (context/client/CLI/env/provider/global) sets reuse. // Set to false so reuse is disabled unless explicitly enabled. BuiltInDefaultReuseAuthorizer = false )
Built-in defaults when nothing is configured.
Variables ¶
This section is empty.
Functions ¶
func ResolveReuseAuthorizer ¶
func ResolveReuseAuthorizer(in ReuseAuthorizerResolutionInput) bool
ResolveReuseAuthorizer applies precedence to determine the effective setting. Precedence: context > client > CLI > env > provider > global > built-in.
func ReuseAuthorizerFromContext ¶
ReuseAuthorizerFromContext returns the override if present.
func WithReuseAuthorizer ¶
WithReuseAuthorizer sets a per-request override.
Types ¶
type Mode ¶
type Mode string
Mode represents how to apply reused auth to MCP requests.
func ResolveReuseAuthorizerMode ¶
func ResolveReuseAuthorizerMode(in ReuseModeResolutionInput) Mode
ResolveReuseAuthorizerMode resolves the mode with precedence and normalization. Precedence: context > client > CLI > env > provider > global > built-in.
type ReuseAuthorizerResolutionInput ¶
type ReuseAuthorizerResolutionInput struct {
Ctx context.Context
ClientOpt *bool // MCPReuseAuthorizer pointer; nil if unspecified
CLIOpt *bool // CLI flag override; nil if unspecified
EnvOpt *bool // Env var override; nil if unspecified
ProviderOpt *bool // Provider config; nil if unspecified
GlobalOpt *bool // Global config default; nil if unspecified
}
ReuseAuthorizerResolutionInput aggregates potential sources for the setting.
type ReuseModeResolutionInput ¶
type ReuseModeResolutionInput struct {
Ctx context.Context
ClientOpt *string // MCPReuseAuthorizerMode pointer; nil if unspecified
CLIOpt *string // CLI flag override; nil if unspecified
EnvOpt *string // Env var override; nil if unspecified
ProviderOpt *string // Provider config; nil if unspecified
GlobalOpt *string // Global config default; nil if unspecified
}
ReuseModeResolutionInput aggregates potential sources for the mode.