first commit
This commit is contained in:
@@ -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 },
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user