Cotal TypeScript packages
    Preparing search index...

    Interface AuthServiceHandle

    An embedded auth-service context: what runAuthService writes to auth-service.json (the loopback URL, the public URL and the capability) plus the hosted lifecycle handle.

    interface AuthServiceHandle {
        activateManagedLifecycle?: (
            args: { actor: string; lifecycleUid: string; owner: string },
        ) => Promise<void>;
        cap: string;
        closed: Promise<AuthServiceClosed>;
        deregisterEndpoint: (
            request: unknown,
            granter: EndpointDeregisterGranter,
        ) => Promise<RemoteEndpointDeregisterResult>;
        observeManagerGate?: ObserveManagerGate;
        publicUrl?: string;
        resolvePluginChannelState: (space: string) => Promise<{ enabled: boolean }>;
        serviceEndpointHost?: ServiceEndpointHost;
        url: string;
        awaitHostFence?(
            instanceId: string,
            processEpoch: number,
        ): Promise<EpGateState | null>;
        close(): Promise<void>;
        connections(): AuthConnectionState[];
        drain(): Promise<void>;
        endPlatformSupervisorAssignment?(owner: string): Promise<void>;
        observeHostGate?(instanceId: string): Promise<EpGateState | null>;
        platformControlAuthority?<R extends PlatformControlInnerRequest>(
            request: PlatformControlAuthorityRequest<R>,
        ): Promise<PlatformControlAuthorityResult<R>>;
        platformControlReadiness?(instanceId: string): Promise<EpAttributedReply>;
        platformSupervisorAuthority?(
            owner: string,
        ): Promise<
            (
                request: PlatformSupervisorAuthorityRequest,
            ) => Promise<RemoteManagerAuthorityMaterial>,
        >;
        readiness(): HostedServiceState | Promise<HostedServiceState>;
        registerHostIncarnation?(
            instanceId: string,
        ): Promise<DelegatedUserIntentIncarnation>;
    }

    Hierarchy (View Summary)

    Index
    activateManagedLifecycle?: (
        args: { actor: string; lifecycleUid: string; owner: string },
    ) => Promise<void>

    The activation a delegated launch runs at its pinned uid before any row or durable, and its compensation runs before the terminal barrier (SPEC 13.16). Present only with platformControl. It refuses every state in which a retirement at that uid has begun, and throws the activation saga's EpEnvelopeError unchanged. A retirement there has begun or completed only when lifecycleBlockedFrom(err) is defined and its gateState is "retired" or its blockedOp is "retirement". A gate frozen by a takeover or a registration is a barrier in flight, and already-exists, conflict, unavailable, not-found and a permission-denied without that detail are not retirement.

    cap: string

    The per-start loopback capability. It alone authorizes the loopback host actions (lifecycle retirement, managed-agent enrollment verification), so it stays in the authority process and never reaches a control worker.

    closed: Promise<AuthServiceClosed>

    Settles after clean-close ordering and every owned connection's terminal closed signal. A failed close leaves it pending while any connection has not ended. Retry close after repair.

    deregisterEndpoint: (
        request: unknown,
        granter: EndpointDeregisterGranter,
    ) => Promise<RemoteEndpointDeregisterResult>

    Trusted host door. The embedder authenticates the space operator or same-account owner.

    observeManagerGate?: ObserveManagerGate

    The manager gate the delegated user intent decisions read (SPEC 13.16). Present only with platformControl. It reads over the context's own authority connection, so a host opens no second data-account connection, and it returns the gate alone.

    publicUrl?: string
    resolvePluginChannelState: (space: string) => Promise<{ enabled: boolean }>

    Leader-served routing state for host-side delegated launch admission.

    serviceEndpointHost?: ServiceEndpointHost

    The service endpoint host (SPEC 13.1). Present only when serviceEndpoints was supplied to startAuthService. In-process and typed: no route and no capability of its own. The embedder authenticates the granter it passes. Rejects unavailable while the context is not ready, before the host reads or writes anything. The owner-proved public register and status door is the separate /service-endpoint-authority route on both faces.

    url: string
    • Resolves with the gate once the issuance gate of instanceId on the host endpoint is no longer open at processEpoch: a later registration moved the epoch, a barrier froze or retired it, or it is absent (null). Present only with platformControl.host. The host arms it with the incarnation registerHostIncarnation returned, before it admits or recovers any flight, and stops serving when it resolves. It rejects once the context is no longer ready or a read fails.

      Parameters

      • instanceId: string
      • processEpoch: number

      Returns Promise<EpGateState | null>

    • Idempotently release only the resources this context owns.

      Returns Promise<void>

    • Stop admission and settle only already accepted, bounded work.

      Returns Promise<void>

    • End one owner's supervisor issuance after the host recorded the assignment ended. It retires the manager gate and the issued generations, so registration, activation and renewal refuse material returned earlier even before that material expires.

      Parameters

      • owner: string

      Returns Promise<void>

    • A sweeper's point-in-time read of an executor's issuance gate on the host endpoint (SPEC 13.16). Present only with platformControl.host. Null is an absent gate. It reads over the context's own authority connection and writes nothing.

      Parameters

      • instanceId: string

      Returns Promise<EpGateState | null>

    • The platform readiness read (SPEC 13.9). Present only with platformControl. Answers the status of the currently assigned manager instance and refuses any other instance. It reads over this context's own connection, whose grant is that instance's describe and status; neither the connection nor its credential leaves the process.

      Parameters

      • instanceId: string

      Returns Promise<EpAttributedReply>

    • The host incarnation a delegated user intent pins as its executor (SPEC 13.16). Present only with platformControl.host. It registers instanceId of the host endpoint in this context's account through the §13.7 ceremony the auth plane runs for itself. The host calls it at every start with its persisted instance id, before it admits or recovers any flight, so each start fences its predecessor and advances the process epoch. It returns the epoch this registration committed, a coordinate that a later start of the same instance can fence at any moment, even before this call returns. A later start that registers before this registration's confirming read of the gate makes it refuse with conflict; the host learns of every other through awaitHostFence.

      Parameters

      • instanceId: string

      Returns Promise<DelegatedUserIntentIncarnation>