Files
openclaw/extensions/matrix/src/approval-auth.ts
Peter Steinberger 83bf0379c9 refactor(channels): share plugin contract scaffolds (#105838)
* refactor(channels): share plugin contract scaffolds

* fix: preserve channel config hint metadata

* chore: refresh Plugin SDK API baseline

* ci: refresh plugin SDK surface budget

* fix(ci): allow read-only state database boundary

* fix(ci): dedupe read-only state database boundary
2026-07-13 01:51:32 -07:00

18 lines
774 B
TypeScript

// Matrix plugin module implements approval auth behavior.
import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
import { normalizeMatrixApproverId } from "./approval-ids.js";
import { resolveMatrixAccount } from "./matrix/accounts.js";
import type { CoreConfig } from "./types.js";
const matrixApproval = createChannelApprovalAuth({
channelLabel: "Matrix",
resolveInputs: ({ cfg, accountId }) => {
const account = resolveMatrixAccount({ cfg: cfg as CoreConfig, accountId });
return { allowFrom: account.config.dm?.allowFrom };
},
normalizeApprover: normalizeMatrixApproverId,
});
export const getMatrixApprovalAuthApprovers = matrixApproval.resolveApprovers;
export const matrixApprovalAuth = matrixApproval.approvalAuth;