services

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 73 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditConfig added in v0.8.0

type AuditConfig audit.Options

type Config

type Config struct {
	HTTPListenPort             int      `usage:"HTTP port to listen on" default:"8080" name:"http-listen-port"`
	DevMode                    bool     `usage:"Enable development mode" default:"false" name:"dev-mode" env:"OBOT_DEV_MODE"`
	DevUIPort                  int      `usage:"The port on localhost running the dev instance of the UI" default:"5173"`
	UserUIPort                 int      `usage:"The port on localhost running the user production instance of the UI" env:"OBOT_SERVER_USER_UI_PORT"`
	AllowedOrigin              string   `usage:"Allowed origin for CORS"`
	ToolRegistries             []string `usage:"The remote tool references to the set of gptscript tool registries to use" default:"github.com/obot-platform/tools"`
	WorkspaceProviderType      string   `` /* 129-byte string literal not displayed */
	HelperModel                string   `usage:"The model used to generate names and descriptions" default:"gpt-4.1-mini"`
	EmailServerName            string   `usage:"The name of the email server to display for email receivers"`
	EnableSMTPServer           bool     `usage:"Enable SMTP server to receive emails" default:"false" env:"OBOT_ENABLE_SMTP_SERVER"`
	Docker                     bool     `usage:"Enable Docker support" default:"false" env:"OBOT_DOCKER"`
	EnvKeys                    []string `usage:"The environment keys to pass through to the GPTScript server" env:"OBOT_ENV_KEYS"`
	KnowledgeSetIngestionLimit int      `usage:"The maximum number of files to ingest into a knowledge set" default:"3000" name:"knowledge-set-ingestion-limit"`
	KnowledgeFileWorkers       int      `usage:"The number of workers to process knowledge files" default:"5"`
	RunWorkers                 int      `usage:"The number of workers to process runs" default:"1000"`
	ElectionFile               string   `usage:"Use this file for leader election instead of database leases"`
	EnableAuthentication       bool     `usage:"Enable authentication" default:"false"`
	ForceEnableBootstrap       bool     `usage:"Enables the bootstrap user even if other admin users have been created" default:"false"`
	AuthAdminEmails            []string `usage:"Emails of admin users"`
	AgentsDir                  string   `usage:"The directory to auto load agents on start (default $XDG_CONFIG_HOME/.obot/agents)"`
	StaticDir                  string   `usage:"The directory to serve static files from"`
	RetentionPolicyHours       int      `usage:"The retention policy for the system. Set to 0 to disable retention." default:"2160"` // default 90 days
	DefaultMCPCatalogPath      string   `usage:"The path to the default MCP catalog (accessible to all users)" default:""`
	// Sendgrid webhook
	SendgridWebhookUsername           string `usage:"The username for the sendgrid webhook to authenticate with"`
	SendgridWebhookPassword           string `usage:"The password for the sendgrid webhook to authenticate with"`
	MCPAuditLogPersistIntervalSeconds int    `usage:"The interval in seconds to persist MCP audit logs to the database" default:"5"`
	MCPAuditLogsPersistBatchSize      int    `usage:"The number of MCP audit logs to persist in a single batch" default:"1000"`

	GeminiConfig
	GatewayConfig
	EncryptionConfig
	OtelOptions
	AuditConfig
	RateLimiterConfig
	MCPConfig
	services.Config
}

type EncryptionConfig added in v0.8.0

type EncryptionConfig encryption.Options

type GatewayConfig

type GatewayConfig gserver.Options

type GeminiConfig added in v0.7.0

type GeminiConfig gemini.Config

type MCPConfig added in v0.8.0

type MCPConfig mcp.Options

type OAuthAuthorizationServerConfig added in v0.8.0

type OAuthAuthorizationServerConfig struct {
	// Issuer is the authorization server's issuer identifier, which is a URL that uses the "https" scheme
	// and has no query or fragment components. REQUIRED.
	Issuer string `json:"issuer"`
	// AuthorizationEndpoint is the URL of the authorization server's authorization endpoint.
	// REQUIRED unless no grant types are supported that use the authorization endpoint.
	AuthorizationEndpoint string `json:"authorization_endpoint"`
	// TokenEndpoint is the URL of the authorization server's token endpoint.
	// REQUIRED unless only the implicit grant type is supported.
	TokenEndpoint string `json:"token_endpoint"`
	// JWKSURI is the URL of the authorization server's JWK Set document.
	// OPTIONAL.
	JWKSURI string `json:"jwks_uri,omitempty"`
	// RegistrationEndpoint is the URL of the authorization server's OAuth 2.0 Dynamic Client Registration endpoint.
	// OPTIONAL.
	RegistrationEndpoint string `json:"registration_endpoint,omitempty"`
	// ScopesSupported is a JSON array containing a list of the OAuth 2.0 scope values that this authorization server supports.
	// RECOMMENDED.
	ScopesSupported []string `json:"scopes_supported,omitempty"`
	// ResponseTypesSupported is a JSON array containing a list of the OAuth 2.0 response_type values that this authorization server supports.
	// REQUIRED.
	ResponseTypesSupported []string `json:"response_types_supported"`
	// ResponseModesSupported is a JSON array containing a list of the OAuth 2.0 response_mode values that this authorization server supports.
	// OPTIONAL. Default is ["query", "fragment"].
	ResponseModesSupported []string `json:"response_modes_supported,omitempty"`
	// GrantTypesSupported is a JSON array containing a list of the OAuth 2.0 grant type values that this authorization server supports.
	// OPTIONAL. Default is ["authorization_code", "implicit"].
	GrantTypesSupported []string `json:"grant_types_supported,omitempty"`
	// TokenEndpointAuthMethodsSupported is a JSON array containing a list of client authentication methods supported by this token endpoint.
	// OPTIONAL. Default is "client_secret_basic".
	TokenEndpointAuthMethodsSupported []string `json:"token_endpoint_auth_methods_supported,omitempty"`
	// TokenEndpointAuthSigningAlgValuesSupported is a JSON array containing a list of the JWS signing algorithms supported by the token endpoint.
	// OPTIONAL. Required if "private_key_jwt" or "client_secret_jwt" authentication methods are specified.
	TokenEndpointAuthSigningAlgValuesSupported []string `json:"token_endpoint_auth_signing_alg_values_supported,omitempty"`
	// ServiceDocumentation is the URL of a page containing human-readable information that developers might want or need to know.
	// OPTIONAL.
	ServiceDocumentation string `json:"service_documentation,omitempty"`
	// UILocalesSupported is a JSON array of language tag values from BCP 47 for the user interface.
	// OPTIONAL.
	UILocalesSupported []string `json:"ui_locales_supported,omitempty"`
	// OPPolicyURI is the URL that the authorization server provides to read about the authorization server's requirements.
	// OPTIONAL.
	OPPolicyURI string `json:"op_policy_uri,omitempty"`
	// OPTosURI is the URL that the authorization server provides to read about the authorization server's terms of service.
	// OPTIONAL.
	OPTosURI string `json:"op_tos_uri,omitempty"`
	// RevocationEndpoint is the URL of the authorization server's OAuth 2.0 revocation endpoint.
	// OPTIONAL.
	RevocationEndpoint string `json:"revocation_endpoint,omitempty"`
	// RevocationEndpointAuthMethodsSupported is a JSON array containing a list of client authentication methods supported by this revocation endpoint.
	// OPTIONAL. Default is "client_secret_basic".
	RevocationEndpointAuthMethodsSupported []string `json:"revocation_endpoint_auth_methods_supported,omitempty"`
	// IntrospectionEndpoint is the URL of the authorization server's OAuth 2.0 introspection endpoint.
	// OPTIONAL.
	IntrospectionEndpoint string `json:"introspection_endpoint,omitempty"`
	// IntrospectionEndpointAuthMethodsSupported is a JSON array containing a list of client authentication methods supported by this introspection endpoint.
	// OPTIONAL.
	IntrospectionEndpointAuthMethodsSupported []string `json:"introspection_endpoint_auth_methods_supported,omitempty"`
	// IntrospectionEndpointAuthSigningAlgValuesSupported is a JSON array containing a list of the JWS signing algorithms supported by the introspection endpoint.
	// OPTIONAL. Required if "private_key_jwt" or "client_secret_jwt" authentication methods are specified.
	IntrospectionEndpointAuthSigningAlgValuesSupported []string `json:"introspection_endpoint_auth_signing_alg_values_supported,omitempty"`
	// CodeChallengeMethodsSupported is a JSON array containing a list of PKCE code challenge methods supported by this authorization server.
	// OPTIONAL. If omitted, the authorization server does not support PKCE.
	CodeChallengeMethodsSupported []string `json:"code_challenge_methods_supported,omitempty"`
}

