Cotal TypeScript packages
    Preparing search index...

    Function calloutPermissions

    • Build the callout's permissionsFor hook. Maps ValidatedUserToken → MintPrincipal → core's permissionsFor("agent", …). connId here is the connection name the callout reads from req.connect_opts.name (NOT req.user_nkey, which the client cannot know pre-connect). The callout accepts a legacy nonce or <owner>-<actor>-<nonce> for this bearer's own principal. It scopes the reply inbox _INBOX_<connId>.>. readerId is the connection's server-assigned history-reader id (core's calloutReaderId), which keys the admin view's reader deletes.

      Invariants enforced HERE (not in core):

      • the owner is a DERIVED owner (u_…) — user mode never accepts the reserved dev local owner;
      • act.scope is the SINGLE capability authority: a token that ALSO carries a top-level scope must have them agree, else it is rejected (the confused-authority guard the Q4 review required closed the moment permissionsFor(validated) became production).

      Parameters

      Returns (
          t: ValidatedUserToken,
          connId: string,
          readerId: string,
      ) => Record<string, unknown>

    • Build the callout's permissionsFor hook. Maps ValidatedUserToken → MintPrincipal → core's permissionsFor("agent", …). connId here is the connection name the callout reads from req.connect_opts.name (NOT req.user_nkey, which the client cannot know pre-connect). The callout accepts a legacy nonce or <owner>-<actor>-<nonce> for this bearer's own principal. It scopes the reply inbox _INBOX_<connId>.>. readerId is the connection's server-assigned history-reader id (core's calloutReaderId), which keys the admin view's reader deletes.

      Invariants enforced HERE (not in core):

      • the owner is a DERIVED owner (u_…) — user mode never accepts the reserved dev local owner;
      • act.scope is the SINGLE capability authority: a token that ALSO carries a top-level scope must have them agree, else it is rejected (the confused-authority guard the Q4 review required closed the moment permissionsFor(validated) became production).

      Parameters

      • resolveAcl: AclResolver
      • authorizeManagerCaller: (owner: string, instanceId: string) => Promise<void>

      Returns (
          t: ValidatedUserToken,
          connId: string,
          readerId: string,
      ) => Record<string, unknown> | Promise<Record<string, unknown>>

    • Build the callout's permissionsFor hook. Maps ValidatedUserToken → MintPrincipal → core's permissionsFor("agent", …). connId here is the connection name the callout reads from req.connect_opts.name (NOT req.user_nkey, which the client cannot know pre-connect). The callout accepts a legacy nonce or <owner>-<actor>-<nonce> for this bearer's own principal. It scopes the reply inbox _INBOX_<connId>.>. readerId is the connection's server-assigned history-reader id (core's calloutReaderId), which keys the admin view's reader deletes.

      Invariants enforced HERE (not in core):

      • the owner is a DERIVED owner (u_…) — user mode never accepts the reserved dev local owner;
      • act.scope is the SINGLE capability authority: a token that ALSO carries a top-level scope must have them agree, else it is rejected (the confused-authority guard the Q4 review required closed the moment permissionsFor(validated) became production).

      Parameters

      • resolveAcl: AclResolver
      • authorizeManagerCaller: (owner: string, instanceId: string) => Promise<void>
      • verifySession: SessionVerifier

      Returns (
          t: ValidatedUserToken,
          connId: string,
          readerId: string,
      ) => Record<string, unknown> | Promise<Record<string, unknown>>

    • Build the callout's permissionsFor hook. Maps ValidatedUserToken → MintPrincipal → core's permissionsFor("agent", …). connId here is the connection name the callout reads from req.connect_opts.name (NOT req.user_nkey, which the client cannot know pre-connect). The callout accepts a legacy nonce or <owner>-<actor>-<nonce> for this bearer's own principal. It scopes the reply inbox _INBOX_<connId>.>. readerId is the connection's server-assigned history-reader id (core's calloutReaderId), which keys the admin view's reader deletes.

      Invariants enforced HERE (not in core):

      • the owner is a DERIVED owner (u_…) — user mode never accepts the reserved dev local owner;
      • act.scope is the SINGLE capability authority: a token that ALSO carries a top-level scope must have them agree, else it is rejected (the confused-authority guard the Q4 review required closed the moment permissionsFor(validated) became production).

      Parameters

      • resolveAcl: AclResolver
      • authorizeManagerCaller: (owner: string, instanceId: string) => Promise<void>
      • verifySession: SessionVerifier
      • issueUserCaller: UserCallerIssuer

      Returns (
          t: ValidatedUserToken,
          connId: string,
          readerId: string,
      ) => Record<string, unknown> | Promise<Record<string, unknown>>

    • Build the callout's permissionsFor hook. Maps ValidatedUserToken → MintPrincipal → core's permissionsFor("agent", …). connId here is the connection name the callout reads from req.connect_opts.name (NOT req.user_nkey, which the client cannot know pre-connect). The callout accepts a legacy nonce or <owner>-<actor>-<nonce> for this bearer's own principal. It scopes the reply inbox _INBOX_<connId>.>. readerId is the connection's server-assigned history-reader id (core's calloutReaderId), which keys the admin view's reader deletes.

      Invariants enforced HERE (not in core):

      • the owner is a DERIVED owner (u_…) — user mode never accepts the reserved dev local owner;
      • act.scope is the SINGLE capability authority: a token that ALSO carries a top-level scope must have them agree, else it is rejected (the confused-authority guard the Q4 review required closed the moment permissionsFor(validated) became production).

      Parameters

      • resolveAcl: AclResolver
      • authorizeManagerCaller: (owner: string, instanceId: string) => Promise<void>
      • verifySession: SessionVerifier
      • issueUserCaller: UserCallerIssuer
      • resolveEndpointCaller: EndpointCallerResolver

      Returns (
          t: ValidatedUserToken,
          connId: string,
          readerId: string,
      ) => Record<string, unknown> | Promise<Record<string, unknown>>

    • Build the callout's permissionsFor hook. Maps ValidatedUserToken → MintPrincipal → core's permissionsFor("agent", …). connId here is the connection name the callout reads from req.connect_opts.name (NOT req.user_nkey, which the client cannot know pre-connect). The callout accepts a legacy nonce or <owner>-<actor>-<nonce> for this bearer's own principal. It scopes the reply inbox _INBOX_<connId>.>. readerId is the connection's server-assigned history-reader id (core's calloutReaderId), which keys the admin view's reader deletes.

      Invariants enforced HERE (not in core):

      • the owner is a DERIVED owner (u_…) — user mode never accepts the reserved dev local owner;
      • act.scope is the SINGLE capability authority: a token that ALSO carries a top-level scope must have them agree, else it is rejected (the confused-authority guard the Q4 review required closed the moment permissionsFor(validated) became production).

      Parameters

      • resolveAcl: AclResolver
      • authorizeManagerCaller: ((owner: string, instanceId: string) => Promise<void>) | undefined
      • verifySession: SessionVerifier | undefined
      • issueUserCaller: UserCallerIssuer | undefined
      • resolveEndpointCaller: EndpointCallerResolver | undefined
      • issueListing: ListingIssuer | undefined
      • OptionalresolvePluginChannelState: (space: string) => Promise<{ enabled: boolean }>

      Returns (
          t: ValidatedUserToken,
          connId: string,
          readerId: string,
      ) => Record<string, unknown> | Promise<Record<string, unknown>>