aggregate

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArtifactRefForRuntimeServerID

func ArtifactRefForRuntimeServerID(
	id mcpServer.ServerID,
) (artifact.ArtifactRef, error)

func CollectionRefForRuntimeCatalogID

func CollectionRefForRuntimeCatalogID(
	id mcpServer.CatalogID,
) (collection.CollectionRef, error)

func RuntimeCatalogIDForCollection

func RuntimeCatalogIDForCollection(
	ref collection.CollectionRef,
) (mcpServer.CatalogID, error)

func RuntimeServerIDForArtifact

func RuntimeServerIDForArtifact(
	ref artifact.ArtifactRef,
) (mcpServer.ServerID, error)

Types

type ArtifactServerResolver

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

ArtifactServerResolver translates a runtime-owned opaque ServerID only at the Aggregate boundary, then delegates Store resolution to the narrow port.

func NewArtifactServerResolver

func NewArtifactServerResolver(
	store mcpConsumerAPI.ServerStore,
) (*ArtifactServerResolver, error)

func (*ArtifactServerResolver) InspectMCPServer

func (*ArtifactServerResolver) ResolveMCPServer

func (r *ArtifactServerResolver) ResolveMCPServer(
	ctx context.Context,
	serverID mcpServer.ServerID,
) (mcpDomainServer.Resolved, error)

type AuthState

type AuthState interface {
	ClearAuthStatus(server mcpServer.ServerID)

	BuildAuthHealth(
		ctx context.Context,
		config mcpServer.RuntimeConfig,
	) mcpAuth.MCPAuthHealth
}

type Dependencies

type Dependencies struct {
	Lifecycle *Lifecycle
	Servers   *ArtifactServerResolver
	Source    *RuntimeServerSource
	Bundles   mcpConsumerAPI.BundleServerStore
	Auth      AuthState
	Secrets   SecretStore
}

type Lifecycle

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

func NewLifecycle

func NewLifecycle(
	store mcpConsumerAPI.BundleMutator,
	runtime RuntimeInvalidator,
) (*Lifecycle, error)

func (*Lifecycle) InvalidateCollection

func (l *Lifecycle) InvalidateCollection(
	ctx context.Context,
	ref collection.CollectionRef,
) error

func (*Lifecycle) InvalidateServer

func (l *Lifecycle) InvalidateServer(
	ctx context.Context,
	ref artifact.ArtifactRef,
) error

func (*Lifecycle) PurgeBundle

func (l *Lifecycle) PurgeBundle(
	ctx context.Context,
	ref collection.CollectionRef,
	expectedRevision uint64,
) error

func (*Lifecycle) RefreshBundle

func (l *Lifecycle) RefreshBundle(
	ctx context.Context,
	ref collection.CollectionRef,
	allowProtected bool,
) (mcpConsumerAPI.Bundle, error)

func (*Lifecycle) ReplaceDocument

func (*Lifecycle) RetireBundle

func (l *Lifecycle) RetireBundle(
	ctx context.Context,
	ref collection.CollectionRef,
	expectedRevision uint64,
) (collection.Collection, error)

func (*Lifecycle) UpdateBundleEnabled

func (l *Lifecycle) UpdateBundleEnabled(
	ctx context.Context,
	ref collection.CollectionRef,
	expectedRevision uint64,
	enabled bool,
) (mcpConsumerAPI.Bundle, error)

func (*Lifecycle) UpdateProtectedBundleInstallation

func (l *Lifecycle) UpdateProtectedBundleInstallation(
	ctx context.Context,
	ref collection.CollectionRef,
	expectedOverlayRevision uint64,
	runtimeEnabled bool,
) error

func (*Lifecycle) UpdateProtectedServerInstallation

func (l *Lifecycle) UpdateProtectedServerInstallation(
	ctx context.Context,
	ref artifact.ArtifactRef,
	expectedOverlayRevision uint64,
	runtimeEnabled bool,
	data mcpDomainServer.ServerData,
) error

func (*Lifecycle) UpdateServerInstallation

func (l *Lifecycle) UpdateServerInstallation(
	ctx context.Context,
	ref artifact.ArtifactRef,
	expectedArtifactRevision uint64,
	data mcpDomainServer.ServerData,
) (artifact.Artifact, error)

type OAuthTokenStore

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

OAuthTokenStore translates runtime-owned opaque ServerID values at the Aggregate boundary before using artifact-scoped secret references.

func NewOAuthTokenStore

func NewOAuthTokenStore(secrets SecretStore) (*OAuthTokenStore, error)

func (*OAuthTokenStore) DeleteOAuthToken

func (s *OAuthTokenStore) DeleteOAuthToken(
	ctx context.Context,
	status mcpAuth.MCPAuthStatus,
) error

