Cotal TypeScript packages
    Preparing search index...

    Interface CreateIdpBridgeOpts

    interface CreateIdpBridgeOpts {
        authorizeActor: (
            owner: string,
            actor: string,
        ) => ActorGrant | Promise<ActorGrant>;
        connectLimiter?: ConnectLimiter;
        dmReaderAudience?: string;
        idp: IdpConfig;
        issuer: UserTokenIssuer;
        mintConnectCredential: (
            args: { actor: string; lifecycleUid: string; owner: string },
        ) => Promise<string>;
        space: string;
        spaceSecret: string | Uint8Array<ArrayBufferLike>;
    }
    Index
    authorizeActor: (
        owner: string,
        actor: string,
    ) => ActorGrant | Promise<ActorGrant>

    The ledger authority: is actor a live, ledger-authorized instance of owner, and what does it get? MUST return an ActorGrant object to allow; throw to deny. There is no allow-by-default — a hook that returns anything else fails the exchange.

    connectLimiter?: ConnectLimiter

    The callout's connect limits. Present: an actor whose connects they refuse is refused here too, before its root credential is ensured, rather than sent a bearer the callout will deny.

    dmReaderAudience?: string

    The dedicated aud of dm-reader proofs (#4189), from the same pinned IdP issuer and keys. Explicit operator config: it is never derived from, or defaulted to, idp.audience, and construction refuses it when it equals idp.audience, so every exact-audience verifier of ordinary proofs refuses a dm-reader proof. Absent: the bridge refuses the dm-reader view.

    The one IdP this bridge trusts.

    The Plane-1 issuer that mints the Cotal bearer.

    mintConnectCredential: (
        args: { actor: string; lifecycleUid: string; owner: string },
    ) => Promise<string>

    The ROOT-credential ensure (R1, SPEC 13.1): returns the incarnation's live root credential id, minting it release-last on first exchange; throws to deny. Its result rides act.credentialId, which the connect arm requires against the LIVE cred. row. REQUIRED and construction-validated (like authorizeActor): a bridge that could mint a CLAIMLESS bearer is a silent-degrade hazard — in ANY composition that wires this public bridge without the v0.4 deny-new arm, a claimless bearer means the credential-liveness check has nothing to bite and deny-new never engages at all. The public v0.4 mint API therefore MUST NOT be able to emit a claimless shape whose safety depends on a separate component being wired. A genuinely different connect-authority model gets its own explicit constructor that still emits a conformant credential id. (validateUserToken stays tolerant of an absent claim so the CONNECT boundary owns the signed deny-new denial for pre-cut/forged tokens.)

    space: string

    The space every minted bearer is scoped to (aud). One bridge per space.

    spaceSecret: string | Uint8Array<ArrayBufferLike>

    The space's owner-derivation secret (≥32 bytes, operator-held).