first commit

This commit is contained in:
baozaotumao2025
2026-07-18 21:10:39 +08:00
commit 1b90e552a5
91 changed files with 9056 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { describe, expect, it } from 'vitest'
import { sanitize } from '../../../src/logging/sanitize'
describe('sanitize', () => {
it('redacts secrets recursively without changing safe context', () => {
expect(
sanitize({
requestId: 'req-1',
authorization: 'Bearer secret',
nested: { password: 'secret', api_key: 'secret', runId: 42 },
}),
).toEqual({
requestId: 'req-1',
authorization: '[REDACTED]',
nested: { password: '[REDACTED]', api_key: '[REDACTED]', runId: 42 },
})
})
})