@@ -3,7 +3,7 @@ const path = require ('path');
3
3
4
4
const DEFAULT_OPTIONS = {
5
5
keepOptions : false ,
6
- stripPII : false ,
6
+ stripPrivateInfo : true ,
7
7
input : 'dlive.tv.har' ,
8
8
url : 'https://graphigo.prd.dlive.tv/' ,
9
9
output : 'extracted.dlive.tv.har'
@@ -24,8 +24,8 @@ function maybeExtractOptionalArguments (options) {
24
24
let nextArg ;
25
25
while ( ( nextArg = process . argv . shift ( ) ) ) {
26
26
switch ( nextArg ) {
27
- case '-k' : options . keepOptions = true ; break ;
28
- case '-s' : options . stripPII = false ; break ;
27
+ case '-k' : options . keepOptions = true ; break ;
28
+ case '-s' : options . stripPrivateInfo = false ; break ;
29
29
case '-i' : required ( 'input' , ( options . input = process . argv . shift ( ) ) ) ; break ;
30
30
case '-o' : required ( 'output' , ( options . output = process . argv . shift ( ) ) ) ; break ;
31
31
case '-u' : required ( 'url' , ( options . url = process . argv . shift ( ) ) ) ; break ;
@@ -55,8 +55,8 @@ function processArguments() {
55
55
`Usage: ${ selfDetails . cmd } ${ selfDetails . file } [options]\n\n` +
56
56
' -k keep OPTIONS requests.\n' +
57
57
` default: ${ DEFAULT_OPTIONS . keepOptions } \n` +
58
- ' -s strip personally identifiable information .\n' +
59
- ` default: ${ DEFAULT_OPTIONS . stripPII } \n` +
58
+ ' -s strip private info (username, password, tokens) .\n' +
59
+ ` default: ${ DEFAULT_OPTIONS . stripPrivateInfo } \n` +
60
60
' -i input the path to the .har you want to parse.\n' +
61
61
` default: ${ DEFAULT_OPTIONS . input } \n` +
62
62
' -o output the path to what output file you want.\n' +
@@ -105,8 +105,8 @@ function filterOutIrrelevantLogEntries(harObject, options) {
105
105
} ) ;
106
106
}
107
107
108
- function shouldStripPIIFromEntries ( harObject , options ) {
109
- if ( ! options . stripPII ) { return ; }
108
+ function maybeStripPrivateInfoFromEntries ( harObject , options ) {
109
+ if ( ! options . stripPrivateInfo ) { return ; }
110
110
harObject . log . entries = harObject . log . entries . map ( ( item ) => {
111
111
112
112
// TODO: determine which requests contain PII
@@ -128,7 +128,7 @@ fs.readFile (options.input, 'utf8', (err, data) => {
128
128
let harObject = JSON . parse ( data ) ;
129
129
130
130
filterOutIrrelevantLogEntries ( harObject , options ) ;
131
- shouldStripPIIFromEntries ( harObject , options ) ;
131
+ maybeStripPrivateInfoFromEntries ( harObject , options ) ;
132
132
133
133
writeOrCreateTextFile ( options . output , JSON . stringify ( harObject , null , 2 ) , ( err ) => {
134
134
if ( err ) throw err ;
0 commit comments