Skip to content

Commit 225c06c

Browse files
committed
chore: make hasSensitiveValue mandatory field
1 parent d69244b commit 225c06c

File tree

3 files changed

+70
-70
lines changed

3 files changed

+70
-70
lines changed

lib/common/declarations.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ interface IDashedOption {
12721272
/**
12731273
* Option has sensitive value
12741274
*/
1275-
hasSensitiveValue?: boolean;
1275+
hasSensitiveValue: boolean;
12761276
/**
12771277
* Shorthand option passed on the command line with `-` sign, for example `-v`
12781278
*/

lib/helpers/options-track-helper.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class OptionsTracker {
3434
if (this.shouldSkipProperty(key, value, shorthands, optionsDefinitions)) {
3535
delete data[key];
3636
} else {
37-
if (options && optionsDefinitions[key] && optionsDefinitions[key].hasSensitiveValue) {
37+
if (options && optionsDefinitions[key] && optionsDefinitions[key].hasSensitiveValue !== false) {
3838
value = OptionsTracker.PRIVATE_REPLACE_VALUE;
3939
} else if (key.toLowerCase().indexOf(OptionsTracker.PASSWORD_DETECTION_STRING) >= 0) {
4040
value = OptionsTracker.PRIVATE_REPLACE_VALUE;

lib/options.ts

+68-68
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ export class Options {
88
private optionsWhiteList = ["ui", "recursive", "reporter", "require", "timeout", "_", "$0"]; // These options shouldn't be validated
99
public argv: IYargArgv;
1010
private globalOptions: IDictionary<IDashedOption> = {
11-
log: { type: OptionType.String },
12-
verbose: { type: OptionType.Boolean, alias: "v" },
13-
version: { type: OptionType.Boolean },
14-
help: { type: OptionType.Boolean, alias: "h" },
11+
log: { type: OptionType.String, hasSensitiveValue: false },
12+
verbose: { type: OptionType.Boolean, alias: "v", hasSensitiveValue: false },
13+
version: { type: OptionType.Boolean, hasSensitiveValue: false },
14+
help: { type: OptionType.Boolean, alias: "h", hasSensitiveValue: false },
1515
profileDir: { type: OptionType.String, hasSensitiveValue: true },
16-
analyticsClient: { type: OptionType.String },
16+
analyticsClient: { type: OptionType.String, hasSensitiveValue: false },
1717
path: { type: OptionType.String, alias: "p", hasSensitiveValue: true },
1818
// This will parse all non-hyphenated values as strings.
19-
_: { type: OptionType.String }
19+
_: { type: OptionType.String, hasSensitiveValue: false }
2020
};
2121

2222
public options: IDictionary<IDashedOption>;
@@ -41,85 +41,85 @@ export class Options {
4141

4242
private get commonOptions(): IDictionary<IDashedOption> {
4343
return {
44-
ipa: { type: OptionType.String },
45-
frameworkPath: { type: OptionType.String },
46-
frameworkName: { type: OptionType.String },
47-
framework: { type: OptionType.String },
48-
frameworkVersion: { type: OptionType.String },
49-
forDevice: { type: OptionType.Boolean },
44+
ipa: { type: OptionType.String, hasSensitiveValue: false },
45+
frameworkPath: { type: OptionType.String, hasSensitiveValue: false },
46+
frameworkName: { type: OptionType.String, hasSensitiveValue: false },
47+
framework: { type: OptionType.String, hasSensitiveValue: false },
48+
frameworkVersion: { type: OptionType.String, hasSensitiveValue: false },
49+
forDevice: { type: OptionType.Boolean, hasSensitiveValue: false },
5050
provision: { type: OptionType.Object, hasSensitiveValue: true },
51-
client: { type: OptionType.Boolean, default: true },
52-
env: { type: OptionType.Object },
53-
production: { type: OptionType.Boolean },
54-
debugTransport: { type: OptionType.Boolean },
55-
keyStorePath: { type: OptionType.String },
56-
keyStorePassword: { type: OptionType.String, },
51+
client: { type: OptionType.Boolean, default: true, hasSensitiveValue: false },
52+
env: { type: OptionType.Object, hasSensitiveValue: false },
53+
production: { type: OptionType.Boolean, hasSensitiveValue: false },
54+
debugTransport: { type: OptionType.Boolean, hasSensitiveValue: false },
55+
keyStorePath: { type: OptionType.String, hasSensitiveValue: false },
56+
keyStorePassword: { type: OptionType.String, hasSensitiveValue: true },
5757
keyStoreAlias: { type: OptionType.String, hasSensitiveValue: true },
58-
keyStoreAliasPassword: { type: OptionType.String },
59-
ignoreScripts: { type: OptionType.Boolean },
60-
disableNpmInstall: { type: OptionType.Boolean },
61-
compileSdk: { type: OptionType.Number },
62-
port: { type: OptionType.Number },
63-
copyTo: { type: OptionType.String },
64-
platformTemplate: { type: OptionType.String },
65-
js: { type: OptionType.Boolean },
66-
javascript: { type: OptionType.Boolean },
67-
ng: { type: OptionType.Boolean },
68-
angular: { type: OptionType.Boolean },
69-
vue: { type: OptionType.Boolean },
70-
vuejs: { type: OptionType.Boolean },
71-
tsc: { type: OptionType.Boolean },
72-
ts: { type: OptionType.Boolean },
73-
typescript: { type: OptionType.Boolean },
74-
yarn: { type: OptionType.Boolean },
75-
androidTypings: { type: OptionType.Boolean },
76-
bundle: { type: OptionType.String },
77-
all: { type: OptionType.Boolean },
58+
keyStoreAliasPassword: { type: OptionType.String, hasSensitiveValue: true },
59+
ignoreScripts: { type: OptionType.Boolean, hasSensitiveValue: false },
60+
disableNpmInstall: { type: OptionType.Boolean, hasSensitiveValue: false },
61+
compileSdk: { type: OptionType.Number, hasSensitiveValue: false },
62+
port: { type: OptionType.Number, hasSensitiveValue: false },
63+
copyTo: { type: OptionType.String, hasSensitiveValue: false },
64+
platformTemplate: { type: OptionType.String, hasSensitiveValue: false },
65+
js: { type: OptionType.Boolean, hasSensitiveValue: false },
66+
javascript: { type: OptionType.Boolean, hasSensitiveValue: false },
67+
ng: { type: OptionType.Boolean, hasSensitiveValue: false },
68+
angular: { type: OptionType.Boolean, hasSensitiveValue: false },
69+
vue: { type: OptionType.Boolean, hasSensitiveValue: false },
70+
vuejs: { type: OptionType.Boolean, hasSensitiveValue: false },
71+
tsc: { type: OptionType.Boolean, hasSensitiveValue: false },
72+
ts: { type: OptionType.Boolean, hasSensitiveValue: false },
73+
typescript: { type: OptionType.Boolean, hasSensitiveValue: false },
74+
yarn: { type: OptionType.Boolean, hasSensitiveValue: false },
75+
androidTypings: { type: OptionType.Boolean, hasSensitiveValue: false },
76+
bundle: { type: OptionType.String, hasSensitiveValue: false },
77+
all: { type: OptionType.Boolean, hasSensitiveValue: false },
7878
teamId: { type: OptionType.Object, hasSensitiveValue: true },
79-
syncAllFiles: { type: OptionType.Boolean, default: false },
80-
chrome: { type: OptionType.Boolean },
81-
inspector: { type: OptionType.Boolean },
82-
clean: { type: OptionType.Boolean },
83-
watch: { type: OptionType.Boolean, default: true },
84-
background: { type: OptionType.String },
79+
syncAllFiles: { type: OptionType.Boolean, default: false, hasSensitiveValue: false },
80+
chrome: { type: OptionType.Boolean, hasSensitiveValue: false },
81+
inspector: { type: OptionType.Boolean, hasSensitiveValue: false },
82+
clean: { type: OptionType.Boolean, hasSensitiveValue: false },
83+
watch: { type: OptionType.Boolean, default: true, hasSensitiveValue: false },
84+
background: { type: OptionType.String, hasSensitiveValue: false },
8585
username: { type: OptionType.String, hasSensitiveValue: true },
86-
pluginName: { type: OptionType.String },
87-
hmr: { type: OptionType.Boolean },
88-
collection: { type: OptionType.String, alias: "c" },
89-
json: { type: OptionType.Boolean },
86+
pluginName: { type: OptionType.String, hasSensitiveValue: false },
87+
hmr: { type: OptionType.Boolean, hasSensitiveValue: false },
88+
collection: { type: OptionType.String, alias: "c", hasSensitiveValue: false },
89+
json: { type: OptionType.Boolean, hasSensitiveValue: false },
9090
avd: { type: OptionType.String, hasSensitiveValue: true },
9191
// check not used
92-
config: { type: OptionType.Array },
93-
insecure: { type: OptionType.Boolean, alias: "k" },
94-
debug: { type: OptionType.Boolean, alias: "d" },
95-
timeout: { type: OptionType.String },
92+
config: { type: OptionType.Array, hasSensitiveValue: false },
93+
insecure: { type: OptionType.Boolean, alias: "k", hasSensitiveValue: false },
94+
debug: { type: OptionType.Boolean, alias: "d", hasSensitiveValue: false },
95+
timeout: { type: OptionType.String, hasSensitiveValue: false },
9696
device: { type: OptionType.String, hasSensitiveValue: true },
9797
availableDevices: { type: OptionType.Boolean, hasSensitiveValue: true },
9898
appid: { type: OptionType.String, hasSensitiveValue: true },
9999
geny: { type: OptionType.String, hasSensitiveValue: true },
100-
debugBrk: { type: OptionType.Boolean },
101-
debugPort: { type: OptionType.Number },
102-
start: { type: OptionType.Boolean },
103-
stop: { type: OptionType.Boolean },
100+
debugBrk: { type: OptionType.Boolean, hasSensitiveValue: false },
101+
debugPort: { type: OptionType.Number, hasSensitiveValue: false },
102+
start: { type: OptionType.Boolean, hasSensitiveValue: false },
103+
stop: { type: OptionType.Boolean, hasSensitiveValue: false },
104104
ddi: { type: OptionType.String, hasSensitiveValue: true }, // the path to developer disk image
105-
justlaunch: { type: OptionType.Boolean },
105+
justlaunch: { type: OptionType.Boolean, hasSensitiveValue: false },
106106
file: { type: OptionType.String, hasSensitiveValue: true },
107-
force: { type: OptionType.Boolean, alias: "f" },
107+
force: { type: OptionType.Boolean, alias: "f", hasSensitiveValue: false },
108108
// remove legacy
109-
companion: { type: OptionType.Boolean },
110-
emulator: { type: OptionType.Boolean },
111-
sdk: { type: OptionType.String },
109+
companion: { type: OptionType.Boolean, hasSensitiveValue: false },
110+
emulator: { type: OptionType.Boolean, hasSensitiveValue: false },
111+
sdk: { type: OptionType.String, hasSensitiveValue: false },
112112
template: { type: OptionType.String, hasSensitiveValue: true },
113113
certificate: { type: OptionType.String, hasSensitiveValue: true },
114-
certificatePassword: { type: OptionType.String },
115-
release: { type: OptionType.Boolean, alias: "r" },
114+
certificatePassword: { type: OptionType.String, hasSensitiveValue: true },
115+
release: { type: OptionType.Boolean, alias: "r", hasSensitiveValue: false },
116116
var: { type: OptionType.Object, hasSensitiveValue: true },
117-
default: { type: OptionType.Boolean },
118-
count: { type: OptionType.Number },
117+
default: { type: OptionType.Boolean, hasSensitiveValue: false },
118+
count: { type: OptionType.Number, hasSensitiveValue: false },
119119
analyticsLogFile: { type: OptionType.String, hasSensitiveValue: true },
120-
hooks: { type: OptionType.Boolean, default: true },
121-
link: { type: OptionType.Boolean, default: false },
122-
aab: { type: OptionType.Boolean }
120+
hooks: { type: OptionType.Boolean, default: true, hasSensitiveValue: false },
121+
link: { type: OptionType.Boolean, default: false, hasSensitiveValue: false },
122+
aab: { type: OptionType.Boolean, hasSensitiveValue: false }
123123
};
124124
}
125125

0 commit comments

Comments
 (0)