security(ringcentral): remove sensitive data from logs and clean up schema

- Remove message text from log output to prevent leaking sensitive content
- Remove obsolete credentialsFile field from config schema
- Add missing selfOnly and allowOtherChats fields to schema

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
John Lin 2026-01-28 10:13:09 +08:00
parent f8343a4100
commit f71da54d8f
No known key found for this signature in database
2 changed files with 3 additions and 2 deletions

View File

@ -27,7 +27,6 @@ const RingCentralAccountSchemaBase = z
clientSecret: z.string().optional(), clientSecret: z.string().optional(),
jwt: z.string().optional(), jwt: z.string().optional(),
server: z.string().optional(), server: z.string().optional(),
credentialsFile: z.string().optional(),
webhookPath: z.string().optional(), webhookPath: z.string().optional(),
webhookVerificationToken: z.string().optional(), webhookVerificationToken: z.string().optional(),
markdown: MarkdownConfigSchema, markdown: MarkdownConfigSchema,
@ -44,6 +43,8 @@ const RingCentralAccountSchemaBase = z
blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(), blockStreamingCoalesce: BlockStreamingCoalesceSchema.optional(),
allowBots: z.boolean().optional(), allowBots: z.boolean().optional(),
botExtensionId: z.string().optional(), botExtensionId: z.string().optional(),
selfOnly: z.boolean().optional(),
allowOtherChats: z.boolean().optional(),
}) })
.strict(); .strict();

View File

@ -199,7 +199,7 @@ async function processMessageWithPipeline(params: {
// This is because the bot uses the JWT user's identity, so we're essentially // This is because the bot uses the JWT user's identity, so we're essentially
// having a conversation with ourselves (the AI assistant) // having a conversation with ourselves (the AI assistant)
const selfOnly = account.config.selfOnly !== false; // default true const selfOnly = account.config.selfOnly !== false; // default true
runtime.log?.(`[${account.accountId}] Processing message: senderId=${senderId}, ownerId=${ownerId}, selfOnly=${selfOnly}, chatId=${chatId}, text=${rawBody.slice(0, 50)}`); runtime.log?.(`[${account.accountId}] Processing message: senderId=${senderId}, ownerId=${ownerId}, selfOnly=${selfOnly}, chatId=${chatId}`);
if (selfOnly && ownerId) { if (selfOnly && ownerId) {
if (senderId !== ownerId) { if (senderId !== ownerId) {