mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 07:27:28 +00:00
refactor: share nextcloud onboarding allowFrom lookup
This commit is contained in:
@@ -2,6 +2,7 @@ import {
|
|||||||
buildSingleChannelSecretPromptState,
|
buildSingleChannelSecretPromptState,
|
||||||
formatDocsLink,
|
formatDocsLink,
|
||||||
hasConfiguredSecretInput,
|
hasConfiguredSecretInput,
|
||||||
|
mapAllowFromEntries,
|
||||||
mergeAllowFromEntries,
|
mergeAllowFromEntries,
|
||||||
promptSingleChannelSecretInput,
|
promptSingleChannelSecretInput,
|
||||||
resolveAccountIdForConfigure,
|
resolveAccountIdForConfigure,
|
||||||
@@ -29,7 +30,7 @@ function setNextcloudTalkDmPolicy(cfg: CoreConfig, dmPolicy: DmPolicy): CoreConf
|
|||||||
channel: "nextcloud-talk",
|
channel: "nextcloud-talk",
|
||||||
dmPolicy,
|
dmPolicy,
|
||||||
getAllowFrom: (inputCfg) =>
|
getAllowFrom: (inputCfg) =>
|
||||||
(inputCfg.channels?.["nextcloud-talk"]?.allowFrom ?? []).map((entry) => String(entry)),
|
mapAllowFromEntries(inputCfg.channels?.["nextcloud-talk"]?.allowFrom),
|
||||||
}) as CoreConfig;
|
}) as CoreConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -984,7 +984,7 @@ describe("setTopLevelChannelDmPolicyWithAllowFrom", () => {
|
|||||||
channel: "nextcloud-talk",
|
channel: "nextcloud-talk",
|
||||||
dmPolicy: "open",
|
dmPolicy: "open",
|
||||||
getAllowFrom: (inputCfg) =>
|
getAllowFrom: (inputCfg) =>
|
||||||
(inputCfg.channels?.["nextcloud-talk"]?.allowFrom ?? []).map((entry) => String(entry)),
|
normalizeAllowFromEntries(inputCfg.channels?.["nextcloud-talk"]?.allowFrom ?? []),
|
||||||
});
|
});
|
||||||
expect(next.channels?.["nextcloud-talk"]?.allowFrom).toEqual(["alice", "*"]);
|
expect(next.channels?.["nextcloud-talk"]?.allowFrom).toEqual(["alice", "*"]);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ export type { ChannelGroupContext, ChannelSetupInput } from "../channels/plugins
|
|||||||
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
|
export type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
|
||||||
export { createReplyPrefixOptions } from "../channels/reply-prefix.js";
|
export { createReplyPrefixOptions } from "../channels/reply-prefix.js";
|
||||||
export type { OpenClawConfig } from "../config/config.js";
|
export type { OpenClawConfig } from "../config/config.js";
|
||||||
|
export { mapAllowFromEntries } from "./channel-config-helpers.js";
|
||||||
export {
|
export {
|
||||||
GROUP_POLICY_BLOCKED_LABEL,
|
GROUP_POLICY_BLOCKED_LABEL,
|
||||||
resolveAllowlistProviderRuntimeGroupPolicy,
|
resolveAllowlistProviderRuntimeGroupPolicy,
|
||||||
|
|||||||
Reference in New Issue
Block a user