feat(channels): add google chat adapter and webhook route

This commit is contained in:
William Valentin
2026-02-16 02:07:55 -08:00
parent 51ff5523ae
commit 693dcd8421
15 changed files with 463 additions and 3 deletions
+12
View File
@@ -159,6 +159,18 @@ models:
const teams = redacted.teams as Record<string, unknown>;
expect(teams.app_password).toBe('***');
});
it('redacts service_account_json (google chat)', () => {
const config = {
google_chat: {
service_account_json: '{"private_key":"secret"}',
},
models: { default: { provider: 'anthropic', model: 'claude' } },
};
const redacted = redactSecrets(config);
const googleChat = redacted.google_chat as Record<string, unknown>;
expect(googleChat.service_account_json).toBe('***');
});
});
describe('getDataDir', () => {
+1 -1
View File
@@ -74,7 +74,7 @@ export function loadConfigSafe(configPath?: string): { config?: Config; error?:
/** Deep-clone config and replace sensitive fields with '***'. */
export function redactSecrets(config: Record<string, unknown>): Record<string, unknown> {
const sensitiveKeys = ['bot_token', 'api_key', 'auth_token', 'access_token', 'app_password'];
const sensitiveKeys = ['bot_token', 'api_key', 'auth_token', 'access_token', 'app_password', 'service_account_json', 'private_key'];
function redact(obj: unknown): unknown {
if (obj === null || obj === undefined) {return obj;}