func (*OAuthTokenStore) LoadOAuthToken

func (s *OAuthTokenStore) LoadOAuthToken(
	ctx context.Context,
	status mcpAuth.MCPAuthStatus,
) (*oauth2.Token, error)

func (*OAuthTokenStore) SaveOAuthToken

func (s *OAuthTokenStore) SaveOAuthToken(
	ctx context.Context,
	status mcpAuth.MCPAuthStatus,
	token *oauth2.Token,
) error

type RuntimeInvalidator

type RuntimeInvalidator interface {
	Invalidate(
		ctx context.Context,
		server mcpServer.ServerID,
	) error

	InvalidateCollection(
		ctx context.Context,
		catalog mcpServer.CatalogID,
	) error
}

RuntimeInvalidator is the only Runtime capability required by Store mutation coordination. Runtime does not know who persists a server.

type RuntimeServerSource

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

RuntimeServerSource is the Store-to-Runtime anti-corruption adapter. Runtime receives only runtime/spec values and never Store values.

func (*RuntimeServerSource) InspectRuntimeConfig

func (*RuntimeServerSource) ResolveServer

func (s *RuntimeServerSource) ResolveServer(
	ctx context.Context,
	serverID mcpServer.ServerID,
) (mcpServer.ResolvedServer, error)

type SecretStore

type SecretStore interface {
	ResolveSecret(ctx context.Context, ref string) (string, error)

	SetMCPSecret(
		ctx context.Context,
		ref string,
		value string,
	) (hash string, nonEmpty bool, err error)

	DeleteSecret(ctx context.Context, ref string) error
}

SecretStore is deliberately narrow. Aggregate owns the mapping from runtime identity to artifact-scoped secret identity; the app supplies persistence.

type SecretWriteResult

type SecretWriteResult struct {
	SecretRef string `json:"secretRef"`
	SHA256    string `json:"sha256,omitempty"`
	NonEmpty  bool   `json:"nonEmpty"`
}

type Service

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

func NewService

func NewService(dependencies Dependencies) (*Service, error)

func (*Service) DeleteServerSecret

func (s *Service) DeleteServerSecret(
	ctx context.Context,
	ref artifact.ArtifactRef,
	kind mcpDomainSecret.MCPSecretKind,
	slot string,
) error

func (*Service) GetServerAuthHealth

func (s *Service) GetServerAuthHealth(
	ctx context.Context,
	ref artifact.ArtifactRef,
) (mcpAuth.MCPAuthHealth, error)

func (*Service) InspectRuntimeConfig

func (*Service) PurgeBundle

func (s *Service) PurgeBundle(
	ctx context.Context,
	ref collection.CollectionRef,
	expectedRevision uint64,
) error

func (*Service) PutServerSecret

func (s *Service) PutServerSecret(
	ctx context.Context,
	ref artifact.ArtifactRef,
	kind mcpDomainSecret.MCPSecretKind,
	slot string,
	value string,
) (SecretWriteResult, error)

func (*Service) RefreshBundle

func (s *Service) RefreshBundle(
	ctx context.Context,
	ref collection.CollectionRef,
	allowProtected bool,
) (mcpConsumerAPI.Bundle, error)

func (*Service) ReplaceDocument

func (s *Service) ReplaceDocument(
	ctx context.Context,
	request mcpConsumerAPI.ReplaceDocumentRequest,
) (mcpConsumerAPI.Bundle, error)

func (*Service) RetireBundle

func (s *Service) RetireBundle(
	ctx context.Context,
	ref collection.CollectionRef,
	expectedRevision uint64,
) (collection.Collection, error)

func (*Service) UpdateBundleEnabled

func (s *Service) UpdateBundleEnabled(
	ctx context.Context,
	ref collection.CollectionRef,
	expectedRevision uint64,
	enabled bool,
) (mcpConsumerAPI.Bundle, error)

func (*Service) UpdateProtectedBundleInstallation

func (s *Service) UpdateProtectedBundleInstallation(
	ctx context.Context,
	ref collection.CollectionRef,
	expectedOverlayRevision uint64,
	runtimeEnabled bool,
) error

func (*Service) UpdateProtectedServerInstallation

func (s *Service) UpdateProtectedServerInstallation(
	ctx context.Context,
	ref artifact.ArtifactRef,
	expectedOverlayRevision uint64,
	runtimeEnabled bool,
	data mcpDomainServer.ServerData,
) error

func (*Service) UpdateServerInstallation

func (s *Service) UpdateServerInstallation(
	ctx context.Context,
	ref artifact.ArtifactRef,
	expectedArtifactRevision uint64,
	data mcpDomainServer.ServerData,
) (artifact.Artifact, error)

Jump to

Keyboard shortcuts

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