Skip to content

Commit

Permalink
Merge branch 'feature/WPB-482-conversation-shields' of github.com:wir…
Browse files Browse the repository at this point in the history
…eapp/wire-webapp into feature/WPB-482-conversation-shields
  • Loading branch information
przemvs committed Nov 23, 2023
2 parents 0cea9a7 + 55d65ce commit 9c20fcb
Show file tree
Hide file tree
Showing 21 changed files with 577 additions and 517 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/sync_translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
run: yarn translate:merge

- name: Download translations
uses: crowdin/[email protected].1
uses: crowdin/[email protected].2
env:
GITHUB_TOKEN: ${{secrets.OTTO_THE_BOT_GH_TOKEN}}
CROWDIN_PROJECT_ID: 342359
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"dependencies": {
"@datadog/browser-logs": "^5.2.0",
"@datadog/browser-rum": "^5.2.0",
"@datadog/browser-logs": "^5.3.0",
"@datadog/browser-rum": "^5.3.0",
"@emotion/react": "11.11.1",
"@lexical/history": "0.12.2",
"@lexical/react": "0.12.2",
"@lexical/history": "0.12.4",
"@lexical/react": "0.12.4",
"@peculiar/x509": "1.9.5",
"@wireapp/avs": "9.5.2",
"@wireapp/commons": "5.2.2",
"@wireapp/core": "42.19.2",
"@wireapp/react-ui-kit": "9.9.12",
"@wireapp/commons": "5.2.3",
"@wireapp/core": "42.21.0",
"@wireapp/react-ui-kit": "9.11.0",
"@wireapp/store-engine-dexie": "2.1.6",
"@wireapp/store-engine-sqleet": "1.8.9",
"@wireapp/webapp-events": "0.18.3",
Expand All @@ -30,7 +30,7 @@
"jszip": "3.10.1",
"keyboardjs": "2.7.0",
"knockout": "3.5.1",
"lexical": "0.12.2",
"lexical": "0.12.4",
"libsodium-wrappers": "0.7.13",
"linkify-it": "4.0.1",
"long": "5.2.3",
Expand All @@ -41,10 +41,10 @@
"react": "18.2.0",
"react-dom": "18.2.0",
"react-error-boundary": "4.0.11",
"react-intl": "6.5.4",
"react-intl": "6.5.5",
"react-redux": "8.1.3",
"react-router": "6.18.0",
"react-router-dom": "6.18.0",
"react-router": "6.19.0",
"react-router-dom": "6.19.0",
"react-transition-group": "4.4.5",
"redux": "4.2.1",
"redux-logdown": "1.0.4",
Expand All @@ -65,10 +65,10 @@
"@babel/preset-react": "7.23.3",
"@babel/preset-typescript": "7.23.3",
"@emotion/eslint-plugin": "^11.11.0",
"@faker-js/faker": "8.2.0",
"@formatjs/cli": "6.2.3",
"@faker-js/faker": "8.3.1",
"@formatjs/cli": "6.2.4",
"@koush/wrtc": "0.5.3",
"@testing-library/react": "14.1.0",
"@testing-library/react": "14.1.2",
"@types/dexie-batch": "0.4.7",
"@types/eslint": "^8",
"@types/fs-extra": "11.0.4",
Expand All @@ -82,7 +82,7 @@
"@types/linkify-it": "3.0.5",
"@types/loadable__component": "^5",
"@types/markdown-it": "13.0.6",
"@types/node": "^20.9.0",
"@types/node": "^20.9.2",
"@types/open-graph": "0.2.5",
"@types/platform": "1.3.6",
"@types/react": "18.2.33",
Expand All @@ -95,7 +95,7 @@
"@types/speakingurl": "13.0.6",
"@types/underscore": "1.11.14",
"@types/webpack-env": "1.18.4",
"@wireapp/copy-config": "2.1.10",
"@wireapp/copy-config": "2.1.12",
"@wireapp/eslint-config": "3.0.4",
"@wireapp/prettier-config": "0.6.3",
"@wireapp/store-engine": "^5.1.4",
Expand All @@ -110,7 +110,7 @@
"dexie": "3.2.4",
"dotenv": "16.3.1",
"dpdm": "3.14.0",
"eslint": "^8.53.0",
"eslint": "^8.54.0",
"eslint-plugin-prettier": "^5.0.1",
"fake-indexeddb": "4.0.2",
"generate-changelog": "1.8.0",
Expand Down
2 changes: 1 addition & 1 deletion server/config/client.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function generateConfig(params: ConfigGeneratorParams, env: Env) {
SHOW_LOADING_INFORMATION: env.FEATURE_SHOW_LOADING_INFORMATION == 'true',
USE_CORE_CRYPTO: env.FEATURE_USE_CORE_CRYPTO == 'true',
MAX_USERS_TO_PING_WITHOUT_ALERT:
(env.FEATURE_MAX_USERS_TO_PING_WITHOUT_ALERT && Number(env.FEATURE_MAX_USERS_TO_PING_WITHOUT_ALERT)) || 3,
(env.FEATURE_MAX_USERS_TO_PING_WITHOUT_ALERT && Number(env.FEATURE_MAX_USERS_TO_PING_WITHOUT_ALERT)) || 4,

Check warning on line 74 in server/config/client.config.ts

View workflow job for this annotation

GitHub Actions / lint

No magic number: 4

Check warning on line 74 in server/config/client.config.ts

View workflow job for this annotation

GitHub Actions / lint

No magic number: 4
},
MAX_GROUP_PARTICIPANTS: (env.MAX_GROUP_PARTICIPANTS && Number(env.MAX_GROUP_PARTICIPANTS)) || 500,

Check warning on line 76 in server/config/client.config.ts

View workflow job for this annotation

GitHub Actions / lint

No magic number: 500

Check warning on line 76 in server/config/client.config.ts

View workflow job for this annotation

GitHub Actions / lint

No magic number: 500
MAX_VIDEO_PARTICIPANTS: (env.MAX_VIDEO_PARTICIPANTS && Number(env.MAX_VIDEO_PARTICIPANTS)) || 4,

Check warning on line 77 in server/config/client.config.ts

View workflow job for this annotation

GitHub Actions / lint

No magic number: 4

Check warning on line 77 in server/config/client.config.ts

View workflow job for this annotation

GitHub Actions / lint

No magic number: 4
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"main": "dist/index.js",
"license": "GPL-3.0",
"dependencies": {
"@wireapp/commons": "5.2.2",
"@wireapp/commons": "5.2.3",
"dotenv": "16.3.1",
"dotenv-extended": "2.9.0",
"express": "4.18.2",
Expand Down
10 changes: 5 additions & 5 deletions server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1154,15 +1154,15 @@ __metadata:
languageName: node
linkType: hard

"@wireapp/commons@npm:5.2.2":
version: 5.2.2
resolution: "@wireapp/commons@npm:5.2.2"
"@wireapp/commons@npm:5.2.3":
version: 5.2.3
resolution: "@wireapp/commons@npm:5.2.3"
dependencies:
ansi-regex: 5.0.1
fs-extra: 11.1.0
logdown: 3.3.1
platform: 1.3.6
checksum: ae78630f8299eaae9ee136136981dabdcb4c100c43ec1430882fc154ae21e9fdb17999c1b892140ca5547625e7f502ba83e85ecf62312c8525098865032b6928
checksum: 3cc801e52318db7cb474dcc22809652a91d39916124ed88de7cd413006d62893b84ecb5700ac3f74953a26aea311a3895ebb53b20ab4508f503ca1151c82be9f
languageName: node
linkType: hard

Expand Down Expand Up @@ -5564,7 +5564,7 @@ __metadata:
"@types/hbs": 4.0.4
"@types/jest": ^29.5.8
"@types/node": 18.11.18
"@wireapp/commons": 5.2.2
"@wireapp/commons": 5.2.3
dotenv: 16.3.1
dotenv-extended: 2.9.0
express: 4.18.2
Expand Down
10 changes: 5 additions & 5 deletions src/i18n/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,15 +137,15 @@
"accountForm.terms": "Ich akzeptiere die <terms>Nutzungsbedingungen</terms>",
"accountForm.termsAndPrivacyPolicy": "Ich akzeptiere die <privacypolicy>Datenschutzerklärung</privacypolicy> und <terms>Nutzungsbedingungen</terms>",
"acme.done.button": "Ok",
"acme.done.button.close": "Close window 'Certificate Downloaded'",
"acme.done.headline": "Certificate Downloaded",
"acme.done.paragraph": "The certificate is active now and your device is verified. You can find more details about this certificate in your Wire Settings under Devices.",
"acme.error.button.close": "Close window 'Something went wrong'",
"acme.done.button.close": "Fenster 'Zertifikat herunterladen' schließen",
"acme.done.headline": "Zertifikat heruntergeladen",
"acme.done.paragraph": "Das Zertifikat ist nun aktiv und Ihr Gerät ist verifiziert. Mehr Details zu diesem Zertifikat finden Sie in Ihren Wire-Einstellungen unter Geräte.",
"acme.error.button.close": "Fenster 'Es ist ein Fehler aufgetreten' schließen",
"acme.error.button.primary": "Wiederholen",
"acme.error.button.secondary": "Abbrechen",
"acme.error.headline": "Ein Fehler ist aufgetreten",
"acme.error.paragraph": "Certiticate could not no downloaded <br/> <br/> You can retry to get the certificate now. Or the system will try it automatically in the background during the next 24 hours.",
"acme.inProgress.button.close": "Close window 'Getting Certificate'",
"acme.inProgress.button.close": "Fenster 'Zertifikat erhalten' schließen",
"acme.inProgress.headline": "Zertifikat erhalten",
"acme.inProgress.paragraph.alt": "Herunterladen…",
"acme.inProgress.paragraph.main": "Please navigate to your web browser and log in to the certiticate service. <br/> <br/> In case the website does not open. you can also navigate there manually by following this URL: <br/> <br/> <a href=\"{{url}}\" target=\"_blank\">{{url}}</a>",
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/ru-RU.json
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@
"legalHoldMessageSendingMissingConsentTitle": "Сообщение не может быть отправлено",
"legalHoldModalPrimaryAction": "Принять",
"legalHoldModalSecondaryAction": "Не сейчас",
"legalHoldModalText": "Все будущие сообщения будут записываться устройством с отпечатком:[br][fingerprint][br]Сюда входят удаленные, отредактированные и самоудаляющиеся сообщения во всех беседах.",
"legalHoldModalText": "Все будущие сообщения будут записываться устройством с отпечатком:[br][fingerprint][br]К ним относятся удаленные, отредактированные и самоудаляющиеся сообщения во всех беседах.",
"legalHoldModalTextPassword": "Введите пароль для подтверждения.",
"legalHoldModalTitle": "Запрошены юридические ограничения",
"legalHoldSubjects": "Субъекты юридических ограничений",
Expand Down Expand Up @@ -942,7 +942,7 @@
"modalIntegrationUnavailableHeadline": "Боты в настоящее время недоступны",
"modalIntegrationUnavailableMessage": "Благодарим вас за интерес к ботам. В настоящее время сервис приостановлен, пока мы работаем над следующей версией. Следите за обновлениями.",
"modalLegalHoldConversationMissingConsentMessage": "Из-за юридических ограничений в эту беседу могут быть добавлены только члены команды. [link]Подробнее[/link]",
"modalLegalHoldDeactivatedMessage": "Будущие сообщения не будут сохраняться.",
"modalLegalHoldDeactivatedMessage": "Будущие сообщения записываться не будут.",
"modalLegalHoldDeactivatedTitle": "Юридические ограничения деактивированы",
"modalNewFolderCloseBtn": "Закрыть окно 'Создать новую папку'",
"modalNoAudioCloseBtn": "Закрыть окно 'Микрофон отключен'",
Expand Down
6 changes: 3 additions & 3 deletions src/i18n/si-LK.json
Original file line number Diff line number Diff line change
Expand Up @@ -697,14 +697,14 @@
"legalHoldActivated": "මෙම සංවාදය නෛතික රැඳවුම යටතේ තිබේ",
"legalHoldActivatedLearnMore": "තව දැනගන්න",
"legalHoldDeactivated": "මෙම සංවාදය සඳහා නෛතික රැඳවුම අක්‍රිය කෙරිණි",
"legalHoldDescriptionOthers": "මෙම සංවාදයේ අවම වශයෙන් එක් පුද්ගලයෙක් සඳහා නෛතික රැඳවීම ක්‍රියාත්මක වී ඇත.<br />මකා දැමූ, සංශෝධිත සහ ඉබේ මැකෙන පණිවිඩ ඇතුළුව සියළුම පණිවිඩ අනාගත ප්‍රවේශය සඳහා සුරැකෙනු ඇත.",
"legalHoldDescriptionSelf": "ඔබගේ ගිණුමට නෛතික රැඳවුම ක්‍රියාත්මක වී ඇත.<br />මකා දැමූ, සංශෝධිත සහ ඉබේ මැකෙන පණිවිඩ ඇතුළුව සියළුම පණිවිඩ අනාගත ප්‍රවේශය සඳහා සුරැකෙනු ඇත.<br />ඔබගේ සංවාදවල හවුල්කරුවන් පටිගත කිරීම පිළිබඳව දැනුවත් වනු ඇත.",
"legalHoldDescriptionOthers": "මෙම සංවාදයේ අවම වශයෙන් එක් පුද්ගලයෙක් සඳහා නෛතික රැඳවීම ක්‍රියාත්මක වී ඇත.<br />මකන, සංශෝධිත සහ ඉබේ මැකෙන පණිවිඩ ඇතුළුව සියළුම පණිවිඩ අනාගත ප්‍රවේශය සඳහා සුරැකෙනු ඇත.",
"legalHoldDescriptionSelf": "ඔබගේ ගිණුමට නෛතික රැඳවුම ක්‍රියාත්මක වී ඇත.<br />මකන, සංශෝධිත සහ ඉබේ මැකෙන පණිවිඩ ඇතුළුව සියළුම පණිවිඩ අනාගත ප්‍රවේශය සඳහා සුරැකෙනු ඇත.<br />ඔබගේ සංවාදවල හවුල්කරුවන් පටිගත කිරීම පිළිබඳව දැනුවත් වනු ඇත.",
"legalHoldHeadline": "නෛතික රැඳවුම",
"legalHoldMessageSendingMissingConsentMessage": "නෛතික රැඳවීමට සහාය නොදක්වන අවම වශයෙන් එක් යල් පැන ගිය උපාංගයක් ඔබ සතු නිසා මෙම පණිවිඩය යැවීමට නොහැකිය. ඔබගේ සියළුම උපාංග යාවත්කාල කරන්න හෝ ඒවා යෙදුමේ සැකසුම් හරහා ඉවත් කරන්න. [link]තව දැනගන්න[/link]",
"legalHoldMessageSendingMissingConsentTitle": "පණිවිඩය යැවීමට නොහැකියි",
"legalHoldModalPrimaryAction": "පිළිගන්න",
"legalHoldModalSecondaryAction": "දැන් නොවේ",
"legalHoldModalText": "සියළුම අනාගත පණිවිඩ ඇඟිලි සටහන සමඟ උපාංගය මගින් පටිගත කෙරේ:[br][ඇඟිලි සටහන][br]මෙයට සියළුම සංවාදවල මකා දැමූ, සංශෝධිත සහ ඉබේ මැකෙන පණිවිඩ ඇතුළත් වේ.",
"legalHoldModalText": "සියළුම අනාගත පණිවිඩ ඇඟිලි සටහන සමඟ උපාංගය මගින් පටිගත කෙරේ:[br][ඇඟිලි සටහන][br]මෙයට සියළුම සංවාදවල මකන, සංශෝධිත සහ ඉබේ මැකෙන පණිවිඩ ඇතුළත් වේ.",
"legalHoldModalTextPassword": "තහවුරු කිරීමට මුරපදය ඇතුල් කරන්න.",
"legalHoldModalTitle": "නෛතික රැඳවුමක් ඉල්ලා ඇත",
"legalHoldSubjects": "නෛතික රැඳවුමට යටත් වේ",
Expand Down
17 changes: 11 additions & 6 deletions src/script/E2EIdentity/OIDCService/OIDCService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,30 @@ import {UserManager, User, UserManagerSettings} from 'oidc-client-ts';

import {clearKeysStartingWith} from 'Util/localStorage';

import {OidcClientData} from './OIDCService.types';

interface OIDCServiceConfig {
authorityUrl: string;
audience: string;
redirectUri: string;
clientSecret?: string;
oidcClient: OidcClientData;
}

export class OIDCService {
private userManager: UserManager;

constructor(config: OIDCServiceConfig) {
const {authorityUrl, audience, redirectUri, clientSecret = ''} = config;
const {
authorityUrl,
redirectUri,
oidcClient: {id, secret},
} = config;
const dexioConfig: UserManagerSettings = {
authority: authorityUrl,
client_id: audience,
client_id: id,
redirect_uri: redirectUri,
response_type: 'code',
scope: 'openid profile email',
client_secret: clientSecret,
scope: 'openid profile email offline_access',
client_secret: secret,
};

this.userManager = new UserManager(dexioConfig);
Expand Down
23 changes: 23 additions & 0 deletions src/script/E2EIdentity/OIDCService/OIDCService.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Wire
* Copyright (C) 2023 Wire Swiss GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
*/

export type OidcClientData = {
id: string;
secret?: string;
};
14 changes: 14 additions & 0 deletions src/script/E2EIdentity/OIDCService/OIDCServiceStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,36 @@
*
*/

import {OidcClientData} from './OIDCService.types';

const TargetURLKey = 'E2EIdentity_OIDCService_TargetURL';
const clientDataKey = 'E2EIdentity_OIDCService_ClientData';

const OIDCServiceStore = {
store: {
clientData: (data: OidcClientData) => localStorage.setItem(clientDataKey, JSON.stringify(data)),
targetURL: (url: string) => localStorage.setItem(TargetURLKey, url),
},
get: {
clientData: (): OidcClientData => {
const clientData = localStorage.getItem(clientDataKey);
if (!clientData) {
throw new Error('No client data found in OIDCServiceStore');
}
return JSON.parse(clientData);
},
targetURL: () => localStorage.getItem(TargetURLKey),
},
has: {
clientData: () => localStorage.getItem(clientDataKey) !== null,
targetURL: () => localStorage.getItem(TargetURLKey) !== null,
},
clear: {
clientData: () => localStorage.removeItem(clientDataKey),
targetURL: () => localStorage.removeItem(TargetURLKey),
all: () => {
OIDCServiceStore.clear.targetURL();
OIDCServiceStore.clear.clientData();
},
},
};
Expand Down
25 changes: 19 additions & 6 deletions src/script/E2EIdentity/OIDCService/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,31 @@
import {OIDCService} from './OIDCService';
import {OIDCServiceStore} from './OIDCServiceStorage';

// MOCK: store targetURL and clientData in OIDCServiceStore
// TODO: remove this once we have a proper OIDC service
OIDCServiceStore.store.clientData({
id: 'wireapp',
secret: 'dUpVSGx2dVdFdGQ0dmsxWGhDalQ0SldU',
});

// lots of hardcoded values here, but this is just for testing until we have a proper OIDC service
export const getOIDCServiceInstance = (): OIDCService => {
// if there is no targetURL, we cannot create an OIDCService
const targetURL = OIDCServiceStore.get.targetURL();
const clientData = OIDCServiceStore.get.clientData();

// if there is no targetURL, we cannot create an OIDCService
if (!targetURL) {
throw new Error('No targetURL found in OIDCServiceStore');
throw new Error('No target URL found in OIDCServiceStore');
}
// if there is no clientData ID, we cannot create an OIDCService
if (!clientData || !clientData.id) {
throw new Error('No client data found in OIDCServiceStore');
}

const oidcService = new OIDCService({
audience: '338888153072-ktbh66pv3mr0ua0dn64sphgimeo0p7ss.apps.googleusercontent.com',
authorityUrl: 'https://accounts.google.com' || targetURL,
redirectUri: 'https://local.elna.wire.link:8081/oidc',
clientSecret: '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',
oidcClient: clientData,
authorityUrl: targetURL,
redirectUri: `${location.origin}/oidc`,
});
return oidcService;
};
14 changes: 0 additions & 14 deletions src/script/calling/CallingRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ export class CallingRepository {
*/
subscribeToEvents(): void {
amplify.subscribe(WebAppEvents.CALL.EVENT_FROM_BACKEND, this.onCallEvent);
amplify.subscribe(WebAppEvents.CALL.STATE.TOGGLE, this.toggleState); // This event needs to be kept, it is sent by the wrapper
amplify.subscribe(WebAppEvents.PROPERTIES.UPDATE.CALL.ENABLE_VBR_ENCODING, this.toggleCbrEncoding);
amplify.subscribe(WebAppEvents.PROPERTIES.UPDATED, ({settings}: WebappProperties) => {
this.toggleCbrEncoding(settings.call.enable_vbr_encoding);
Expand Down Expand Up @@ -683,19 +682,6 @@ export class CallingRepository {
// Call actions
//##############################################################################

private readonly toggleState = (withVideo: boolean): void => {
const conversation = this.conversationState.activeConversation();
if (conversation) {
const isActiveCall = this.findCall(conversation.qualifiedId);
const callType = withVideo ? CALL_TYPE.VIDEO : CALL_TYPE.NORMAL;
return (
(isActiveCall
? this.leaveCall(conversation.qualifiedId, LEAVE_CALL_REASON.ELECTRON_TRAY_MENU_MESSAGE)
: this.startCall(conversation, callType)) && undefined
);
}
};

private getConversationType(conversation: Conversation): CONV_TYPE {
if (!conversation.isGroup()) {
return CONV_TYPE.ONEONONE;
Expand Down
Loading

0 comments on commit 9c20fcb

Please sign in to comment.