-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sameeran/ff 981 use obfuscated rac (#24)
* Add obfuscation helpers and test for boolean type in RAC * Include numeric in test * Extend obfuscation logic to rules matching * convert to yarn script to write obfuscated mock rac * move generateObfuscatedMockRac to script file * Generate obfuscated file as part of makefile * Increment minor version * Run all test cases and consolidate readMockRacResponse * Fix makefile * Copy obfuscated rac from data repo instead of generating it * Remove default arg in findMatchingRule * Obfuscation tests
- Loading branch information
Showing
12 changed files
with
415 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { decodeBase64, encodeBase64 } from './obfuscation'; | ||
|
||
describe('obfuscation', () => { | ||
it('encodes strings to base64', () => { | ||
expect(encodeBase64('5.0')).toEqual('NS4w'); | ||
}); | ||
|
||
it('decodes base64 to string', () => { | ||
expect(Number(decodeBase64('NS4w'))).toEqual(5); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as md5 from 'md5'; | ||
|
||
export function getMD5Hash(input: string): string { | ||
return md5(input); | ||
} | ||
|
||
export function encodeBase64(input: string): string { | ||
return Buffer.from(input, 'utf8').toString('base64'); | ||
} | ||
|
||
export function decodeBase64(input: string): string { | ||
return Buffer.from(input, 'base64').toString('utf8'); | ||
} |
Oops, something went wrong.