mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Revert "ELECTRON-512 (Create API only if the location.origin matches with whitelist or pod URL)" (#428)
* Revert "fix path issues on x86 aip file" This reverts commit4395d18dc0. * Revert "fix aip path issue for screen snippet" This reverts commiteeeb5cbc67. * Revert "bump up version number to 2.9.0" This reverts commit77de432eb9. * Revert "ELECTRON-512 (Create API only if the location.origin matches with whitelist or pod URL) (#421)" This reverts commitd47e18072a.
This commit is contained in:
committed by
Vishwas Shashidhar
parent
a14a4ae9ae
commit
17a197a8d2
@@ -24,7 +24,6 @@ const cmds = keyMirror({
|
||||
setIsInMeeting: null,
|
||||
setLocale: null,
|
||||
keyPress: null,
|
||||
originCheck: null,
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
|
||||
@@ -18,7 +18,6 @@ const eventEmitter = require('./eventEmitter');
|
||||
const { isMac } = require('./utils/misc');
|
||||
const { openScreenPickerWindow } = require('./desktopCapturer');
|
||||
const { optimizeMemory, setIsInMeeting } = require('./memoryMonitor');
|
||||
const originCheck = require('./originCheck');
|
||||
|
||||
const apiEnums = require('./enums/api.js');
|
||||
const apiCmds = apiEnums.cmds;
|
||||
@@ -170,11 +169,6 @@ electron.ipcMain.on(apiName, (event, arg) => {
|
||||
windowMgr.handleKeyPress(arg.keyCode);
|
||||
}
|
||||
break;
|
||||
case apiCmds.originCheck:
|
||||
if (typeof arg.origin === 'string') {
|
||||
originCheck(event.sender, arg.origin);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
const { isWhitelisted, matchDomains, parseDomain } = require('./utils/whitelistHandler');
|
||||
const { getGlobalConfigField } = require('./config');
|
||||
const { isDevEnv, isNodeEnv } = require('./utils/misc');
|
||||
|
||||
/**
|
||||
* Validate whitelist and location.origin
|
||||
* @param eventSender
|
||||
* @param origin {String} location.origin
|
||||
*/
|
||||
function originCheck(eventSender, origin) {
|
||||
|
||||
if (isDevEnv || isNodeEnv) {
|
||||
eventSender.send('initialize-api');
|
||||
return;
|
||||
}
|
||||
|
||||
isWhitelisted(origin)
|
||||
.then(() => {
|
||||
eventSender.send('initialize-api', true);
|
||||
})
|
||||
.catch(() => {
|
||||
getGlobalConfigField('url')
|
||||
.then((configUrl) => {
|
||||
if (matchDomains(parseDomain(origin), parseDomain(configUrl))) {
|
||||
eventSender.send('initialize-api', true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
module.exports = originCheck;
|
||||
@@ -110,17 +110,7 @@ setInterval(() => {
|
||||
});
|
||||
}, memoryMonitorInterval);
|
||||
|
||||
// Create API only on an allowed origin
|
||||
local.ipcRenderer.once('initialize-api', () => {
|
||||
createAPI();
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
local.ipcRenderer.send(apiName, {
|
||||
cmd: apiCmds.originCheck,
|
||||
origin: location.origin,
|
||||
});
|
||||
}, 0);
|
||||
createAPI();
|
||||
|
||||
// creates API exposed from electron.
|
||||
// wrapped in a function so we can abort early in function coming from an iframe
|
||||
|
||||
@@ -159,7 +159,6 @@ function parseDomain(url) {
|
||||
module.exports = {
|
||||
isWhitelisted,
|
||||
parseDomain,
|
||||
matchDomains,
|
||||
|
||||
// items below here are only exported for testing, do NOT use!
|
||||
checkWhitelist
|
||||
|
||||
Reference in New Issue
Block a user