feat(channels): add google chat adapter and webhook route
This commit is contained in:
@@ -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
@@ -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;}
|
||||
|
||||
Reference in New Issue
Block a user