config

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdminEncryptionKey added in v1.2.0

func AdminEncryptionKey(admin AdminConfig) ([]byte, error)

func HeaderMap

func HeaderMap(headers map[string]string) http.Header

Types

type AdminConfig added in v1.2.0

type AdminConfig struct {
	Enabled          bool     `yaml:"enabled"`
	Mode             string   `yaml:"mode"`
	PublicURL        string   `yaml:"public_url"`
	ClientID         string   `yaml:"client_id"`
	ClientSecretEnv  string   `yaml:"client_secret_env"`
	RequiredScopes   []string `yaml:"required_scopes"`
	DatabaseDriver   string   `yaml:"database_driver"`
	DatabaseDSNEnv   string   `yaml:"database_dsn_env"`
	Listen           string   `yaml:"listen"`
	DatabasePath     string   `yaml:"database_path"`
	EncryptionKeyEnv string   `yaml:"encryption_key_env"`
}

func (AdminConfig) Driver added in v1.4.0

func (admin AdminConfig) Driver() string

func (AdminConfig) Remote added in v1.4.0

func (admin AdminConfig) Remote() bool

type AuthConfig

type AuthConfig struct {
	Issuer string `yaml:"issuer"`
}

type BackendConfig

type BackendConfig struct {
	RateLimit         ratelimit.Config  `yaml:"rate_limit"`
	ID                string            `yaml:"id"`
	URL               string            `yaml:"url"`
	Required          bool              `yaml:"required"`
	RequiredScopes    []string          `yaml:"required_scopes"`
	ToolRules         []ToolRule        `yaml:"tool_rules"`
	RequestTimeout    Duration          `yaml:"request_timeout"`
	AllowInsecureHTTP bool              `yaml:"allow_insecure_http"`
	Headers           map[string]string `yaml:"headers"`
	OAuth             *OAuthConfig      `yaml:"oauth"`
}

func (BackendConfig) RequiredToolScopes added in v1.1.0

func (backend BackendConfig) RequiredToolScopes(toolName string) []string

type Config

type Config struct {
	Server   ServerConfig    `yaml:"server"`
	Auth     AuthConfig      `yaml:"auth"`
	Admin    AdminConfig     `yaml:"admin"`
	Backends []BackendConfig `yaml:"backends"`
}

func Load

func Load(path string) (*Config, error)

func LoadStatic added in v1.2.0

func LoadStatic(path string) (*Config, error)

LoadStatic loads server, auth, and admin configuration without expanding or validating YAML backends when the database-backed admin platform is enabled. This lets an initialized database remain the sole backend source even after bootstrap-only environment variables have been removed.

func (*Config) AllScopes

func (cfg *Config) AllScopes() []string

func (*Config) Backend

func (cfg *Config) Backend(id string) (BackendConfig, bool)

func (*Config) ImmutableEqual

func (cfg *Config) ImmutableEqual(other *Config) error

func (*Config) MCPPath

func (cfg *Config) MCPPath() string

func (*Config) ResourceMetadataPath

func (cfg *Config) ResourceMetadataPath() string

func (*Config) ResourceMetadataURL

func (cfg *Config) ResourceMetadataURL() string

func (*Config) Validate

func (cfg *Config) Validate() error

type Duration

type Duration struct {
	time.Duration
}

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(node *yaml.Node) error

type OAuthConfig

type OAuthConfig struct {
	Type         string   `yaml:"type"`
	Issuer       string   `yaml:"issuer"`
	ClientID     string   `yaml:"client_id"`
	ClientSecret string   `yaml:"client_secret"`
	Scopes       []string `yaml:"scopes"`
}

type ServerConfig

type ServerConfig struct {
	Listen              string   `yaml:"listen"`
	PublicURL           string   `yaml:"public_url"`
	PageSize            int      `yaml:"page_size"`
	RequestTimeout      Duration `yaml:"request_timeout"`
	DrainTimeout        Duration `yaml:"drain_timeout"`
	RefreshInterval     Duration `yaml:"refresh_interval"`
	CatalogTTL          Duration `yaml:"catalog_ttl"`
	MaxRequestBodyBytes int64    `yaml:"max_request_body_bytes"`
	AllowedOrigins      []string `yaml:"allowed_origins"`
}

type ToolRule added in v1.1.0

type ToolRule struct {
	Match          string   `yaml:"match" json:"match"`
	RequiredScopes []string `yaml:"required_scopes" json:"required_scopes"`
}

func (ToolRule) Matches added in v1.1.0

func (rule ToolRule) Matches(toolName string) bool

Jump to

Keyboard shortcuts

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