 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package config provides configuration management for the CLI Proxy API server. It handles loading and parsing YAML configuration files, and provides structured access to application settings including server port, authentication directory, debug settings, proxy configuration, and API keys.
Index ¶
Constants ¶
      View Source
      
  
const ( // AccessProviderTypeConfigAPIKey is the built-in provider validating inline API keys. AccessProviderTypeConfigAPIKey = "config-api-key" // DefaultAccessProviderName is applied when no provider name is supplied. DefaultAccessProviderName = "config-inline" )
Variables ¶
This section is empty.
Functions ¶
func SyncInlineAPIKeys ¶
SyncInlineAPIKeys updates the inline API key provider and top-level APIKeys field.
Types ¶
type AccessConfig ¶
type AccessConfig struct {
	// Providers lists configured authentication providers.
	Providers []AccessProvider `yaml:"providers" json:"providers"`
}
    AccessConfig groups request authentication providers.
type AccessProvider ¶
type AccessProvider struct {
	// Name is the instance identifier for the provider.
	Name string `yaml:"name" json:"name"`
	// Type selects the provider implementation registered via the SDK.
	Type string `yaml:"type" json:"type"`
	// SDK optionally names a third-party SDK module providing this provider.
	SDK string `yaml:"sdk,omitempty" json:"sdk,omitempty"`
	// APIKeys lists inline keys for providers that require them.
	APIKeys []string `yaml:"api-keys,omitempty" json:"api-keys,omitempty"`
	// Config passes provider-specific options to the implementation.
	Config map[string]any `yaml:"config,omitempty" json:"config,omitempty"`
}
    AccessProvider describes a request authentication provider entry.
type SDKConfig ¶
type SDKConfig struct {
	// ProxyURL is the URL of an optional proxy server to use for outbound requests.
	ProxyURL string `yaml:"proxy-url" json:"proxy-url"`
	// RequestLog enables or disables detailed request logging functionality.
	RequestLog bool `yaml:"request-log" json:"request-log"`
	// APIKeys is a list of keys for authenticating clients to this proxy server.
	APIKeys []string `yaml:"api-keys" json:"api-keys"`
	// Access holds request authentication provider configuration.
	Access AccessConfig `yaml:"auth" json:"auth"`
}
    SDKConfig represents the application's configuration, loaded from a YAML file.
func (*SDKConfig) ConfigAPIKeyProvider ¶
func (c *SDKConfig) ConfigAPIKeyProvider() *AccessProvider
ConfigAPIKeyProvider returns the first inline API key provider if present.
 Click to show internal directories. 
   Click to hide internal directories.