Use allow/deny instead of whitelist/blacklist for terminology
This commit is contained in:
parent
3654c895eb
commit
69fcebf045
3 changed files with 7 additions and 7 deletions
|
@ -131,11 +131,11 @@ export default class WidgetMessaging {
|
||||||
const widgetSecurityKey = WidgetUtils.getWidgetSecurityKey(this.widgetId, this.widgetUrl, this.isUserWidget);
|
const widgetSecurityKey = WidgetUtils.getWidgetSecurityKey(this.widgetId, this.widgetUrl, this.isUserWidget);
|
||||||
|
|
||||||
const settings = SettingsStore.getValue("widgetOpenIDPermissions");
|
const settings = SettingsStore.getValue("widgetOpenIDPermissions");
|
||||||
if (settings.blacklist && settings.blacklist.includes(widgetSecurityKey)) {
|
if (settings.deny && settings.deny.includes(widgetSecurityKey)) {
|
||||||
this.fromWidget.sendResponse(rawEv, {state: "blocked"});
|
this.fromWidget.sendResponse(rawEv, {state: "blocked"});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (settings.whitelist && settings.whitelist.includes(widgetSecurityKey)) {
|
if (settings.allow && settings.allow.includes(widgetSecurityKey)) {
|
||||||
const responseBody = {state: "allowed"};
|
const responseBody = {state: "allowed"};
|
||||||
const credentials = await MatrixClientPeg.get().getOpenIdToken();
|
const credentials = await MatrixClientPeg.get().getOpenIdToken();
|
||||||
Object.assign(responseBody, credentials);
|
Object.assign(responseBody, credentials);
|
||||||
|
|
|
@ -51,14 +51,14 @@ export default class WidgetOpenIDPermissionsDialog extends React.Component {
|
||||||
console.log(`Remembering ${this.props.widgetId} as allowed=${allowed} for OpenID`);
|
console.log(`Remembering ${this.props.widgetId} as allowed=${allowed} for OpenID`);
|
||||||
|
|
||||||
const currentValues = SettingsStore.getValue("widgetOpenIDPermissions");
|
const currentValues = SettingsStore.getValue("widgetOpenIDPermissions");
|
||||||
if (!currentValues.whitelist) currentValues.whitelist = [];
|
if (!currentValues.allow) currentValues.allow = [];
|
||||||
if (!currentValues.blacklist) currentValues.blacklist = [];
|
if (!currentValues.deny) currentValues.deny = [];
|
||||||
|
|
||||||
const securityKey = WidgetUtils.getWidgetSecurityKey(
|
const securityKey = WidgetUtils.getWidgetSecurityKey(
|
||||||
this.props.widgetId,
|
this.props.widgetId,
|
||||||
this.props.widgetUrl,
|
this.props.widgetUrl,
|
||||||
this.props.isUserWidget);
|
this.props.isUserWidget);
|
||||||
(allowed ? currentValues.whitelist : currentValues.blacklist).push(securityKey);
|
(allowed ? currentValues.allow : currentValues.deny).push(securityKey);
|
||||||
SettingsStore.setValue("widgetOpenIDPermissions", null, SettingLevel.DEVICE, currentValues);
|
SettingsStore.setValue("widgetOpenIDPermissions", null, SettingLevel.DEVICE, currentValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -343,8 +343,8 @@ export const SETTINGS = {
|
||||||
"widgetOpenIDPermissions": {
|
"widgetOpenIDPermissions": {
|
||||||
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
|
supportedLevels: LEVELS_DEVICE_ONLY_SETTINGS,
|
||||||
default: {
|
default: {
|
||||||
whitelist: [],
|
allow: [],
|
||||||
blacklist: [],
|
deny: [],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"RoomList.orderByImportance": {
|
"RoomList.orderByImportance": {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue