Documentation
¶
Index ¶
- func AllowedTools(u kuser.Info, profiles []types.VMCPProfile, ...) []types.VMCPToolReference
- func ApplyFixedSecretBindings(component types.VMCPComponent, config []types.MCPConfig)
- func ComponentConfig(component types.VMCPComponent) []types.MCPConfig
- func ComponentOAuthCredentialReference(component types.VMCPComponent) string
- func ComponentsForInstance(vmcp v1.VMCP, instance v1.VMCPInstance) []types.VMCPComponent
- func ConfigurationCheckHash(enabledComponents []types.VMCPComponent, configurationSyncHash string) string
- func ConfigurationCredentialName() string
- func ConfigurationKey(componentID, key string) string
- func ConnectionConfiguration(component types.VMCPComponent) []types.MCPConfig
- func ConnectionConfigurationHash(config []types.MCPConfig, instance v1.VMCPInstance) string
- func ConnectionConfigurationSynced(connection v1.MCPServerInstance, component types.VMCPComponent, ...) bool
- func EnabledComponents(u kuser.Info, vmcp v1.VMCP, components []types.VMCPComponent) []types.VMCPComponent
- func ExtractStaticConfiguration(manifest *types.VMCPManifest, existingConfig map[string]string) map[string]string
- func FindInstance(ctx context.Context, client kclient.Client, namespace, vmcpID, userID string) (*v1.VMCPInstance, error)
- func FindInstances(ctx context.Context, client kclient.Client, namespace, userID string) (map[string]*v1.VMCPInstance, error)
- func GrantedToolOverrides(componentID string, overrides []types.ToolOverride, ...) ([]types.ToolOverride, bool)
- func InitializeComponentIDs(manifest *types.VMCPManifest) error
- func InstanceConfigurationCredentialContext(instanceID string) string
- func InstanceGrant(u kuser.Info, vmcp v1.VMCP, instance v1.VMCPInstance) []types.VMCPToolReference
- func IsMultiUser(component types.VMCPComponent) bool
- func LegacyComponent(vmcp v1.VMCP, instance v1.VMCPInstance, component types.VMCPComponent) (types.VMCPComponent, bool)
- func LegacyComponentNeedsUpdate(legacy, component types.VMCPComponent) bool
- func LegacySnapshot(legacy, component types.VMCPComponent) types.MCPServerCatalogEntrySnapshot
- func LegacySourceDigests(snapshot types.MCPServerCatalogEntrySnapshot) []string
- func MatchingProfiles(u kuser.Info, profiles []types.VMCPProfile) []types.VMCPProfile
- func MissingRequiredConfiguration(component types.VMCPComponent, values map[string]string, userInputs bool) []string
- func NeedsUpdate(component types.VMCPComponent, current types.MCPServerCatalogEntrySnapshot) bool
- func OAuthCredentialCheckHash(req router.Request, namespace, reference, sourceID string) (string, error)
- func ParseConfigurationKey(key string) (componentID, configurationKey string, ok bool)
- func PruneRemovedComponentProfiles(previous []types.VMCPComponent, manifest *types.VMCPManifest)
- func ReconcileComponentIDs(existing types.VMCPManifest, desired *types.VMCPManifest) error
- func ResolveConnectID(ctx context.Context, client kclient.Client, id, userID string) (*v1.VMCP, *v1.VMCPInstance, error)
- func ResolveID(ctx context.Context, client kclient.Client, id string) (*v1.VMCP, *v1.VMCPInstance, error)
- func SameConnectionConfiguration(a, b []types.MCPConfig) bool
- func ServerConfigurationSynced(server v1.MCPServer, vmcp v1.VMCP, instance v1.VMCPInstance) bool
- func ServerInstanceComponent(ctx context.Context, client kclient.Client, connection v1.MCPServerInstance, ...) (types.VMCPComponent, error)
- func ServerOAuthCredentialReference(ctx context.Context, client kclient.Reader, server v1.MCPServer) (reference, sourceID string, err error)
- func SetStaticConfigurationHashes(vmcp *v1.VMCP, configuration map[string]string)
- func SourceDigest(snapshot types.MCPServerCatalogEntrySnapshot) string
- func StaticConfigurationCredentialContext(vmcpID string) string
- func StaticConfigurationCredentialName(vmcp *v1.VMCP) string
- func StaticOAuthCredentialReference(manifest types.MCPServerCatalogEntryManifest, entryID string) string
- func ToolGranted(grant []types.VMCPToolReference, tool types.VMCPToolReference) bool
- func ValidateAndEncodeUserConfiguration(manifest types.VMCPManifest, configuration types.VMCPConfiguration) (map[string]string, error)
- func VersionStaticConfiguration(vmcp *v1.VMCP, configuration map[string]string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowedTools ¶
func AllowedTools(u kuser.Info, profiles []types.VMCPProfile, selection map[string]types.VMCPComponentSet) []types.VMCPToolReference
AllowedTools returns component-scoped original names. Nil means unrestricted, while an empty non-nil slice grants no tools. Instance selections can only narrow grants. A name of "*" grants all tools enabled on that component.
func ApplyFixedSecretBindings ¶ added in v0.26.2
func ApplyFixedSecretBindings(component types.VMCPComponent, config []types.MCPConfig)
ApplyFixedSecretBindings binds fixed configuration to the Secrets selected by vMCP policy so the runtime resolves them the same way as catalog bindings.
func ComponentConfig ¶
func ComponentConfig(component types.VMCPComponent) []types.MCPConfig
ComponentConfig applies vMCP policy rather than the source catalog's sharing flags.
func ComponentOAuthCredentialReference ¶
func ComponentOAuthCredentialReference(component types.VMCPComponent) string
func ComponentsForInstance ¶
func ComponentsForInstance(vmcp v1.VMCP, instance v1.VMCPInstance) []types.VMCPComponent
ComponentsForInstance retains a migrated connection's snapshots until the administrator explicitly upgrades the corresponding vMCP component.
func ConfigurationCheckHash ¶ added in v0.26.2
func ConfigurationCheckHash(enabledComponents []types.VMCPComponent, configurationSyncHash string) string
ConfigurationCheckHash identifies the user configuration status of an instance. Components must already be limited to those enabled for the instance user.
func ConfigurationCredentialName ¶
func ConfigurationCredentialName() string
ConfigurationCredentialName is the name used for VMCP configuration credentials.
func ConfigurationKey ¶
ConfigurationKey qualifies a configuration key with its VMCP component ID. Component IDs cannot contain periods, so configuration keys may contain them without making the encoded key ambiguous.
func ConnectionConfiguration ¶ added in v0.26.2
func ConnectionConfiguration(component types.VMCPComponent) []types.MCPConfig
ConnectionConfiguration returns the user-supplied configuration a shared component connection carries. It is nil when there is none, matching what storage returns for an empty Config.
func ConnectionConfigurationHash ¶ added in v0.26.2
func ConnectionConfigurationHash(config []types.MCPConfig, instance v1.VMCPInstance) string
ConnectionConfigurationHash identifies the configuration a shared component connection was last synchronized with.
func ConnectionConfigurationSynced ¶ added in v0.26.2
func ConnectionConfigurationSynced(connection v1.MCPServerInstance, component types.VMCPComponent, instance v1.VMCPInstance) bool
ConnectionConfigurationSynced reports whether a shared component connection's credential reflects the instance user's current configuration.
func EnabledComponents ¶ added in v0.26.2
func EnabledComponents(u kuser.Info, vmcp v1.VMCP, components []types.VMCPComponent) []types.VMCPComponent
EnabledComponents removes the components that no matching profile enables. A component is enabled by a profile that allows all components or that has an entry for it in AllowedComponents. Disabled components need no connection, configuration, or OAuth. Profiles do not apply to personal VMCPs.
func ExtractStaticConfiguration ¶
func ExtractStaticConfiguration(manifest *types.VMCPManifest, existingConfig map[string]string) map[string]string
ExtractStaticConfiguration removes fixed values from a manifest and returns them in the flat representation used by the credential store. Empty values are omitted because they represent missing configuration.
func FindInstance ¶
func FindInstance(ctx context.Context, client kclient.Client, namespace, vmcpID, userID string) (*v1.VMCPInstance, error)
FindInstance chooses the oldest connection for a canonical vMCP URL. Migrated users may have several connections; their legacy URLs still select each one.
func FindInstances ¶ added in v0.27.0
func FindInstances(ctx context.Context, client kclient.Client, namespace, userID string) (map[string]*v1.VMCPInstance, error)
FindInstances chooses the same connection as FindInstance for every vMCP the user has connected to, keyed by vMCP ID, using a single list.
func GrantedToolOverrides ¶ added in v0.26.2
func GrantedToolOverrides(componentID string, overrides []types.ToolOverride, grant []types.VMCPToolReference) ([]types.ToolOverride, bool)
GrantedToolOverrides narrows a component's tool overrides to a grant, matching stable component identities and original tool names. The second result is false when the grant leaves the component unrestricted. Without overrides, every discovered tool is available, so the granted names become enabled overrides.
func InitializeComponentIDs ¶
func InitializeComponentIDs(manifest *types.VMCPManifest) error
InitializeComponentIDs assigns new IDs to every component during VMCP creation. Clients cannot choose IDs because they form part of the credential namespace.
func InstanceConfigurationCredentialContext ¶
InstanceConfigurationCredentialContext scopes user configuration to a VMCP instance.
func InstanceGrant ¶ added in v0.26.2
func InstanceGrant(u kuser.Info, vmcp v1.VMCP, instance v1.VMCPInstance) []types.VMCPToolReference
InstanceGrant returns the tools an instance's user may call. The user is only consulted for shared VMCPs; a personal VMCP grants only its owner's selection. Nil means unrestricted, while an empty non-nil slice grants no tools.
func IsMultiUser ¶
func IsMultiUser(component types.VMCPComponent) bool
IsMultiUser permits a shared runtime only when user inputs are headers.
func LegacyComponent ¶ added in v0.27.0
func LegacyComponent(vmcp v1.VMCP, instance v1.VMCPInstance, component types.VMCPComponent) (types.VMCPComponent, bool)
LegacyComponent returns the snapshot a migrated connection retains for a vMCP component. A retained snapshot is bound to the component it was migrated with, so any change to the component releases it.
func LegacyComponentNeedsUpdate ¶ added in v0.27.0
func LegacyComponentNeedsUpdate(legacy, component types.VMCPComponent) bool
LegacyComponentNeedsUpdate reports whether a retained snapshot deploys a different server than its vMCP component, so that releasing it would update the connection.
func LegacySnapshot ¶ added in v0.27.0
func LegacySnapshot(legacy, component types.VMCPComponent) types.MCPServerCatalogEntrySnapshot
LegacySnapshot returns a retained snapshot without its connection's configuration, so that it can be shown to anyone who can read the vMCP.
func LegacySourceDigests ¶ added in v0.27.0
func LegacySourceDigests(snapshot types.MCPServerCatalogEntrySnapshot) []string
LegacySourceDigests returns the forms a source digest of the snapshot took before SourceDigest: the form that still included the repository, entry key, and tool preview, and a digest of the whole snapshot.
func MatchingProfiles ¶
func MatchingProfiles(u kuser.Info, profiles []types.VMCPProfile) []types.VMCPProfile
MatchingProfiles uses both Obot and authentication-provider groups.
func MissingRequiredConfiguration ¶
func MissingRequiredConfiguration(component types.VMCPComponent, values map[string]string, userInputs bool) []string
MissingRequiredConfiguration checks either administrator inputs or user inputs. Catalog literals and secret bindings are already supplied by the definition. Returned keys are component-scoped, so identical keys never become ambiguous.
func NeedsUpdate ¶ added in v0.26.2
func NeedsUpdate(component types.VMCPComponent, current types.MCPServerCatalogEntrySnapshot) bool
NeedsUpdate reports whether a component's source has drifted from the snapshot deployed by the vMCP.
func OAuthCredentialCheckHash ¶
func OAuthCredentialCheckHash(req router.Request, namespace, reference, sourceID string) (string, error)
OAuthCredentialCheckHash watches the source and identifies the credential version to check. The revision survives the catalog controller clearing its sync annotation.
func ParseConfigurationKey ¶
ParseConfigurationKey parses a key produced by ConfigurationKey.
func PruneRemovedComponentProfiles ¶
func PruneRemovedComponentProfiles(previous []types.VMCPComponent, manifest *types.VMCPManifest)
PruneRemovedComponentProfiles removes grants only for components that were actually removed, leaving unrelated invalid references for validation.
func ReconcileComponentIDs ¶
func ReconcileComponentIDs(existing types.VMCPManifest, desired *types.VMCPManifest) error
ReconcileComponentIDs preserves IDs during update and assigns IDs to newly added components. A supplied ID must already belong to the VMCP.
func ResolveConnectID ¶
func ResolveConnectID(ctx context.Context, client kclient.Client, id, userID string) (*v1.VMCP, *v1.VMCPInstance, error)
ResolveConnectID resolves both current IDs and migrated MCP aliases. A nil VMCP means the ID still belongs to the legacy resource model. Instance aliases always identify one connection, never another user's connection.
func ResolveID ¶ added in v0.27.0
func ResolveID(ctx context.Context, client kclient.Client, id string) (*v1.VMCP, *v1.VMCPInstance, error)
ResolveID looks up a vMCP or instance by its ID or migrated alias without checking ownership. OAuth uses it before the user has authenticated.
func SameConnectionConfiguration ¶ added in v0.26.2
SameConnectionConfiguration compares configurations as storage keeps them. Storage drops empty slices, so a nil and an empty slice, at any depth, are the same configuration.
func ServerConfigurationSynced ¶ added in v0.26.2
ServerConfigurationSynced reports whether a component server's configuration credential reflects the vMCP's fixed values, the instance user's values, and the component snapshot. Shared servers have no instance, so pass an empty one.
func ServerInstanceComponent ¶
func ServerInstanceComponent(ctx context.Context, client kclient.Client, connection v1.MCPServerInstance, server v1.MCPServer) (types.VMCPComponent, error)
ServerInstanceComponent validates the connection's ownership and current sharing mode.
func ServerOAuthCredentialReference ¶
func ServerOAuthCredentialReference(ctx context.Context, client kclient.Reader, server v1.MCPServer) (reference, sourceID string, err error)
ServerOAuthCredentialReference resolves shared and dedicated component servers without depending on the continued existence of the source catalog entry.
func SetStaticConfigurationHashes ¶
SetStaticConfigurationHashes records both the deployment-wide synchronization hash and the component hashes used to retain unrelated migrated overrides.
func SourceDigest ¶ added in v0.26.2
func SourceDigest(snapshot types.MCPServerCatalogEntrySnapshot) string
SourceDigest identifies the parts of a catalog entry that require a vMCP component update. Informational fields are excluded so that catalog copy, icon, repository, entry key, tool preview, metadata, upgrade-note, and Obot version range changes alone do not report drift.
func StaticConfigurationCredentialContext ¶
StaticConfigurationCredentialContext scopes fixed configuration to a VMCP.
func StaticConfigurationCredentialName ¶ added in v0.26.2
func StaticOAuthCredentialReference ¶
func StaticOAuthCredentialReference(manifest types.MCPServerCatalogEntryManifest, entryID string) string
StaticOAuthCredentialReference returns the catalog-owned credential context. The credential name within that context is always StaticOAuthCredentialName.
func ToolGranted ¶
func ToolGranted(grant []types.VMCPToolReference, tool types.VMCPToolReference) bool
ToolGranted checks an exact name or wildcard within the same component. A nil grant is unrestricted; an empty grant permits nothing.
func ValidateAndEncodeUserConfiguration ¶
func ValidateAndEncodeUserConfiguration(manifest types.VMCPManifest, configuration types.VMCPConfiguration) (map[string]string, error)
ValidateAndEncodeUserConfiguration validates that every supplied value is user-allowed by the VMCP and returns the credential-store representation.
func VersionStaticConfiguration ¶ added in v0.26.2
VersionStaticConfiguration lets a manifest and its credential revision be published together without overwriting credentials used by the old manifest. The vMCP status handler deletes superseded revisions once a newer one is published.
Types ¶
This section is empty.