style: format auth boundary updates

This commit is contained in:
Peter Steinberger
2026-02-26 18:50:47 +01:00
parent 262bca9bdd
commit d6eefe2e75
4 changed files with 29 additions and 33 deletions

View File

@@ -14,14 +14,13 @@ export async function resolveSlackEffectiveAllowFrom(
options?: { includePairingStore?: boolean },
) {
const includePairingStore = options?.includePairingStore === true;
const storeAllowFrom =
includePairingStore
? await readStoreAllowFromForDmPolicy({
provider: "slack",
dmPolicy: ctx.dmPolicy,
readStore: (provider) => readChannelAllowFromStore(provider),
})
: [];
const storeAllowFrom = includePairingStore
? await readStoreAllowFromForDmPolicy({
provider: "slack",
dmPolicy: ctx.dmPolicy,
readStore: (provider) => readChannelAllowFromStore(provider),
})
: [];
const allowFrom = normalizeAllowList([...ctx.allowFrom, ...storeAllowFrom]);
const allowFromLower = normalizeAllowListLower(allowFrom);
return { allowFrom, allowFromLower };

View File

@@ -336,14 +336,13 @@ export async function registerSlackMonitorSlashCommands(params: {
return;
}
const storeAllowFrom =
isDirectMessage
? await readStoreAllowFromForDmPolicy({
provider: "slack",
dmPolicy: ctx.dmPolicy,
readStore: (provider) => readChannelAllowFromStore(provider),
})
: [];
const storeAllowFrom = isDirectMessage
? await readStoreAllowFromForDmPolicy({
provider: "slack",
dmPolicy: ctx.dmPolicy,
readStore: (provider) => readChannelAllowFromStore(provider),
})
: [];
const effectiveAllowFrom = normalizeAllowList([...ctx.allowFrom, ...storeAllowFrom]);
const effectiveAllowFromLower = normalizeAllowListLower(effectiveAllowFrom);

View File

@@ -76,15 +76,14 @@ async function resolveWhatsAppCommandAuthorized(params: {
const configuredGroupAllowFrom =
account.groupAllowFrom ?? (configuredAllowFrom.length > 0 ? configuredAllowFrom : undefined);
const storeAllowFrom =
isGroup
? []
: await readStoreAllowFromForDmPolicy({
provider: "whatsapp",
dmPolicy,
readStore: (provider) =>
readChannelAllowFromStore(provider, process.env, params.msg.accountId),
});
const storeAllowFrom = isGroup
? []
: await readStoreAllowFromForDmPolicy({
provider: "whatsapp",
dmPolicy,
readStore: (provider) =>
readChannelAllowFromStore(provider, process.env, params.msg.accountId),
});
const dmAllowFrom =
configuredAllowFrom.length > 0
? configuredAllowFrom