OAuthAuthorizationServerConfig represents the response from /.well-known/oauth-authorization-server as defined in RFC 8414 (OAuth 2.0 Authorization Server Metadata)

type Otel added in v0.8.0

type Otel struct {
	// contains filtered or unexported fields
}

func (*Otel) Shutdown added in v0.8.0

func (s *Otel) Shutdown(ctx context.Context) error

type OtelOptions added in v0.8.0

type OtelOptions struct {
	SampleProb         float64 `usage:"The probability of sampling a trace" default:"0.1" name:"otel-sample-prob"`
	BaseExportEndpoint string  `` /* 133-byte string literal not displayed */
	BearerToken        string  `usage:"Bearer token for authentication" name:"otel-bearer-token"`
}

type RateLimiterConfig added in v0.8.0

type RateLimiterConfig ratelimiter.Options

type Services

type Services struct {
	ToolRegistryURLs           []string
	WorkspaceProviderType      string
	ServerURL                  string
	EmailServerName            string
	DevUIPort                  int
	UserUIPort                 int
	Events                     *events.Emitter
	StorageClient              storage.Client
	Router                     *router.Router
	GPTClient                  *gptscript.GPTScript
	Invoker                    *invoke.Invoker
	EphemeralTokenServer       *ephemeral.TokenService
	PersistentTokenServer      *persistent.TokenService
	APIServer                  *server.Server
	Started                    chan struct{}
	GatewayServer              *gserver.Server
	GatewayClient              *client.Client
	ProxyManager               *proxy.Manager
	ProviderDispatcher         *dispatcher.Dispatcher
	Bootstrapper               *bootstrap.Bootstrap
	KnowledgeSetIngestionLimit int
	SupportDocker              bool
	AuthEnabled                bool
	DefaultMCPCatalogPath      string
	AgentsDir                  string
	GeminiClient               *gemini.Client
	Otel                       *Otel
	AuditLogger                audit.Logger
	PostgresDSN                string
	RetentionPolicy            time.Duration
	// Use basic auth for sendgrid webhook, if being set
	SendgridWebhookUsername string
	SendgridWebhookPassword string

	// Used for indexed lookups of access control rules.
	AccessControlRuleHelper *accesscontrolrule.Helper

	WebhookHelper *mcp.WebhookHelper

	// Used for loading and running MCP servers with GPTScript.
	MCPLoader *mcp.SessionManager

	// Global token storage client for MCP OAuth
	MCPOAuthTokenStorage mcp.GlobalTokenStore

	// OAuth configuration
	OAuthServerConfig OAuthAuthorizationServerConfig

	// Local Kubernetes configuration for deployment monitoring
	LocalK8sConfig     *rest.Config
	MCPServerNamespace string
}

func New

func New(ctx context.Context, config Config) (*Services, error)

Jump to

Keyboard shortcuts

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