interface · Browser and Node
MandateTaskHandlers
@toip-tools/mandatesView sourceimport { type MandateTaskHandlers } from "@toip-tools/mandates";
Declaration
interface MandateTaskHandlers {
clock: Clock;
/** Default: the bundled policy. */
engine?: MandateEngine;
/** With a resolver, an issued mandate's status lists are checked too. */
status?: StatusResolver;
/** A mandate for this endpoint whose whole chain verifies and narrows. */
onIssue?(m: IssuePayload & Sender): Maybe;
/** A list signed by the sender. Check your mandate against it with isRevoked. */
onRevoked?(n: RevokedPayload & Sender): Maybe;
/** A request from the leaf of a chain that verifies, with an action matching its hash. */
onApprovalRequest?(r: ApprovalRequestPayload & Sender): Maybe;
/** An approval signed by the sender. Pass it to decide, which checks the rest. */
onApprovalGrant?(g: ApprovalGrantPayload & Sender): Maybe;
onApprovalDeny?(d: ApprovalDenyPayload & Sender): Maybe;
/** A message that failed its checks, and why. */
onRejected?(r: { type: string; sender: string; reasons: Reason[] }): Maybe;
}
Properties
clockrequiredClockengineoptionalMandateEngine | undefinedDefault: the bundled policy.
statusoptionalStatusResolver | undefinedWith a resolver, an issued mandate's status lists are checked too.
onIssueoptional((m: IssuePayload & Sender) => Maybe) | undefinedA mandate for this endpoint whose whole chain verifies and narrows.
onRevokedoptional((n: RevokedPayload & Sender) => Maybe) | undefinedA list signed by the sender. Check your mandate against it with isRevoked.
onApprovalRequestoptional((r: ApprovalRequestPayload & Sender) => Maybe) | undefinedA request from the leaf of a chain that verifies, with an action matching its hash.
onApprovalGrantoptional((g: ApprovalGrantPayload & Sender) => Maybe) | undefinedAn approval signed by the sender. Pass it to decide, which checks the rest.
onApprovalDenyoptional((d: ApprovalDenyPayload & Sender) => Maybe) | undefinedonRejectedoptional((r: { type: string; sender: string; reasons: Reason[]; }) => Maybe) | undefinedA message that failed its checks, and why.