style: format auth boundary updates
This commit is contained in:
@@ -215,14 +215,13 @@ export function createMatrixRoomMessageHandler(params: MatrixMonitorHandlerParam
|
||||
}
|
||||
|
||||
const senderName = await getMemberDisplayName(roomId, senderId);
|
||||
const storeAllowFrom =
|
||||
isDirectMessage
|
||||
? await readStoreAllowFromForDmPolicy({
|
||||
provider: "matrix",
|
||||
dmPolicy,
|
||||
readStore: (provider) => core.channel.pairing.readAllowFromStore(provider),
|
||||
})
|
||||
: [];
|
||||
const storeAllowFrom = isDirectMessage
|
||||
? await readStoreAllowFromForDmPolicy({
|
||||
provider: "matrix",
|
||||
dmPolicy,
|
||||
readStore: (provider) => core.channel.pairing.readAllowFromStore(provider),
|
||||
})
|
||||
: [];
|
||||
const groupAllowFrom = cfg.channels?.matrix?.groupAllowFrom ?? [];
|
||||
const normalizedGroupAllowFrom = normalizeMatrixAllowList(groupAllowFrom);
|
||||
const senderGroupPolicy =
|
||||
|
||||
@@ -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 };
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user