1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-23 22:36:32 +02:00

Desktop,Mobile,Cli: Resolves #9706: Don't log OneDrive Authorization tokens (#9707)

This commit is contained in:
Henry Heino
2024-01-18 03:20:33 -08:00
committed by GitHub
parent f5e1e45f6f
commit bc1165be46
4 changed files with 56 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
import OneDriveApi from './onedrive-api';
describe('onedrive-api', () => {
test.each([
[{ Authorization: 'testing' }, { Authorization: '[[DELETED]]' }],
[{ headers: { Authorization: 'testing' } }, { headers: { Authorization: '[[DELETED]]' } }],
[
{ foo: { Authorization: 'testing', bar: 'test' }, baz: 'test2', Authorization: 'testing' },
{ foo: { Authorization: '[[DELETED]]', bar: 'test' }, baz: 'test2', Authorization: '[[DELETED]]' },
],
[
{ a: { b: { c: { d: { e: { f: { g: 'Test' } } } }, Authorization: 'bearer someidhere' } } },
{ a: { b: { c: { d: { e: { f: '[[depth-exceeded]]' } } }, Authorization: '[[DELETED]]' } } },
],
])('authorizationTokenRemoved should remove Authorization field', (object, expected) => {
const api = new OneDriveApi('testID', 'secret', true);
expect(api.authorizationTokenRemoved(object)).toMatchObject(expected);
});
});