diff --git a/src/config/schema.test.ts b/src/config/schema.test.ts index bce33bad7b9..54aaa79c846 100644 --- a/src/config/schema.test.ts +++ b/src/config/schema.test.ts @@ -143,6 +143,32 @@ describe("config schema", () => { expect(channelProps?.accessToken).toBeTruthy(); }); + it("looks up plugin config paths for slash-delimited plugin ids", () => { + const res = buildConfigSchema({ + plugins: [ + { + id: "pack/one", + name: "Pack One", + configSchema: { + type: "object", + properties: { + provider: { type: "string" }, + }, + }, + }, + ], + }); + + const lookup = lookupConfigSchema(res, "plugins.entries.pack/one.config"); + expect(lookup?.path).toBe("plugins.entries.pack/one.config"); + expect(lookup?.hintPath).toBe("plugins.entries.pack/one.config"); + expect(lookup?.children.find((child) => child.key === "provider")).toMatchObject({ + key: "provider", + path: "plugins.entries.pack/one.config.provider", + type: "string", + }); + }); + it("adds heartbeat target hints with dynamic channels", () => { const res = buildConfigSchema(heartbeatChannelInput); diff --git a/src/gateway/protocol/schema/config.ts b/src/gateway/protocol/schema/config.ts index 78159549255..9d0ec876668 100644 --- a/src/gateway/protocol/schema/config.ts +++ b/src/gateway/protocol/schema/config.ts @@ -4,7 +4,7 @@ import { NonEmptyString } from "./primitives.js"; const ConfigSchemaLookupPathString = Type.String({ minLength: 1, maxLength: 1024, - pattern: "^[A-Za-z0-9_.\\[\\]\\-*]+$", + pattern: "^[A-Za-z0-9_./\\[\\]\\-*]+$", }); export const ConfigGetParamsSchema = Type.Object({}, { additionalProperties: false });