fix: normalize gateway dev mode detection
This commit is contained in:
@@ -17,7 +17,14 @@ export function normalizeAllowListLower(list?: Array<string | number>) {
|
||||
export type SlackAllowListMatch = {
|
||||
allowed: boolean;
|
||||
matchKey?: string;
|
||||
matchSource?: "wildcard" | "id" | "prefixed-id" | "prefixed-user" | "name" | "prefixed-name" | "slug";
|
||||
matchSource?:
|
||||
| "wildcard"
|
||||
| "id"
|
||||
| "prefixed-id"
|
||||
| "prefixed-user"
|
||||
| "name"
|
||||
| "prefixed-name"
|
||||
| "slug";
|
||||
};
|
||||
|
||||
export function resolveSlackAllowListMatch(params: {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import type { SlackReactionNotificationMode } from "../../config/config.js";
|
||||
import type { SlackMessageEvent } from "../types.js";
|
||||
import { buildChannelKeyCandidates, resolveChannelEntryMatch } from "../../channels/channel-config.js";
|
||||
import {
|
||||
buildChannelKeyCandidates,
|
||||
resolveChannelEntryMatch,
|
||||
} from "../../channels/channel-config.js";
|
||||
import { allowListMatches, normalizeAllowListLower, normalizeSlackSlug } from "./allow-list.js";
|
||||
|
||||
export type SlackChannelConfigResolved = {
|
||||
|
||||
@@ -77,7 +77,10 @@ async function callSlack(
|
||||
}
|
||||
}
|
||||
|
||||
export async function fetchSlackScopes(token: string, timeoutMs: number): Promise<SlackScopesResult> {
|
||||
export async function fetchSlackScopes(
|
||||
token: string,
|
||||
timeoutMs: number,
|
||||
): Promise<SlackScopesResult> {
|
||||
const client = new WebClient(token, { timeout: timeoutMs });
|
||||
const attempts: SlackScopesSource[] = ["auth.scopes", "apps.permissions.info"];
|
||||
const errors: string[] = [];
|
||||
|
||||
Reference in New Issue
Block a user