Documentation
¶
Overview ¶
Package mcpbroker defines the consumer-facing boundary to an MCP broker. Implementations may be in-process or remote; storage and transport details do not cross this boundary.
Index ¶
- Constants
- Variables
- func ExpireAuthorization(ctx context.Context, transactions AuthorizationTransactions, ...) (session.AuthorizationStatus, error)
- func PresentPendingAuthorization(ctx context.Context, transactions AuthorizationTransactions, ...) (string, error)
- func SettleAuthorization(ctx context.Context, transactions AuthorizationTransactions, ...) (session.AuthorizationStatus, error)
- func ValidContinuityAttemptDeadline(now, deadline time.Time) bool
- func ValidContinuityProvider(provider string) bool
- func ValidLogicalSessionID(id session.SessionID) bool
- type AttachOutcome
- type Attachment
- type AuthorizationTransactions
- type Availability
- type CancelFailedError
- type CancelOutcome
- type CatalogueState
- type CloseOutcome
- type ConnectorInspector
- type ConnectorInventory
- type ConnectorStatus
- type ContinuityGuard
- type CredentialContinuityAdvertiser
- type CredentialContinuityService
- type CredentialCustodyStager
- type CustodyAssertion
- type DeleteOutcome
- type EnrollmentState
- type ExpectedBindingAttacher
- type GrantedAuthorization
- type HTTPHandlers
- type InvalidAuthorizationOutcomeError
- type OwnerPartition
- type ProfileDigest
- type ProtectedProfile
- type RecoveredCredentialAttachment
- type ScheduledRunAttachment
- type ScheduledRunCatalogue
- type ScheduledRunListing
- type Service
- type StagedCredentialCustody
- type WorkloadPartition
- type WorkspaceCatalogue
- type WorkspaceEnrollmentAttachment
- type WorkspaceEnrollmentPresentation
- type WorkspaceEnrollmentRef
- type WorkspaceEnrollmentResult
- type WorkspaceEnrollmentStatus
Constants ¶
const ( // ContinuityAttemptTTL bounds an individual Stage or Recover attempt. It is // deliberately independent from custody retention. ContinuityAttemptTTL = 2 * time.Minute // MaxContinuityProviders and MaxContinuityProviderBytes bound a guard's // provider set before it reaches adapter storage. MaxContinuityProviders = 64 // MaxContinuityProviderBytes bounds one provider name's encoded length. MaxContinuityProviderBytes = 256 )
const MaxLogicalSessionIDBytes = sessionaffinity.MaxValueBytes
MaxLogicalSessionIDBytes bounds logical session identifiers before registry access.
Variables ¶
var ( // state cannot be recovered. Callers should resolve a parked authorization // deterministically rather than silently creating a replacement transaction. ErrStateUnavailable = errors.New("mcp broker state unavailable") // proceed. It intentionally reveals no custody or provisional-state detail. ErrContinuityUnavailable = errors.New("mcp broker continuity unavailable") // ErrAttachmentClosed means an operation used a locally closed attachment. ErrAttachmentClosed = errors.New("mcp broker attachment closed") // ErrAuthorizationNotFound means the exact authorization reference is unknown // to the attached logical session. ErrAuthorizationNotFound = errors.New("mcp broker authorization not found") // ErrInvalidWorkspaceCatalogue means a broker catalogue could not be frozen // into a safe, internally consistent snapshot. ErrInvalidWorkspaceCatalogue = errors.New("mcp broker invalid workspace catalogue") // ErrInvalidScheduledRunCatalogue means a scheduled run's listing gave // tools that are not a safe, internally consistent catalogue. ErrInvalidScheduledRunCatalogue = errors.New("mcp broker invalid scheduled run catalogue") // ErrScheduledRunLapsed means a scheduled run found that something its // schedule's owner set up has lapsed since setup, such as a provider // connection, so the run ends as needing owner action: a gateway server // listed no tools or only its sign-in tool, or a listing or call was // refused with subject_unknown or consent_required, or answered with // connection_required. Nobody is present to fix it during the run. ErrScheduledRunLapsed = errors.New("mcp broker scheduled run lapsed") )
var ErrAuthorizationNotPending = errors.New("mcp broker authorization not pending")
ErrAuthorizationNotPending means the exact authorization exists but is no longer pending, so it has nothing left to present.
Functions ¶
func ExpireAuthorization ¶ added in v0.0.52
func ExpireAuthorization(ctx context.Context, transactions AuthorizationTransactions, authorization session.ExternalAuthorization) (session.AuthorizationStatus, error)
ExpireAuthorization settles the exact authorization as expired when it is still pending, and otherwise reports its current status unchanged. A host that must act between the status read and the settlement (for example, open a session before anything is settled) calls AuthorizationStatus and SettleAuthorization separately instead.
func PresentPendingAuthorization ¶ added in v0.0.52
func PresentPendingAuthorization(ctx context.Context, transactions AuthorizationTransactions, authorization session.ExternalAuthorization) (string, error)
PresentPendingAuthorization reads the exact authorization's status and presents it only while pending; otherwise it returns ErrAuthorizationNotPending.
func SettleAuthorization ¶ added in v0.0.52
func SettleAuthorization(ctx context.Context, transactions AuthorizationTransactions, authorization session.ExternalAuthorization, settled session.AuthorizationStatus) (session.AuthorizationStatus, error)
SettleAuthorization cancels the exact authorization and reports the status it settled at: settled when this call cancelled it, AuthorizationCancelled when it was already cancelled, and the broker's own terminal status when it had already resolved. A failed cancellation is returned as *CancelFailedError; a failure to read an already-resolved status is returned unwrapped. A disallowed outcome is an *InvalidAuthorizationOutcomeError.
func ValidContinuityAttemptDeadline ¶ added in v0.0.48
ValidContinuityAttemptDeadline requires a finite, future deadline within the fixed attempt window. Callers also cap it at custody expiry and their context.
func ValidContinuityProvider ¶ added in v0.0.48
ValidContinuityProvider reports whether provider is admissible in a canonical custody provider set.
func ValidLogicalSessionID ¶ added in v0.0.48
ValidLogicalSessionID is the shared bounded identifier contract. It matches the session-affinity header rule so an admitted session can also be reached through the Converse client and connector inventory.
Types ¶
type AttachOutcome ¶
type AttachOutcome string
AttachOutcome is the closed result vocabulary for AttachSession.
const ( // AttachCreated means the logical broker session was created. AttachCreated AttachOutcome = "created" // AttachReattached means a session handle was opened to existing logical state. AttachReattached AttachOutcome = "reattached" )
type Attachment ¶
type Attachment interface {
WorkspaceEnrollmentAttachment
// Commit publishes a newly created logical session after its host session is
// durable. It is idempotent. On a reattached handle it is a no-op. The
// implementation keeps any creation token private so remote brokers can provide
// the same transaction without exposing storage generations or CAS values.
Commit(context.Context) error
// Abort abandons this session handle's uncommitted creation and closes the local
// handle. It may delete logical state only while that creation is still private;
// once another session handle has observed the session, Abort must preserve that
// peer and degrade to local close. It is idempotent.
Abort(context.Context) error
// Binding is the opaque identity of this exact logical-session incarnation.
// It is persisted by the host and must match exactly on reattachment.
Binding() session.ExternalBinding
// Tools returns independently owned wrappers bound to this session handle.
Tools() []tool.Tool
// CallMcpWithQueryTool returns the CallMcpWithQuery wrapper bound to this
// session handle, or nil when the handle has no eligible routes. Tools does not
// include it; a host building a catalogue from Tools adds it separately.
CallMcpWithQueryTool() tool.Tool
// PrepareGrantedAuthorization publishes the catalogue for the exact granted
// authorization of a parked call and returns the tools the host rebuilds the
// parked session from, with the broker's verdict on the parked arguments. A
// non-nil GrantedAuthorization.ArgumentsErr means the host must not execute
// the parked call.
PrepareGrantedAuthorization(context.Context, session.PendingAuthorization) (GrantedAuthorization, error)
// PresentAuthorization returns the live presentation URL for the exact
// authorization. The URL is deliberately an ephemeral return value: it is not
// part of ExternalAuthorization or any broker reference intended for storage.
// PresentPendingAuthorization composes it with a pending check.
PresentAuthorization(context.Context, session.ExternalAuthorization) (string, error)
// AuthorizationStatus queries the exact authorization and remains available
// after closing an old session handle and reattaching to the logical session.
AuthorizationStatus(context.Context, session.ExternalAuthorization) (session.AuthorizationStatus, error)
// CancelAuthorization precisely cancels the exact authorization reference.
// SettleAuthorization and ExpireAuthorization reconcile its outcome into a
// terminal status.
CancelAuthorization(context.Context, session.ExternalAuthorization) (CancelOutcome, error)
// Close releases only this local session handle and is idempotent. It never
// deletes logical broker state.
Close(context.Context) (CloseOutcome, error)
}
Attachment is a process-local handle to one logical broker session.
Authorization operations take session.ExternalAuthorization so callers reuse the aggregate's existing value instead of a second broker DTO. Identity is the stable authorization ID plus opaque AuthorizationBinding; ExpiresAt is freshness metadata and must not participate in lookup equality. Implementations must not infer a transaction from only the session or authorization ID.
type AuthorizationTransactions ¶ added in v0.0.52
type AuthorizationTransactions interface {
PresentAuthorization(context.Context, session.ExternalAuthorization) (string, error)
AuthorizationStatus(context.Context, session.ExternalAuthorization) (session.AuthorizationStatus, error)
CancelAuthorization(context.Context, session.ExternalAuthorization) (CancelOutcome, error)
}
AuthorizationTransactions is the exact-transaction primitive set, satisfied by every Attachment, from which the functions below compose the host's settling operations.
type Availability ¶ added in v0.0.34
type Availability string
Availability is the closed vocabulary for ConnectorInventory.Availability.
const ( // AvailabilityAvailable means the broker reached the connector inventory. AvailabilityAvailable Availability = "available" AvailabilityUnavailable Availability = "unavailable" )
type CancelFailedError ¶ added in v0.0.52
type CancelFailedError struct {
Err error
}
CancelFailedError means the exact cancellation itself failed, so the authorization was not settled by it. It reads and unwraps as the cancellation's error; a failure after the cancellation succeeded is returned without it.
func (*CancelFailedError) Error ¶ added in v0.0.52
func (e *CancelFailedError) Error() string
func (*CancelFailedError) Unwrap ¶ added in v0.0.52
func (e *CancelFailedError) Unwrap() error
type CancelOutcome ¶
type CancelOutcome string
CancelOutcome is the closed, idempotent result vocabulary for cancellation.
const ( // CancelCancelled means this call cancelled the pending authorization. CancelCancelled CancelOutcome = "cancelled" // CancelAlreadyCancelled means that exact authorization was already cancelled. CancelAlreadyCancelled CancelOutcome = "already_cancelled" // CancelAlreadyResolved means that exact authorization had another terminal // status. AuthorizationStatus reports which one. CancelAlreadyResolved CancelOutcome = "already_resolved" )
type CatalogueState ¶ added in v0.0.34
type CatalogueState string
CatalogueState is the closed vocabulary for ConnectorStatus.CatalogueState. A zero ToolCount with CatalogueStateUnknown is missing information, not proof of an empty catalogue.
const ( // CatalogueHidden means the connector's tools are not published. CatalogueHidden CatalogueState = "hidden" // CatalogueDeclared means the connector is declared but not yet discovered. CatalogueDeclared CatalogueState = "declared" // CatalogueDiscovered means the connector's tools were discovered and published. CatalogueDiscovered CatalogueState = "discovered" // CatalogueUnknown means the catalogue state could not be determined. CatalogueUnknown CatalogueState = "unknown" )
type CloseOutcome ¶
type CloseOutcome string
CloseOutcome is the closed, idempotent result vocabulary for Attachment.Close.
const ( // CloseClosed means this call released the local session handle. CloseClosed CloseOutcome = "closed" // CloseAlreadyClosed means the session handle had already been released. CloseAlreadyClosed CloseOutcome = "already_closed" )
type ConnectorInspector ¶ added in v0.0.34
type ConnectorInspector interface {
InspectConnectors(context.Context, session.SessionID, session.ExternalBinding) (ConnectorInventory, error)
}
ConnectorInspector is optional, read-only inspection of an existing exact broker incarnation. The caller must authorize the session owner first. It never attaches, enrolls, refreshes credentials, or performs discovery.
type ConnectorInventory ¶ added in v0.0.34
type ConnectorInventory struct {
// Availability reports whether the broker reached the inventory source.
Availability Availability
// EnrollmentState reports the connector's broker-owned enrollment phase.
EnrollmentState EnrollmentState
// Connectors contains the bounded display rows returned to the caller.
Connectors []ConnectorStatus
// TotalConnectors is the untruncated total discovered by the broker.
TotalConnectors uint32
// Truncated reports that Connectors is only a prefix of the total result.
Truncated bool
}
ConnectorInventory describes broker-local catalogue publication, not session installation, persistence, prompt readiness, authorization validity, or health.
type ConnectorStatus ¶ added in v0.0.34
type ConnectorStatus struct {
// Name is a display label, not a routing key or credential-bearing endpoint.
Name string
// CatalogueState says whether this connector's tools are published to the broker catalogue.
CatalogueState CatalogueState
// ToolCount is the number of published tools for this connector.
ToolCount uint32
}
ConnectorStatus contains only a bounded display name and published tool count.
type ContinuityGuard ¶ added in v0.0.48
type ContinuityGuard struct {
SessionID session.SessionID
SessionIncarnation session.IncarnationID
OwnerPartition OwnerPartition
WorkloadPartition WorkloadPartition
ProfileDigest ProfileDigest
Providers []string
}
ContinuityGuard identifies the custody record an operation applies to.
OwnerPartition and WorkloadPartition are derived by the broker's session layer from the verified caller (see ContinuityOwnerPartition and ContinuityWorkloadPartition). A custody implementation treats them as already verified and only compares them with the stored record, so every caller must derive them itself and never forward a value received from a client.
For Stage, ProfileDigest and Providers must be zero: the broker fills them from its own configuration and returns them in StagedCredentialCustody. Commit, Recover and Tombstone carry the staged values back.
type CredentialContinuityAdvertiser ¶ added in v0.0.48
type CredentialContinuityAdvertiser interface {
CredentialContinuity() bool
}
CredentialContinuityAdvertiser reports whether a handle's broker offers credential continuity (encrypted custody is configured). A host requires custody exactly when this reports true: it fails enrollment closed rather than silently completing without custody, and keeps the legacy path otherwise, so a broker without protected storage (or an older broker) is never mistaken for a continuity failure.
type CredentialContinuityService ¶ added in v0.0.48
type CredentialContinuityService interface {
CommitCredentialCustody(context.Context, CustodyAssertion) error
RecoverCredentialAttachment(context.Context, CustodyAssertion, string) (RecoveredCredentialAttachment, error)
TombstoneCredentialCustody(context.Context, CustodyAssertion) error
}
CredentialContinuityService remains usable after the session handle that staged custody has been closed. Its guards are already verified by the caller (see ContinuityGuard); implementations enforce them against the stored record.
type CredentialCustodyStager ¶ added in v0.0.48
type CredentialCustodyStager interface {
StageCredentialCustody(context.Context, string, ContinuityGuard, WorkspaceEnrollmentRef, time.Time) (StagedCredentialCustody, error)
}
CredentialCustodyStager is available only on handles that completed protected enrollment and can derive a verified ToolHive session identity.
type CustodyAssertion ¶ added in v0.0.48
type CustodyAssertion struct {
Guard ContinuityGuard
RecoveryReference string
AttemptDeadline time.Time
}
CustodyAssertion is bounded request data, never durable authority.
type DeleteOutcome ¶
type DeleteOutcome string
DeleteOutcome is the closed, idempotent result vocabulary for DeleteSession.
const ( // DeleteDeleted means logical broker state existed and was deleted. DeleteDeleted DeleteOutcome = "deleted" // DeleteNotFound means no logical broker state existed; the requested end // state is already satisfied. DeleteNotFound DeleteOutcome = "not_found" )
type EnrollmentState ¶ added in v0.0.34
type EnrollmentState string
EnrollmentState is the closed vocabulary for ConnectorInventory.EnrollmentState.
const ( // EnrollmentNotRequired means the connector needs no enrollment step. EnrollmentNotRequired EnrollmentState = "not_required" // EnrollmentNotStarted means enrollment is required but has not begun. EnrollmentNotStarted EnrollmentState = "not_started" // EnrollmentPending means enrollment has started but not completed. EnrollmentPending EnrollmentState = "pending" // EnrollmentCompleted means enrollment has finished successfully. EnrollmentCompleted EnrollmentState = "completed" // EnrollmentUnknown means enrollment status could not be determined. EnrollmentUnknown EnrollmentState = "unknown" )
type ExpectedBindingAttacher ¶ added in v0.0.48
type ExpectedBindingAttacher interface {
AttachSessionExpectedBinding(context.Context, session.SessionID, session.ExternalBinding) (Attachment, AttachOutcome, error)
}
ExpectedBindingAttacher classifies a persisted opaque binding without creating a new logical session. It is the only binding-aware reattach capability.
type GrantedAuthorization ¶ added in v0.0.52
type GrantedAuthorization struct {
// Tools is the independently owned broker tool set, including any
// CallMcpWithQuery wrapper, that the host rebuilds the parked session from.
Tools []tool.Tool
// ArgumentsErr is non-nil when the parked call's arguments do not conform to
// the authenticated schema in Tools. The authorization itself still succeeded;
// the host must settle the call without running it.
ArgumentsErr error
}
GrantedAuthorization is the broker-authored replacement for a parked call whose exact authorization was granted.
type HTTPHandlers ¶ added in v0.0.52
type HTTPHandlers interface {
// Mount registers the complete route set and the callback path selected by
// trusted composition. It rejects incomplete surfaces and route collisions
// before mutating mux.
Mount(mux *http.ServeMux, callbackPath string) error
}
HTTPHandlers is the fixed process-owned HTTP surface of an in-process broker. Command roots choose the listener; the implementation owns the exact route set. A broker with no HTTP surface provides a nil HTTPHandlers.
type InvalidAuthorizationOutcomeError ¶ added in v0.0.52
type InvalidAuthorizationOutcomeError struct {
Reason string
}
InvalidAuthorizationOutcomeError means a cancellation produced an outcome the contract does not allow, so the authorization's status is not trustworthy. Reason is the whole message.
func (*InvalidAuthorizationOutcomeError) Error ¶ added in v0.0.52
func (e *InvalidAuthorizationOutcomeError) Error() string
type OwnerPartition ¶ added in v0.0.48
type OwnerPartition [32]byte
OwnerPartition is the one-way fingerprint of the durable owner principal.
func ContinuityOwnerPartition ¶ added in v0.0.48
func ContinuityOwnerPartition(principal *session.Principal) (OwnerPartition, error)
ContinuityOwnerPartition derives the one-way owner partition for a verified principal. The hash keeps the identity out of stored records, but it is unkeyed: anyone who can guess an issuer and subject can recompute it. Treat it as a stable identifier, not a secret.
func (OwnerPartition) Equal ¶ added in v0.0.48
func (p OwnerPartition) Equal(other OwnerPartition) bool
Equal compares in constant time.
func (OwnerPartition) IsZero ¶ added in v0.0.48
func (p OwnerPartition) IsZero() bool
IsZero reports whether the partition is unset.
type ProfileDigest ¶ added in v0.0.48
type ProfileDigest [32]byte
ProfileDigest is the digest of the protected provider configuration.
func ProtectedProfileDigest ¶ added in v0.0.48
func ProtectedProfileDigest(callbackURL, derivedIssuer string, profiles []ProtectedProfile) (ProfileDigest, []string, error)
ProtectedProfileDigest canonicalizes the immutable protected configuration. It returns the digest and exact sorted provider set used in continuity guards.
func (ProfileDigest) Equal ¶ added in v0.0.48
func (d ProfileDigest) Equal(other ProfileDigest) bool
Equal compares in constant time.
func (ProfileDigest) IsZero ¶ added in v0.0.48
func (d ProfileDigest) IsZero() bool
IsZero reports whether the digest is unset.
type ProtectedProfile ¶ added in v0.0.48
type ProtectedProfile struct {
Provider string
Destination string
Issuer string
AuthorizationEndpoint string
TokenEndpoint string
DCRDiscoveryURL string
ClientID string
AuthMode string
Scopes []string
RequestRefreshToken bool
}
ProtectedProfile describes immutable, non-secret configuration that binds a protected ToolHive provider to continuity custody. Secret values and paths are deliberately absent.
type RecoveredCredentialAttachment ¶ added in v0.0.48
type RecoveredCredentialAttachment struct {
Attachment Attachment
}
RecoveredCredentialAttachment contains only a process-local provisional attachment. Hosts persist its binding, never its handle.
type ScheduledRunAttachment ¶ added in v0.0.54
type ScheduledRunAttachment interface {
// InstallScheduledRunCatalogue lists l.Servers and installs the run's
// catalogue, in place of the attachment's static declarations of gateway
// routes. A lapse its schedule's owner can fix is an error wrapping
// ErrScheduledRunLapsed; any other failure is returned as it is. Either
// way nothing is installed.
InstallScheduledRunCatalogue(context.Context, ScheduledRunListing) (ScheduledRunCatalogue, error)
}
ScheduledRunAttachment is the part of an attachment that installs a scheduled run's catalogue. A scheduled run has no workspace enrollment: at its start its main agent lists the gateway servers its schedule was set up with, and its catalogue keeps only the tools setup recorded (design "Tool discovery" in mcp-authorization.md, and "Scheduled-run session open").
type ScheduledRunCatalogue ¶ added in v0.0.54
type ScheduledRunCatalogue struct {
// contains filtered or unexported fields
}
ScheduledRunCatalogue is the catalogue a scheduled run's listing installed, and what the listing lacked. It is one snapshot: a run's engine and its carried authority are built from Tools and ToolNames, never by reading the attachment again. Unlike a WorkspaceCatalogue's, its tools are the attachment's own, not wrappers, so a gateway tool still offers its helper variant to the run's subagents and team members.
func NewScheduledRunCatalogue ¶ added in v0.0.54
func NewScheduledRunCatalogue(tools []tool.Tool, missingTools []string) (ScheduledRunCatalogue, error)
NewScheduledRunCatalogue checks tools as NewWorkspaceCatalogue does, failing with ErrInvalidScheduledRunCatalogue, takes their names from one read of each specification, and records missingTools, the tools setup recorded that the listing lacked, each as "<server>.<tool>", sorted.
func (ScheduledRunCatalogue) MissingTools ¶ added in v0.0.54
func (c ScheduledRunCatalogue) MissingTools() []string
MissingTools names the tools setup recorded that the run's listing lacked, such as one renamed upstream, each as "<server>.<tool>", sorted. The run goes on without them.
func (ScheduledRunCatalogue) ToolNames ¶ added in v0.0.54
func (c ScheduledRunCatalogue) ToolNames() []string
ToolNames returns the copied exact tool-name set of Tools.
func (ScheduledRunCatalogue) Tools ¶ added in v0.0.54
func (c ScheduledRunCatalogue) Tools() []tool.Tool
Tools returns a copied slice of the catalogue's executable tools.
type ScheduledRunListing ¶ added in v0.0.54
type ScheduledRunListing struct {
// Root is the run's root session, whose main agent lists.
Root session.SessionID
// Run is the run the listings are authorized in.
Run agentcredential.Run
// Tools is the schedule's tool list, the tools setup recorded; nil for a
// run that lists nothing: one opened without a grant, or one running a
// named definition. Its catalogue then has no gateway tools.
Tools *identitybroker.ToolList
// Servers are the gateway servers in the run's root's ceiling that the
// tool list names: the servers listed.
Servers []string
// OnLapse is told of a lapse a gateway call finds during the run, with an
// error wrapping ErrScheduledRunLapsed. It is called before the call
// returns, so it can end the run before the model sees the result.
OnLapse func(context.Context, error)
}
ScheduledRunListing is what a scheduled run's catalogue is listed from.
type Service ¶
type Service interface {
// AttachSession opens a local session handle to the current incarnation,
// creating logical state when necessary.
AttachSession(context.Context, session.SessionID) (Attachment, AttachOutcome, error)
// DeleteSession durably invalidates every session handle to the deleted logical
// session incarnation. A later AttachSession with the same SessionID creates a
// new incarnation; stale session handles must return ErrStateUnavailable. Any
// generation or fencing mechanism used to enforce this remains private.
DeleteSession(context.Context, session.SessionID) (DeleteOutcome, error)
}
Service attaches consumers to broker state keyed by the stable mecatl session identity. AttachSession does not transfer ownership: multiple process-local session handles may refer to the same logical state. DeleteSession, unlike Close, durably and idempotently destroys that logical state.
type StagedCredentialCustody ¶ added in v0.0.48
type StagedCredentialCustody struct {
RecoveryReference string
ExpiresAt time.Time
ProfileDigest ProfileDigest
Providers []string
}
StagedCredentialCustody is the safe durable result of Stage.
type WorkloadPartition ¶ added in v0.0.48
type WorkloadPartition [32]byte
WorkloadPartition is the one-way fingerprint of the authenticated workload principal.
func ContinuityWorkloadPartition ¶ added in v0.0.48
func ContinuityWorkloadPartition(principal *session.Principal) (WorkloadPartition, error)
ContinuityWorkloadPartition derives the one-way workload partition for the authenticated workload principal.
func (WorkloadPartition) Equal ¶ added in v0.0.48
func (p WorkloadPartition) Equal(other WorkloadPartition) bool
Equal compares in constant time.
func (WorkloadPartition) IsZero ¶ added in v0.0.48
func (p WorkloadPartition) IsZero() bool
IsZero reports whether the partition is unset.
type WorkspaceCatalogue ¶
type WorkspaceCatalogue interface {
Valid() bool
Ref() WorkspaceEnrollmentRef
Tools() []tool.Tool
ToolNames() []string
// contains filtered or unexported methods
}
WorkspaceCatalogue is an immutable snapshot of the complete frozen tool catalogue proven by one exact enrollment. Construct it with NewWorkspaceCatalogue; its accessors return defensive copies. The private marker seals construction to this package.
func NewWorkspaceCatalogue ¶
func NewWorkspaceCatalogue(ref WorkspaceEnrollmentRef, tools []tool.Tool) (WorkspaceCatalogue, error)
NewWorkspaceCatalogue snapshots each tool's specification exactly once and returns executable wrappers whose Spec method serves that frozen value, with their names, a valid exact authority tool-name set.
type WorkspaceEnrollmentAttachment ¶
type WorkspaceEnrollmentAttachment interface {
ResetWorkspaceEnrollment(context.Context) error
// BeginWorkspaceEnrollment creates a broker-owned enrollment and returns a
// short-lived browser presentation for it.
BeginWorkspaceEnrollment(context.Context) (WorkspaceEnrollmentPresentation, error)
// ObserveWorkspaceEnrollment returns the broker's current result for this exact ref.
ObserveWorkspaceEnrollment(context.Context, WorkspaceEnrollmentRef) (WorkspaceEnrollmentResult, error)
// CancelWorkspaceEnrollment settles this exact enrollment as cancelled when possible.
CancelWorkspaceEnrollment(context.Context, WorkspaceEnrollmentRef) (WorkspaceEnrollmentResult, error)
}
WorkspaceEnrollmentAttachment is the enrollment capability every Attachment provides. Callers may begin, observe, cancel, or explicitly reset broker- owned state, but can never submit status, discovered definitions, authority, or success.
type WorkspaceEnrollmentPresentation ¶
type WorkspaceEnrollmentPresentation struct {
// Ref is the exact enrollment transaction the browser flow must complete.
Ref WorkspaceEnrollmentRef
// URL is a short-lived presentation address; callers must not persist it as authority.
URL string
// ObserveNow reports that the bundle may complete without the browser: the
// caller observes it at once and presents URL only while it stays pending.
ObserveNow bool
}
WorkspaceEnrollmentPresentation is the ephemeral browser presentation for an enrollment. URL deliberately exists only on this non-durable value.
func (WorkspaceEnrollmentPresentation) Valid ¶
func (p WorkspaceEnrollmentPresentation) Valid() bool
Valid reports whether p has a valid reference and an absolute HTTP(S) URL.
type WorkspaceEnrollmentRef ¶
type WorkspaceEnrollmentRef struct {
// ID identifies the enrollment transaction without exposing its process-local state.
ID session.WorkspaceEnrollmentID
// RequiredServices records how many broker services must be connected before the
// enrollment may publish a complete catalogue.
RequiredServices uint32
// ExpiresAt is the broker's absolute expiry for this enrollment reference.
ExpiresAt time.Time
}
WorkspaceEnrollmentRef is the durable, presentation-safe correlation for one broker-owned enrollment. It contains no URL, credential, backend selection, or discovered definition.
func (WorkspaceEnrollmentRef) Valid ¶
func (r WorkspaceEnrollmentRef) Valid() bool
Valid reports whether r is a complete enrollment reference.
type WorkspaceEnrollmentResult ¶
type WorkspaceEnrollmentResult struct {
Ref WorkspaceEnrollmentRef
Status WorkspaceEnrollmentStatus
Catalogue WorkspaceCatalogue
}
WorkspaceEnrollmentResult is a broker-authored observation. A connected result proves one complete frozen catalogue; every other state forbids one.
func (WorkspaceEnrollmentResult) Valid ¶
func (r WorkspaceEnrollmentResult) Valid() bool
Valid reports whether r is internally consistent and fail-closed.
type WorkspaceEnrollmentStatus ¶
type WorkspaceEnrollmentStatus string
WorkspaceEnrollmentStatus is the closed broker-authored state of one pre-prompt workspace enrollment.
const ( WorkspaceEnrollmentPending WorkspaceEnrollmentStatus = "pending" WorkspaceEnrollmentConnected WorkspaceEnrollmentStatus = "connected" WorkspaceEnrollmentDenied WorkspaceEnrollmentStatus = "denied" WorkspaceEnrollmentCancelled WorkspaceEnrollmentStatus = "cancelled" WorkspaceEnrollmentExpired WorkspaceEnrollmentStatus = "expired" WorkspaceEnrollmentFailed WorkspaceEnrollmentStatus = "failed" )
Workspace enrollment statuses.
func (WorkspaceEnrollmentStatus) Valid ¶
func (s WorkspaceEnrollmentStatus) Valid() bool
Valid reports whether s is a defined workspace-enrollment status.