Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 21, 04:45 UTC
| 1 | import { describe, expect, it } from 'vitest'; |
| 2 | import { redactSensitiveLogValue } from 'src/utils/redact-sensitive'; |
| 3 | |
| 4 | describe('credential hygiene', () => { |
| 5 | it('redacts nested credential keys in structured values', () => { |
| 6 | const value = { |
| 7 | apiKey: 'uak_test_secret', |
| 8 | nested: { user_api_key: 'agent_test_secret' }, |
| 9 | safe: 'visible', |
| 10 | }; |
| 11 | |
| 12 | const redactedObject = redactSensitiveLogValue(value); |
| 13 | |
| 14 | expect(JSON.stringify(redactedObject)).not.toContain('uak_test_secret'); |
| 15 | expect(JSON.stringify(redactedObject)).not.toContain('agent_test_secret'); |
| 16 | expect(JSON.stringify(redactedObject)).toContain('visible'); |
| 17 | }); |
| 18 | }); |