Documentation
¶
Overview ¶
Package accessintentobserver runs an independent status observer for durable access-control grant intents. It reads live Kubernetes MCPAccessGrant CRs and serving gateway replica status endpoints, reports fenced observations with a monotonic observer_epoch, and never creates desired revisions or River jobs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrStaleObserverEpoch = errors.New("observer epoch superseded by newer lease holder")
ErrStaleObserverEpoch is returned when Platform API rejects an observation because a newer observer holds the cluster lease.
Functions ¶
This section is empty.
Types ¶
type GatewayStatusProber ¶
type GatewayStatusProber interface {
ProbeServingReplicas(ctx context.Context, namespace, serverName, serverUID string) ([]apikit.GrantGatewayReplicaEvidence, error)
}
GatewayStatusProber queries every serving gateway replica for a target server UID.
type GrantReader ¶
type GrantReader interface {
GetGrantCR(ctx context.Context, namespace, name string) (*ObservedGrantCR, bool, error)
}
GrantReader inspects live MCPAccessGrant CR state in Kubernetes.
type K8sGatewayStatusProber ¶
type K8sGatewayStatusProber struct {
Clientset kubernetes.Interface
HTTPClient *http.Client
StatusPort int
}
K8sGatewayStatusProber discovers serving gateway Pods for an MCPServer and queries each replica's /config/status endpoint.
func (*K8sGatewayStatusProber) ProbeServingReplicas ¶
func (p *K8sGatewayStatusProber) ProbeServingReplicas(ctx context.Context, namespace, serverName, serverUID string) ([]apikit.GrantGatewayReplicaEvidence, error)
type K8sGrantReader ¶
K8sGrantReader reads live MCPAccessGrant CRs via dynamic.Interface.
func (*K8sGrantReader) GetGrantCR ¶
func (r *K8sGrantReader) GetGrantCR(ctx context.Context, namespace, name string) (*ObservedGrantCR, bool, error)
type ObservedGrantCR ¶
type ObservedGrantCR struct {
UID string
Generation int64
GrantID string
ServerUID string
DesiredRevisionID string
SpecDigest string
Disabled bool
}
ObservedGrantCR is the sanitized Kubernetes MCPAccessGrant metadata read by the observer.
type Observer ¶
type Observer struct {
// contains filtered or unexported fields
}
Observer watches grant CRs and serving gateway replicas independently of workers.
func New ¶
func New(platform PlatformClient, grants GrantReader, prober GatewayStatusProber, cfg Config) *Observer
New constructs an independent access-intent observer.
func (*Observer) ReconcileOnce ¶
ReconcileOnce evaluates every durable grant intent once and writes fenced independent observations to Platform API.
type PlatformClient ¶
type PlatformClient interface {
ListGrantIntents(ctx context.Context) ([]apikit.GrantIntent, error)
ClaimAccessIntentObserverLease(ctx context.Context, clusterKey, observerID string) (apikit.AccessIntentObserverLeaseResponse, error)
RecordGrantIntentObservation(ctx context.Context, grantID string, req apikit.GrantIntentObservationRequest) (apikit.GrantObservation, error)
}
PlatformClient is the read + observation-only Platform API surface. It deliberately omits intent write and job-enqueue capabilities.