Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ENABLE_DEV_BACKEND_API env variable [FS-1051] #13912

Merged
merged 3 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.localhost
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ CSP_EXTRA_IMG_SRC="https://*.zinfra.io, https://*.wire.com, https://*.wire.link"
CSP_EXTRA_SCRIPT_SRC="http://localhost:32123, https://*.zinfra.io, https://*.wire.com, https://*.wire.link, https://api.raygun.io"
ENFORCE_HTTPS="false"
FEATURE_ENABLE_DEBUG="true"
ENABLE_DEV_BACKEND_API="true"

#FEATURE_DEFAULT_LOGIN_TEMPORARY_CLIENT="false"
#FEATURE_PERSIST_TEMPORARY_CLIENTS="false"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"@emotion/react": "11.10.4",
"@wireapp/antiscroll-2": "1.3.1",
"@wireapp/avs": "8.2.16",
"@wireapp/core": "32.1.3",
"@wireapp/core": "34.0.0",
"@wireapp/react-ui-kit": "8.17.0",
"@wireapp/store-engine-dexie": "1.7.6",
"@wireapp/store-engine-sqleet": "1.8.6",
Expand Down
1 change: 1 addition & 0 deletions server/ServerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export interface ServerConfig {
BRAND_NAME: string;
CHROME_ORIGIN_TRIAL_TOKEN: string;
COUNTLY_API_KEY: string;
ENABLE_DEV_BACKEND_API: boolean;
ENVIRONMENT: string;
FEATURE: {
ALLOWED_FILE_UPLOAD_EXTENSIONS: string[];
Expand Down
1 change: 1 addition & 0 deletions server/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const config: ServerConfig = {
BRAND_NAME: process.env.BRAND_NAME,
CHROME_ORIGIN_TRIAL_TOKEN: process.env.CHROME_ORIGIN_TRIAL_TOKEN,
COUNTLY_API_KEY: process.env.COUNTLY_API_KEY,
ENABLE_DEV_BACKEND_API: process.env.ENABLE_DEV_BACKEND_API == 'true',
PatrykBuniX marked this conversation as resolved.
Show resolved Hide resolved
ENVIRONMENT: nodeEnvironment,
FEATURE: {
ALLOWED_FILE_UPLOAD_EXTENSIONS: (process.env.FEATURE_ALLOWED_FILE_UPLOAD_EXTENSIONS || '*')
Expand Down
1 change: 1 addition & 0 deletions src/script/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class Configuration {
readonly BACKEND_WS = env.BACKEND_WS || 'wss://prod-nginz-ssl.wire.com';
readonly BRAND_NAME = env.BRAND_NAME || 'Wire';
readonly COUNTLY_API_KEY = env.COUNTLY_API_KEY;
readonly ENABLE_DEV_BACKEND_API = env.ENABLE_DEV_BACKEND_API;
readonly ENVIRONMENT = env.ENVIRONMENT || 'production';
readonly FEATURE = {
...env.FEATURE,
Expand Down
4 changes: 2 additions & 2 deletions src/script/auth/module/action/AuthAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export class AuthAction {
dispatch(AuthActionCreator.startLogin());
try {
// we first init the core without initializing the client for now (this will be done later on)
await core.init(clientType, undefined, false);
await core.init(clientType, {initClient: false});
await this.persistAuthData(clientType, core, dispatch, localStorageAction);
await dispatch(selfAction.fetchSelf());
await dispatch(cookieAction.setCookie(COOKIE_NAME_APP_OPENED, {appInstanceId: getConfig().APP_INSTANCE_ID}));
Expand Down Expand Up @@ -361,7 +361,7 @@ export class AuthAction {
}
const clientType = persist ? ClientType.PERMANENT : ClientType.TEMPORARY;

await core.init(clientType, undefined, false);
await core.init(clientType, {initClient: false});
await this.persistAuthData(clientType, core, dispatch, localStorageAction);

if (options.shouldValidateLocalClient) {
Expand Down
2 changes: 1 addition & 1 deletion src/script/main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ class App {
$(async () => {
const config = Config.getConfig();
const apiClient = container.resolve(APIClient);
await apiClient.useVersion(config.SUPPORTED_API_VERSIONS, config.FEATURE.ENABLE_MLS);
await apiClient.useVersion(config.SUPPORTED_API_VERSIONS, config.ENABLE_DEV_BACKEND_API);
const core = container.resolve(Core);

enableLogging(Config.getConfig().FEATURE.ENABLE_DEBUG);
Expand Down
4 changes: 2 additions & 2 deletions src/script/service/CoreSingleton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {Config} from '../Config';

declare global {
interface Window {
secretsCrypto?: {
systemCrypto?: {
decrypt: (value: Uint8Array) => Promise<Uint8Array>;
encrypt: (encrypted: Uint8Array) => Promise<Uint8Array>;
};
Expand All @@ -54,7 +54,7 @@ export class Core extends Account<Uint8Array> {
* When in an browser context, then this secretsCrypto will be undefined and the core will then use it's internal encryption system
*/
keyingMaterialUpdateThreshold: Config.getConfig().FEATURE.MLS_CONFIG_KEYING_MATERIAL_UPDATE_THRESHOLD,
secretsCrypto: window.secretsCrypto,
systemCrypto: window.systemCrypto,
}
: undefined,
nbPrekeys: 100,
Expand Down
1 change: 1 addition & 0 deletions src/types/window.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ declare global {
BRAND_NAME: string;
CHROME_ORIGIN_TRIAL_TOKEN: string;
COUNTLY_API_KEY: string;
ENABLE_DEV_BACKEND_API: boolean;
ENVIRONMENT: string;
FEATURE: {
ALLOWED_FILE_UPLOAD_EXTENSIONS: string[];
Expand Down
130 changes: 54 additions & 76 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4348,22 +4348,22 @@ __metadata:
languageName: node
linkType: hard

"@wireapp/api-client@npm:^20.6.11":
version: 20.6.11
resolution: "@wireapp/api-client@npm:20.6.11"
"@wireapp/api-client@npm:^21.0.0":
version: 21.0.0
resolution: "@wireapp/api-client@npm:21.0.0"
dependencies:
"@wireapp/commons": ^4.4.8
"@wireapp/priority-queue": ^1.8.8
"@wireapp/protocol-messaging": 1.38.0
"@wireapp/commons": ^4.4.10
"@wireapp/priority-queue": ^1.8.10
"@wireapp/protocol-messaging": 1.39.0
axios: 0.21.4
axios-retry: 3.3.1
http-status-codes: 2.2.0
logdown: 3.3.1
reconnecting-websocket: 4.4.0
spark-md5: 3.0.1
spark-md5: 3.0.2
tough-cookie: 4.1.2
ws: 7.5.3
checksum: ccc020bdf0379a53d2a5c6b4b63f5a15d9076cd32a9e8066b0721e0baa29443548c58f5f46a19beeb3395046e79ba460236d845b8761e823a916ec4dc11a6d81
ws: 8.9.0
checksum: 01adccb489d95bf7e6eba633286b5a2fe58c5a2c42b333f26ffb3131ffd1770363bca9b622282ba0159421e4dffc30e221bc3b397c874b90ce8222d540bb99d4
languageName: node
linkType: hard

Expand All @@ -4381,15 +4381,15 @@ __metadata:
languageName: node
linkType: hard

"@wireapp/commons@npm:^4.4.8":
version: 4.4.8
resolution: "@wireapp/commons@npm:4.4.8"
"@wireapp/commons@npm:^4.4.10":
version: 4.4.10
resolution: "@wireapp/commons@npm:4.4.10"
dependencies:
ansi-regex: 5.0.1
fs-extra: 10.1.0
logdown: 3.3.1
platform: 1.3.6
checksum: 8b3ea5a063dde01943bc71630fcda97733d1fb8acfd66028022b617d40e4d37b15b3a6c308c56db0efbd762b4a692d507745f72552e2de48d027e9e1bf12e08e
checksum: c026b91caffbf8c2abf929abb4e62c33684a1c3bbcde7d6f6164d60a80ce7507969921965fc477145c127eff1b1e3f4d7072f9821c08b8d6cecd9a474894f169
languageName: node
linkType: hard

Expand Down Expand Up @@ -4417,26 +4417,26 @@ __metadata:
languageName: node
linkType: hard

"@wireapp/core@npm:32.1.3":
version: 32.1.3
resolution: "@wireapp/core@npm:32.1.3"
"@wireapp/core@npm:34.0.0":
version: 34.0.0
resolution: "@wireapp/core@npm:34.0.0"
dependencies:
"@wireapp/api-client": ^20.6.11
"@wireapp/commons": ^4.4.8
"@wireapp/api-client": ^21.0.0
"@wireapp/commons": ^4.4.10
"@wireapp/core-crypto": 0.5.2
"@wireapp/cryptobox": 12.8.0
"@wireapp/promise-queue": ^1.3.2
"@wireapp/protocol-messaging": 1.38.0
"@wireapp/store-engine-dexie": ^1.7.8
"@wireapp/promise-queue": ^1.3.4
"@wireapp/protocol-messaging": 1.39.0
"@wireapp/store-engine-dexie": ^1.7.10
axios: ^0.27.2
bazinga64: 5.11.8
bazinga64: 5.11.10
hash.js: 1.1.7
http-status-codes: 2.2.0
idb: 7.0.2
idb: 7.1.0
logdown: 3.3.1
long: 4.0.0
uuidjs: 4.2.12
checksum: e82437acd9dc9e93758c12a202643c08556e2688bcadfa8852d91a46197f3d8165b41572ddfbcdeb933bfabf11b7f0edbc84abac502041363eeba8b585384422
checksum: 6ad38f1c13466dce8b61d6d62199a741948a9ae00f8b2ce10780d763476ef1ffd49f5158a9a85795f7ea96cbb6dfd0cfe8d946a4c53815001b5f30468110b8d2
languageName: node
linkType: hard

Expand Down Expand Up @@ -4498,17 +4498,17 @@ __metadata:
languageName: node
linkType: hard

"@wireapp/priority-queue@npm:^1.8.8":
version: 1.8.8
resolution: "@wireapp/priority-queue@npm:1.8.8"
checksum: 79d6a5a2b8073bb09eb1a5f980c92eb695def27e9e2aff4f8b9d056c265003661bf1f49ae61cc87bed614fa8fcacadeecc5d06286c254bfe5d35562d1c4b65fe
"@wireapp/priority-queue@npm:^1.8.10":
version: 1.8.10
resolution: "@wireapp/priority-queue@npm:1.8.10"
checksum: d4c262ba5df33a43491f073b43e49157bb506ca2bee24afa1b137be89f044219265891bdec7d7404b455c68da886577d6c14b63581561b90486bf4d5c256d04e
languageName: node
linkType: hard

"@wireapp/promise-queue@npm:^1.3.2":
version: 1.3.2
resolution: "@wireapp/promise-queue@npm:1.3.2"
checksum: 972f241f7c33def44eaaf72ec55d26ec30f60c0f4b225ff761bf46cb627081b20128a9800830c397341b0f79d9c667580dfacb737a5690b662011814333f0735
"@wireapp/promise-queue@npm:^1.3.4":
version: 1.3.4
resolution: "@wireapp/promise-queue@npm:1.3.4"
checksum: b46a6613392278075319af062273551819c1e65024cc59eae86f92fdef03e78cb2a65ff44fbb44120c8164c87e1fbfeb1da6369a808f43955cad86c6439a8731
languageName: node
linkType: hard

Expand All @@ -4524,12 +4524,12 @@ __metadata:
languageName: node
linkType: hard

"@wireapp/protocol-messaging@npm:1.38.0":
version: 1.38.0
resolution: "@wireapp/protocol-messaging@npm:1.38.0"
"@wireapp/protocol-messaging@npm:1.39.0":
version: 1.39.0
resolution: "@wireapp/protocol-messaging@npm:1.39.0"
dependencies:
protobufjs: 6.11.3
checksum: ce9957ec0f97e92719accaf394f7a3cdb56f64dfe3950b631122b6fd4e3e89500ed6472b2e34dc6cc0c4ef4a16db2922e5d040e879477ffe3a913ab217332b9e
checksum: 2f905ff7c55905bdb467927e969d1ea6e22264e10c2262a51d2dcfe7bead0e1792a94c769f3de4f5c253c356440efa632173f6670d31db0834b2054d191940f4
languageName: node
linkType: hard

Expand Down Expand Up @@ -4566,14 +4566,14 @@ __metadata:
languageName: node
linkType: hard

"@wireapp/store-engine-dexie@npm:^1.7.8":
version: 1.7.8
resolution: "@wireapp/store-engine-dexie@npm:1.7.8"
"@wireapp/store-engine-dexie@npm:^1.7.10":
version: 1.7.10
resolution: "@wireapp/store-engine-dexie@npm:1.7.10"
dependencies:
dexie: 3.2.2
peerDependencies:
"@wireapp/store-engine": 4.x.x
checksum: e491f17d053a548e7aaa2a143522e7fe2fabe72bc900d0136fd3648a225b6b4dd1b1eac24470852e5d4c852f44b5f29e2bf362e709526287fb91fe7333bf56b9
checksum: 80f89cb63d35689dc13841c7695057fbdb866a36a50b87e7c61a51428c6248a5b4de19f37c0ef9cec1be174f7dd5468ff3bd6a78c90aed5cecc6ebfc2c699f57
languageName: node
linkType: hard

Expand Down Expand Up @@ -5515,20 +5515,20 @@ __metadata:
languageName: node
linkType: hard

"bazinga64@npm:5.11.10":
version: 5.11.10
resolution: "bazinga64@npm:5.11.10"
checksum: c4a7b822223382e536df7589fec26ceaa9d1884bc70101c0cb0e8d89b515a7bd2ea59afc16510c75d985b4f92561af961ee7612037fd987b1752de2e59ffcb33
languageName: node
linkType: hard

"bazinga64@npm:5.11.6":
version: 5.11.6
resolution: "bazinga64@npm:5.11.6"
checksum: e11a0333784cbd5bcf26c16aabe740325b231efef184865218fe6e701873c58fa6f877c48b9217e8781deac751b68dbaea1d9585e80d4c77bdd3c2ba161fef6f
languageName: node
linkType: hard

"bazinga64@npm:5.11.8":
version: 5.11.8
resolution: "bazinga64@npm:5.11.8"
checksum: be3126e95d5061f5995bb56a5f3a0dee2d04cf80fffab082dd3d02879fe77e764bda14ce0e3cf3395332838b60990510938f5c1b0e40c6d39f323a147da99192
languageName: node
linkType: hard

"big.js@npm:^5.2.2":
version: 5.2.2
resolution: "big.js@npm:5.2.2"
Expand Down Expand Up @@ -9679,14 +9679,7 @@ __metadata:
languageName: node
linkType: hard

"idb@npm:7.0.2":
version: 7.0.2
resolution: "idb@npm:7.0.2"
checksum: 60ebe6d5c25d9d82d400fa90e769045a9a3f44dfbc3094b105f8666f025d84f2a779e5416211572fc51f6057f8e130cb1bbfaa06cfd6f196701a8fca9f0eda17
languageName: node
linkType: hard

"idb@npm:^7.0.1":
"idb@npm:7.1.0, idb@npm:^7.0.1":
version: 7.1.0
resolution: "idb@npm:7.1.0"
checksum: 1ae62bcf9f0545390b39ce82a5162720ffeb4cf461a6e64e8bb595df6a4fe94a7f73bba8412ac683e291e5614bab1c6659d961dd4175cb1fa3ee29c1c8631549
Expand Down Expand Up @@ -15679,10 +15672,10 @@ __metadata:
languageName: node
linkType: hard

"spark-md5@npm:3.0.1":
version: 3.0.1
resolution: "spark-md5@npm:3.0.1"
checksum: 613a7f4e20929b832406ef2ed925d696d4d004455360b07ba1a829975fc12a005d745db370cb261ecc827c3dedf3b431a9337f4bab1f1954df776f41a05aaabe
"spark-md5@npm:3.0.2":
version: 3.0.2
resolution: "spark-md5@npm:3.0.2"
checksum: 5feebff0bfabcecf56ba03af3e38fdb068272ed41fbf0a94ff9ef65b9bb9cb1dd69be3684db6542e62497b1eac3ae324c07ac4dcb606465dc36ca048177077bf
languageName: node
linkType: hard

Expand Down Expand Up @@ -17639,7 +17632,7 @@ __metadata:
"@wireapp/antiscroll-2": 1.3.1
"@wireapp/avs": 8.2.16
"@wireapp/copy-config": 1.3.6
"@wireapp/core": 32.1.3
"@wireapp/core": 34.0.0
"@wireapp/eslint-config": 1.12.11
"@wireapp/prettier-config": 0.4.6
"@wireapp/react-ui-kit": 8.17.0
Expand Down Expand Up @@ -18038,22 +18031,7 @@ __metadata:
languageName: node
linkType: hard

"ws@npm:7.5.3":
version: 7.5.3
resolution: "ws@npm:7.5.3"
peerDependencies:
bufferutil: ^4.0.1
utf-8-validate: ^5.0.2
peerDependenciesMeta:
bufferutil:
optional: true
utf-8-validate:
optional: true
checksum: 423dc0d859fa74020f5555140905b862470a60ea1567bb9ad55a087263d7718b9c94f69678be1cee9868925c570f1e6fc79d09f90c39057bc63fa2edbb2c547b
languageName: node
linkType: hard

"ws@npm:^8.8.0":
"ws@npm:8.9.0, ws@npm:^8.8.0":
version: 8.9.0
resolution: "ws@npm:8.9.0"
peerDependencies:
Expand Down