mirror of
https://github.com/appium/appium.git
synced 2026-02-09 11:18:51 -06:00
Merge pull request #9790 from mykola-mokhnach/insecure_arg
Add relaxed security command line flag
This commit is contained in:
@@ -92,3 +92,5 @@ All flags are optional, but some are required in conjunction with certain others
|
||||
|`--localizable-strings-dir`|en.lproj|[DEPRECATED] - (IOS-only) the relative path of the dir where Localizable.strings file resides |`--localizable-strings-dir en.lproj`|
|
||||
|`--show-ios-log`|false|[DEPRECATED] - (IOS-only) if set, the iOS system log will be written to the console||
|
||||
|`--enable-heapdump`|false|Enables NodeJS memory dumps collection feature. This feature is extremely useful for finding memory leaks. Use the 'kill -SIGUSR2 <PID>' command to create a dump of memory heap for _node_ process with the particular PID (this works for *nix systems only). The dump file will be created in the same folder, where main Appium script was executed and will have *.heapsnapshot extension. These snapshot can be then loaded to Chrome Inspector for further investigation. Read the [Rising Stack article](https://blog.risingstack.com/finding-a-memory-leak-in-node-js/) for more details.||
|
||||
|`--relaxed-security`|false|Disable additional security checks, so it is possible to use some advanced features, provided
|
||||
by drivers supporting this option. Only enable it if all the clients are in the trusted network and it is not the case if a client could potentially break out of the session sandbox.||
|
||||
|
||||
@@ -28,7 +28,7 @@ class AppiumDriver extends BaseDriver {
|
||||
// the main Appium Driver has no new command timeout
|
||||
this.newCommandTimeoutMs = 0;
|
||||
|
||||
this.args = args;
|
||||
this.args = Object.assign({}, args);
|
||||
|
||||
// Access to sessions list must be guarded with a Semaphore, because
|
||||
// it might be changed by other async calls at any time
|
||||
@@ -189,6 +189,10 @@ class AppiumDriver extends BaseDriver {
|
||||
|
||||
let runningDriversData, otherPendingDriversData;
|
||||
let d = new InnerDriver(this.args);
|
||||
if (this.args.relaxedSecurityEnabled) {
|
||||
log.info(`Applying relaxed security to ${InnerDriver.name} as per server command line argument`);
|
||||
d.relaxedSecurityEnabled = true;
|
||||
}
|
||||
try {
|
||||
runningDriversData = await this.curSessionDataForDriver(InnerDriver);
|
||||
} catch (e) {
|
||||
|
||||
@@ -738,6 +738,18 @@ const deprecatedArgs = [
|
||||
required: false,
|
||||
help: 'Enable collection of NodeJS memory heap dumps. This is useful for memory leaks lookup',
|
||||
nargs: 0
|
||||
}],
|
||||
|
||||
[['--relaxed-security'], {
|
||||
defaultValue: false,
|
||||
dest: 'relaxedSecurityEnabled',
|
||||
action: 'storeTrue',
|
||||
required: false,
|
||||
help: 'Disable additional security checks, so it is possible to use some advanced features, provided ' +
|
||||
'by drivers supporting this option. Only enable it if all the ' +
|
||||
'clients are in the trusted network and it\'s not the case if a client could potentially ' +
|
||||
'break out of the session sandbox.',
|
||||
nargs: 0
|
||||
}]
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user