Documentation
¶
Index ¶
- Variables
- func NewObservabilityHandler(token string, next http.Handler) http.Handler
- type AcceptedPeer
- type ActivityDispatcher
- type ActivityDispatcherConfig
- type ActivitySink
- type ActivitySinkFunc
- type ActivitySummary
- type AdapterActivity
- type AdapterActivityObserver
- type CommandActivity
- type CommandActivityObserver
- type EphemeralBroadcaster
- type Handshake
- func (h *Handshake) AuthorizeAttach(ctx context.Context, peer AcceptedPeer, rawGrant string) (auth.AttachAuthorization, error)
- func (h *Handshake) AuthorizeAttention(ctx context.Context, principal auth.Principal) (auth.AttentionGrant, error)
- func (h *Handshake) HandleHello(ctx context.Context, hello *protocol.Hello) (protocol.HelloAck, AcceptedPeer, error)
- func (h *Handshake) SetLiveBootstrapAuthorityResolver(resolver LiveBootstrapAuthorityResolver)
- type HandshakeConfig
- type LiveBootstrapAuthorityResolver
- type SessionAdmissionAuthenticator
- type WarmAttachCredentialDelivery
- type WarmAttachCredentialHandoff
- type WebSocketConfig
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidHello = errors.New("invalid hello") ErrVersionUnsupported = errors.New("protocol version unsupported") )
var ErrWarmAttachCredentialNotAccepted = errors.New("warm attach credential was not accepted")
Functions ¶
Types ¶
type AcceptedPeer ¶
type ActivityDispatcher ¶ added in v0.1.7
type ActivityDispatcher struct {
// contains filtered or unexported fields
}
ActivityDispatcher performs bounded keyset rescans. It has one ticker for the whole Store and creates no Session-specific timers or goroutines.
func NewActivityDispatcher ¶ added in v0.1.7
func NewActivityDispatcher(pages store.AttentionSummaryPageStore, sink ActivitySink, cfg ActivityDispatcherConfig) *ActivityDispatcher
func (*ActivityDispatcher) DispatchOnce ¶ added in v0.1.7
func (d *ActivityDispatcher) DispatchOnce(ctx context.Context) error
func (*ActivityDispatcher) RequestActivityRefresh ¶ added in v0.1.7
func (d *ActivityDispatcher) RequestActivityRefresh(ctx context.Context) error
RequestActivityRefresh requests one immediate Store-derived summary rescan. Concurrent calls wait for the same scan, so the request cannot multiply Store reads, callbacks, or background work.
type ActivityDispatcherConfig ¶ added in v0.1.7
type ActivitySink ¶ added in v0.1.7
type ActivitySink interface {
PublishActivitySummary(context.Context, ActivitySummary) error
}
type ActivitySinkFunc ¶ added in v0.1.7
type ActivitySinkFunc func(context.Context, ActivitySummary) error
func (ActivitySinkFunc) PublishActivitySummary ¶ added in v0.1.7
func (fn ActivitySinkFunc) PublishActivitySummary(ctx context.Context, summary ActivitySummary) error
type ActivitySummary ¶ added in v0.1.7
type ActivitySummary struct {
SessionID string
State string
LastDurableSeq int64
LedgerVersion int64
LastDurableEventAt *time.Time
LastClientCommandAt *time.Time
StoreSnapshotAt time.Time
ProjectionState string
BlockerKind string
BlockerExpiresAt *time.Time
}
ActivitySink receives provider-neutral, Store-committed activity summaries. It deliberately contains only durable summary facts, so dispatch cannot become another source of activity truth.
type AdapterActivity ¶
type AdapterActivityObserver ¶
type AdapterActivityObserver interface {
ObserveAdapterActivity(context.Context, AdapterActivity)
}
type CommandActivity ¶
type CommandActivityObserver ¶
type CommandActivityObserver interface {
ObserveCommandActivity(context.Context, CommandActivity)
}
type EphemeralBroadcaster ¶
type EphemeralBroadcaster interface {
http.Handler
EmitEphemeralEvent(context.Context, protocol.Event) error
RunActivityDispatcher(context.Context) error
RequestActivityRefresh(context.Context) error
}
func NewWebSocketHandler ¶
func NewWebSocketHandler(cfg WebSocketConfig) EphemeralBroadcaster
type Handshake ¶
type Handshake struct {
// contains filtered or unexported fields
}
func NewHandshake ¶
func NewHandshake(cfg HandshakeConfig) *Handshake
func (*Handshake) AuthorizeAttach ¶ added in v0.1.7
func (h *Handshake) AuthorizeAttach(ctx context.Context, peer AcceptedPeer, rawGrant string) (auth.AttachAuthorization, error)
AuthorizeAttach consumes the raw grant exactly at Client-to-Hub ingress. It returns verified bounded claims only; T18B must repeat bootstrap checks in its Store transaction before creating any durable attach state.
func (*Handshake) AuthorizeAttention ¶ added in v0.1.7
func (h *Handshake) AuthorizeAttention(ctx context.Context, principal auth.Principal) (auth.AttentionGrant, error)
AuthorizeAttention rechecks the Auth-owned grant for a live attention connection. Callers must not cache it across a Store read or websocket send.
func (*Handshake) HandleHello ¶
func (*Handshake) SetLiveBootstrapAuthorityResolver ¶ added in v0.1.7
func (h *Handshake) SetLiveBootstrapAuthorityResolver(resolver LiveBootstrapAuthorityResolver)
type HandshakeConfig ¶
type HandshakeConfig struct {
Authenticator auth.Authenticator
AttachGrantVerifier auth.AttachGrantVerifier
AttachGrantAudience string
LiveBootstrapAuthority LiveBootstrapAuthorityResolver
EventStore interface {
LatestSeq(ctx context.Context, sessionID string) (int64, error)
}
}
type LiveBootstrapAuthorityResolver ¶ added in v0.1.7
type LiveBootstrapAuthorityResolver interface {
CurrentBootstrapAuthority(context.Context, auth.AttachGrant) (auth.BootstrapAuthority, error)
}
type SessionAdmissionAuthenticator ¶ added in v0.1.7
type SessionAdmissionAuthenticator interface {
auth.Authenticator
SessionAdmissionClaim(context.Context, auth.Principal, string) (auth.SessionAdmissionClaim, error)
}
type WarmAttachCredentialDelivery ¶ added in v0.1.7
type WarmAttachCredentialDelivery struct {
AttachID string
TargetSessionID string
TargetCredentialLineageRef string
Generation int64
ExpiresAt time.Time
}
WarmAttachCredentialDelivery is committed, non-secret target identity. It is deliberately independent from the pending-join wire transport owned by T18G.
type WarmAttachCredentialHandoff ¶ added in v0.1.7
type WarmAttachCredentialHandoff interface {
DeliverCommittedTargetCredential(context.Context, WarmAttachCredentialDelivery, auth.PreparedSessionCredential) error
}
WarmAttachCredentialHandoff receives one already-committed target bearer. Its bounded internal transfer runs while Store owns both final tuples; T18G alone owns any later pending-join protocol/socket transport and rechecks it at that delivery boundary.
type WebSocketConfig ¶
type WebSocketConfig struct {
Handshake *Handshake
EventStore store.EventStore
ActivitySummaryStore store.AttentionSummaryPageStore
ActivitySink ActivitySink
HandshakeTimeout time.Duration
CommandActivityObserver CommandActivityObserver
AdapterActivityObserver AdapterActivityObserver
SessionCredentialIssuer auth.SessionCredentialIssuer
SessionCredentialLifecycle auth.SessionCredentialLifecycle
SessionCredentialEvidenceResolver auth.SessionCredentialEvidenceResolver
EphemeralEventVariants map[string]map[int]string
// Deprecated: credential delivery is always the Hub-owned pending target
// socket. Retained only to avoid a source-incompatible config removal.
WarmAttachCredentialHandoff WarmAttachCredentialHandoff
}