@bitwarden/cli 1.19.1 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/bw.js +1025 -188
- package/build/bw.js.map +1 -1
- package/build/locales/en/messages.json +12 -0
- package/package.json +96 -96
package/build/bw.js
CHANGED
|
@@ -239,7 +239,7 @@ module.exports = require("url");
|
|
|
239
239
|
/* 25 */
|
|
240
240
|
/***/ (function(module) {
|
|
241
241
|
|
|
242
|
-
module.exports = JSON.parse("{\"name\":\"@bitwarden/cli\",\"description\":\"A secure and free password manager for all of your devices.\",\"version\":\"1.
|
|
242
|
+
module.exports = JSON.parse("{\"name\":\"@bitwarden/cli\",\"description\":\"A secure and free password manager for all of your devices.\",\"version\":\"1.20.0\",\"keywords\":[\"bitwarden\",\"password\",\"vault\",\"password manager\",\"cli\"],\"author\":\"Bitwarden Inc. <hello@bitwarden.com> (https://bitwarden.com)\",\"homepage\":\"https://bitwarden.com\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/bitwarden/cli\"},\"license\":\"GPL-3.0-only\",\"scripts\":{\"sub:init\":\"git submodule update --init --recursive\",\"sub:update\":\"git submodule update --remote\",\"sub:pull\":\"git submodule foreach git pull origin master\",\"clean\":\"rimraf dist/**/*\",\"symlink:win\":\"rmdir /S /Q ./jslib && cmd /c mklink /J .\\\\jslib ..\\\\jslib\",\"symlink:mac\":\"npm run symlink:lin\",\"symlink:lin\":\"rm -rf ./jslib && ln -s ../jslib ./jslib\",\"build\":\"webpack\",\"build:debug\":\"npm run build && node --inspect ./build/bw.js\",\"build:watch\":\"webpack --watch\",\"build:prod\":\"cross-env NODE_ENV=production webpack\",\"build:prod:watch\":\"cross-env NODE_ENV=production webpack --watch\",\"package\":\"npm run package:win && npm run package:mac && npm run package:lin\",\"package:win\":\"pkg . --targets win-x64 --output ./dist/windows/bw.exe --build\",\"package:mac\":\"pkg . --targets macos-x64 --output ./dist/macos/bw\",\"package:lin\":\"pkg . --targets linux-x64 --output ./dist/linux/bw\",\"debug\":\"node --inspect ./build/bw.js\",\"dist\":\"npm run build:prod && npm run clean && npm run package\",\"dist:win\":\"npm run build:prod && npm run clean && npm run package:win\",\"dist:mac\":\"npm run build:prod && npm run clean && npm run package:mac\",\"dist:lin\":\"npm run build:prod && npm run clean && npm run package:lin\",\"publish:npm\":\"npm run build:prod && npm publish --access public\",\"lint\":\"tslint 'src/**/*.ts' 'spec/**/*.ts'\",\"lint:fix\":\"tslint 'src/**/*.ts' 'spec/**/*.ts' --fix\"},\"bin\":{\"bw\":\"build/bw.js\"},\"pkg\":{\"assets\":\"./build/**/*\"},\"devDependencies\":{\"@types/inquirer\":\"^7.3.1\",\"@types/jsdom\":\"^16.2.10\",\"@types/lowdb\":\"^1.0.10\",\"@types/lunr\":\"^2.3.3\",\"@types/node\":\"^14.17.1\",\"@types/node-fetch\":\"^2.5.10\",\"@types/node-forge\":\"^0.9.7\",\"@types/papaparse\":\"^5.2.5\",\"@types/tldjs\":\"^2.3.0\",\"@types/zxcvbn\":\"^4.4.1\",\"clean-webpack-plugin\":\"^3.0.0\",\"copy-webpack-plugin\":\"^6.4.0\",\"cross-env\":\"^7.0.3\",\"pkg\":\"^5.1.0\",\"ts-loader\":\"^8.2.0\",\"tsconfig-paths-webpack-plugin\":\"^3.5.1\",\"tslint\":\"^6.1.3\",\"tslint-loader\":\"^3.5.4\",\"typescript\":\"4.1.5\",\"webpack\":\"^4.46.0\",\"webpack-cli\":\"^4.7.0\",\"webpack-node-externals\":\"^3.0.0\"},\"dependencies\":{\"big-integer\":\"1.6.48\",\"browser-hrtime\":\"^1.1.8\",\"chalk\":\"^4.1.1\",\"commander\":\"7.2.0\",\"form-data\":\"4.0.0\",\"https-proxy-agent\":\"5.0.0\",\"inquirer\":\"8.0.0\",\"jsdom\":\"^16.5.3\",\"lowdb\":\"1.0.0\",\"lunr\":\"^2.3.9\",\"node-fetch\":\"^2.6.1\",\"node-forge\":\"0.10.0\",\"open\":\"^8.0.8\",\"papaparse\":\"^5.3.0\",\"rxjs\":\"6.6.7\",\"tldjs\":\"^2.3.1\",\"zxcvbn\":\"^4.4.2\"},\"engines\":{\"node\":\"~14\",\"npm\":\"~7\"}}");
|
|
243
243
|
|
|
244
244
|
/***/ }),
|
|
245
245
|
/* 26 */
|
|
@@ -304,6 +304,17 @@ class AuthResult {
|
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
306
|
|
|
307
|
+
// CONCATENATED MODULE: ./jslib/common/src/models/request/account/setKeyConnectorKeyRequest.ts
|
|
308
|
+
class SetKeyConnectorKeyRequest {
|
|
309
|
+
constructor(key, kdf, kdfIterations, orgIdentifier, keys) {
|
|
310
|
+
this.key = key;
|
|
311
|
+
this.kdf = kdf;
|
|
312
|
+
this.kdfIterations = kdfIterations;
|
|
313
|
+
this.orgIdentifier = orgIdentifier;
|
|
314
|
+
this.keys = keys;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
307
318
|
// CONCATENATED MODULE: ./jslib/common/src/models/request/deviceRequest.ts
|
|
308
319
|
class DeviceRequest {
|
|
309
320
|
constructor(appId, platformUtilsService) {
|
|
@@ -314,6 +325,13 @@ class DeviceRequest {
|
|
|
314
325
|
}
|
|
315
326
|
}
|
|
316
327
|
|
|
328
|
+
// CONCATENATED MODULE: ./jslib/common/src/models/request/keyConnectorUserKeyRequest.ts
|
|
329
|
+
class KeyConnectorUserKeyRequest {
|
|
330
|
+
constructor(key) {
|
|
331
|
+
this.key = key;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
317
335
|
// CONCATENATED MODULE: ./jslib/common/src/models/request/keysRequest.ts
|
|
318
336
|
class KeysRequest {
|
|
319
337
|
constructor(publicKey, encryptedPrivateKey) {
|
|
@@ -523,7 +541,8 @@ class utils_Utils {
|
|
|
523
541
|
return null;
|
|
524
542
|
}
|
|
525
543
|
let httpUrl = uriString.startsWith('http://') || uriString.startsWith('https://');
|
|
526
|
-
if (!httpUrl && uriString.indexOf('://') < 0 && utils_Utils.tldEndingRegex.test(uriString)
|
|
544
|
+
if (!httpUrl && uriString.indexOf('://') < 0 && utils_Utils.tldEndingRegex.test(uriString) &&
|
|
545
|
+
uriString.indexOf('@') < 0) {
|
|
527
546
|
uriString = 'http://' + uriString;
|
|
528
547
|
httpUrl = true;
|
|
529
548
|
}
|
|
@@ -540,7 +559,9 @@ class utils_Utils {
|
|
|
540
559
|
const urlDomain = external_tldjs_ != null && external_tldjs_["getDomain"] != null ? external_tldjs_["getDomain"](url.hostname) : null;
|
|
541
560
|
return urlDomain != null ? urlDomain : url.hostname;
|
|
542
561
|
}
|
|
543
|
-
catch (e) {
|
|
562
|
+
catch (e) {
|
|
563
|
+
// Invalid domain, try another approach below.
|
|
564
|
+
}
|
|
544
565
|
}
|
|
545
566
|
try {
|
|
546
567
|
const domain = external_tldjs_ != null && external_tldjs_["getDomain"] != null ? external_tldjs_["getDomain"](uriString) : null;
|
|
@@ -655,7 +676,9 @@ class utils_Utils {
|
|
|
655
676
|
return anchor;
|
|
656
677
|
}
|
|
657
678
|
}
|
|
658
|
-
catch (e) {
|
|
679
|
+
catch (e) {
|
|
680
|
+
// Ignore error
|
|
681
|
+
}
|
|
659
682
|
return null;
|
|
660
683
|
}
|
|
661
684
|
}
|
|
@@ -759,6 +782,9 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
|
|
759
782
|
|
|
760
783
|
|
|
761
784
|
|
|
785
|
+
|
|
786
|
+
|
|
787
|
+
|
|
762
788
|
const TwoFactorProviders = {
|
|
763
789
|
[TwoFactorProviderType.Authenticator]: {
|
|
764
790
|
type: TwoFactorProviderType.Authenticator,
|
|
@@ -810,7 +836,7 @@ const TwoFactorProviders = {
|
|
|
810
836
|
},
|
|
811
837
|
};
|
|
812
838
|
class auth_service_AuthService {
|
|
813
|
-
constructor(cryptoService, apiService, userService, tokenService, appIdService, i18nService, platformUtilsService, messagingService, vaultTimeoutService, logService, setCryptoKeys = true) {
|
|
839
|
+
constructor(cryptoService, apiService, userService, tokenService, appIdService, i18nService, platformUtilsService, messagingService, vaultTimeoutService, logService, cryptoFunctionService, environmentService, keyConnectorService, setCryptoKeys = true) {
|
|
814
840
|
this.cryptoService = cryptoService;
|
|
815
841
|
this.apiService = apiService;
|
|
816
842
|
this.userService = userService;
|
|
@@ -821,6 +847,9 @@ class auth_service_AuthService {
|
|
|
821
847
|
this.messagingService = messagingService;
|
|
822
848
|
this.vaultTimeoutService = vaultTimeoutService;
|
|
823
849
|
this.logService = logService;
|
|
850
|
+
this.cryptoFunctionService = cryptoFunctionService;
|
|
851
|
+
this.environmentService = environmentService;
|
|
852
|
+
this.keyConnectorService = keyConnectorService;
|
|
824
853
|
this.setCryptoKeys = setCryptoKeys;
|
|
825
854
|
this.selectedTwoFactorProviderType = null;
|
|
826
855
|
}
|
|
@@ -846,24 +875,24 @@ class auth_service_AuthService {
|
|
|
846
875
|
const key = yield this.makePreloginKey(masterPassword, email);
|
|
847
876
|
const hashedPassword = yield this.cryptoService.hashPassword(masterPassword, key);
|
|
848
877
|
const localHashedPassword = yield this.cryptoService.hashPassword(masterPassword, key, HashPurpose.LocalAuthorization);
|
|
849
|
-
return yield this.logInHelper(email, hashedPassword, localHashedPassword, null, null, null, null, null, key, null, null, null, captchaToken);
|
|
878
|
+
return yield this.logInHelper(email, hashedPassword, localHashedPassword, null, null, null, null, null, key, null, null, null, captchaToken, null);
|
|
850
879
|
});
|
|
851
880
|
}
|
|
852
|
-
logInSso(code, codeVerifier, redirectUrl) {
|
|
881
|
+
logInSso(code, codeVerifier, redirectUrl, orgId) {
|
|
853
882
|
return __awaiter(this, void 0, void 0, function* () {
|
|
854
883
|
this.selectedTwoFactorProviderType = null;
|
|
855
|
-
return yield this.logInHelper(null, null, null, code, codeVerifier, redirectUrl, null, null, null, null, null, null);
|
|
884
|
+
return yield this.logInHelper(null, null, null, code, codeVerifier, redirectUrl, null, null, null, null, null, null, null, orgId);
|
|
856
885
|
});
|
|
857
886
|
}
|
|
858
887
|
logInApiKey(clientId, clientSecret) {
|
|
859
888
|
return __awaiter(this, void 0, void 0, function* () {
|
|
860
889
|
this.selectedTwoFactorProviderType = null;
|
|
861
|
-
return yield this.logInHelper(null, null, null, null, null, null, clientId, clientSecret, null, null, null, null);
|
|
890
|
+
return yield this.logInHelper(null, null, null, null, null, null, clientId, clientSecret, null, null, null, null, null, null);
|
|
862
891
|
});
|
|
863
892
|
}
|
|
864
893
|
logInTwoFactor(twoFactorProvider, twoFactorToken, remember) {
|
|
865
894
|
return __awaiter(this, void 0, void 0, function* () {
|
|
866
|
-
return yield this.logInHelper(this.email, this.masterPasswordHash, this.localMasterPasswordHash, this.code, this.codeVerifier, this.ssoRedirectUrl, this.clientId, this.clientSecret, this.key, twoFactorProvider, twoFactorToken, remember, this.captchaToken);
|
|
895
|
+
return yield this.logInHelper(this.email, this.masterPasswordHash, this.localMasterPasswordHash, this.code, this.codeVerifier, this.ssoRedirectUrl, this.clientId, this.clientSecret, this.key, twoFactorProvider, twoFactorToken, remember, this.captchaToken, null);
|
|
867
896
|
});
|
|
868
897
|
}
|
|
869
898
|
logInComplete(email, masterPassword, twoFactorProvider, twoFactorToken, remember, captchaToken) {
|
|
@@ -872,19 +901,19 @@ class auth_service_AuthService {
|
|
|
872
901
|
const key = yield this.makePreloginKey(masterPassword, email);
|
|
873
902
|
const hashedPassword = yield this.cryptoService.hashPassword(masterPassword, key);
|
|
874
903
|
const localHashedPassword = yield this.cryptoService.hashPassword(masterPassword, key, HashPurpose.LocalAuthorization);
|
|
875
|
-
return yield this.logInHelper(email, hashedPassword, localHashedPassword, null, null, null, null, null, key, twoFactorProvider, twoFactorToken, remember, captchaToken);
|
|
904
|
+
return yield this.logInHelper(email, hashedPassword, localHashedPassword, null, null, null, null, null, key, twoFactorProvider, twoFactorToken, remember, captchaToken, null);
|
|
876
905
|
});
|
|
877
906
|
}
|
|
878
907
|
logInSsoComplete(code, codeVerifier, redirectUrl, twoFactorProvider, twoFactorToken, remember) {
|
|
879
908
|
return __awaiter(this, void 0, void 0, function* () {
|
|
880
909
|
this.selectedTwoFactorProviderType = null;
|
|
881
|
-
return yield this.logInHelper(null, null, null, code, codeVerifier, redirectUrl, null, null, null, twoFactorProvider, twoFactorToken, remember);
|
|
910
|
+
return yield this.logInHelper(null, null, null, code, codeVerifier, redirectUrl, null, null, null, twoFactorProvider, twoFactorToken, remember, null, null);
|
|
882
911
|
});
|
|
883
912
|
}
|
|
884
913
|
logInApiKeyComplete(clientId, clientSecret, twoFactorProvider, twoFactorToken, remember) {
|
|
885
914
|
return __awaiter(this, void 0, void 0, function* () {
|
|
886
915
|
this.selectedTwoFactorProviderType = null;
|
|
887
|
-
return yield this.logInHelper(null, null, null, null, null, null, clientId, clientSecret, null, twoFactorProvider, twoFactorToken, remember);
|
|
916
|
+
return yield this.logInHelper(null, null, null, null, null, null, clientId, clientSecret, null, twoFactorProvider, twoFactorToken, remember, null, null);
|
|
888
917
|
});
|
|
889
918
|
}
|
|
890
919
|
logOut(callback) {
|
|
@@ -968,7 +997,7 @@ class auth_service_AuthService {
|
|
|
968
997
|
authingWithPassword() {
|
|
969
998
|
return this.email != null && this.masterPasswordHash != null;
|
|
970
999
|
}
|
|
971
|
-
logInHelper(email, hashedPassword, localHashedPassword, code, codeVerifier, redirectUrl, clientId, clientSecret, key, twoFactorProvider, twoFactorToken, remember, captchaToken) {
|
|
1000
|
+
logInHelper(email, hashedPassword, localHashedPassword, code, codeVerifier, redirectUrl, clientId, clientSecret, key, twoFactorProvider, twoFactorToken, remember, captchaToken, orgId) {
|
|
972
1001
|
return __awaiter(this, void 0, void 0, function* () {
|
|
973
1002
|
const storedTwoFactorToken = yield this.tokenService.getTwoFactorToken(email);
|
|
974
1003
|
const appId = yield this.appIdService.getAppId();
|
|
@@ -1046,6 +1075,13 @@ class auth_service_AuthService {
|
|
|
1046
1075
|
}
|
|
1047
1076
|
// Skip this step during SSO new user flow. No key is returned from server.
|
|
1048
1077
|
if (code == null || tokenResponse.key != null) {
|
|
1078
|
+
if (tokenResponse.keyConnectorUrl != null) {
|
|
1079
|
+
yield this.keyConnectorService.getAndSetKey(tokenResponse.keyConnectorUrl);
|
|
1080
|
+
}
|
|
1081
|
+
else if (tokenResponse.apiUseKeyConnector) {
|
|
1082
|
+
const keyConnectorUrl = this.environmentService.getKeyConnectorUrl();
|
|
1083
|
+
yield this.keyConnectorService.getAndSetKey(keyConnectorUrl);
|
|
1084
|
+
}
|
|
1049
1085
|
yield this.cryptoService.setEncKey(tokenResponse.key);
|
|
1050
1086
|
// User doesn't have a key pair yet (old account), let's generate one for them
|
|
1051
1087
|
if (tokenResponse.privateKey == null) {
|
|
@@ -1055,12 +1091,29 @@ class auth_service_AuthService {
|
|
|
1055
1091
|
tokenResponse.privateKey = keyPair[1].encryptedString;
|
|
1056
1092
|
}
|
|
1057
1093
|
catch (e) {
|
|
1058
|
-
// tslint:disable-next-line
|
|
1059
1094
|
this.logService.error(e);
|
|
1060
1095
|
}
|
|
1061
1096
|
}
|
|
1062
1097
|
yield this.cryptoService.setEncPrivateKey(tokenResponse.privateKey);
|
|
1063
1098
|
}
|
|
1099
|
+
else if (tokenResponse.keyConnectorUrl != null) {
|
|
1100
|
+
const password = yield this.cryptoFunctionService.randomBytes(64);
|
|
1101
|
+
const k = yield this.cryptoService.makeKey(utils_Utils.fromBufferToB64(password), this.tokenService.getEmail(), tokenResponse.kdf, tokenResponse.kdfIterations);
|
|
1102
|
+
const keyConnectorRequest = new KeyConnectorUserKeyRequest(k.encKeyB64);
|
|
1103
|
+
yield this.cryptoService.setKey(k);
|
|
1104
|
+
const encKey = yield this.cryptoService.makeEncKey(k);
|
|
1105
|
+
yield this.cryptoService.setEncKey(encKey[1].encryptedString);
|
|
1106
|
+
const [pubKey, privKey] = yield this.cryptoService.makeKeyPair();
|
|
1107
|
+
try {
|
|
1108
|
+
yield this.apiService.postUserKeyToKeyConnector(tokenResponse.keyConnectorUrl, keyConnectorRequest);
|
|
1109
|
+
}
|
|
1110
|
+
catch (e) {
|
|
1111
|
+
throw new Error('Unable to reach key connector');
|
|
1112
|
+
}
|
|
1113
|
+
const keys = new KeysRequest(pubKey, privKey.encryptedString);
|
|
1114
|
+
const setPasswordRequest = new SetKeyConnectorKeyRequest(encKey[1].encryptedString, tokenResponse.kdf, tokenResponse.kdfIterations, orgId, keys);
|
|
1115
|
+
yield this.apiService.postSetKeyConnectorKey(setPasswordRequest);
|
|
1116
|
+
}
|
|
1064
1117
|
}
|
|
1065
1118
|
if (this.vaultTimeoutService != null) {
|
|
1066
1119
|
this.vaultTimeoutService.biometricLocked = false;
|
|
@@ -1526,6 +1579,9 @@ class cliPlatformUtils_service_CliPlatformUtilsService {
|
|
|
1526
1579
|
getApplicationVersion() {
|
|
1527
1580
|
return Promise.resolve(this.packageJson.version);
|
|
1528
1581
|
}
|
|
1582
|
+
getApplicationVersionSync() {
|
|
1583
|
+
return this.packageJson.version;
|
|
1584
|
+
}
|
|
1529
1585
|
supportsWebAuthn(win) {
|
|
1530
1586
|
return false;
|
|
1531
1587
|
}
|
|
@@ -1827,6 +1883,7 @@ var FieldType;
|
|
|
1827
1883
|
FieldType[FieldType["Text"] = 0] = "Text";
|
|
1828
1884
|
FieldType[FieldType["Hidden"] = 1] = "Hidden";
|
|
1829
1885
|
FieldType[FieldType["Boolean"] = 2] = "Boolean";
|
|
1886
|
+
FieldType[FieldType["Linked"] = 3] = "Linked";
|
|
1830
1887
|
})(FieldType || (FieldType = {}));
|
|
1831
1888
|
|
|
1832
1889
|
// CONCATENATED MODULE: ./jslib/common/src/enums/uriMatchType.ts
|
|
@@ -1879,6 +1936,7 @@ class FieldData {
|
|
|
1879
1936
|
this.type = response.type;
|
|
1880
1937
|
this.name = response.name;
|
|
1881
1938
|
this.value = response.value;
|
|
1939
|
+
this.linkedId = response.linkedId;
|
|
1882
1940
|
}
|
|
1883
1941
|
}
|
|
1884
1942
|
|
|
@@ -2040,7 +2098,9 @@ class AttachmentView {
|
|
|
2040
2098
|
return parseInt(this.size, null);
|
|
2041
2099
|
}
|
|
2042
2100
|
}
|
|
2043
|
-
catch (_a) {
|
|
2101
|
+
catch (_a) {
|
|
2102
|
+
// Invalid file size.
|
|
2103
|
+
}
|
|
2044
2104
|
return 0;
|
|
2045
2105
|
}
|
|
2046
2106
|
}
|
|
@@ -2291,10 +2351,95 @@ class attachment_Attachment extends domainBase_Domain {
|
|
|
2291
2351
|
}
|
|
2292
2352
|
}
|
|
2293
2353
|
|
|
2354
|
+
// CONCATENATED MODULE: ./jslib/common/src/models/view/itemView.ts
|
|
2355
|
+
class ItemView {
|
|
2356
|
+
}
|
|
2357
|
+
|
|
2358
|
+
// CONCATENATED MODULE: ./jslib/common/src/enums/linkedIdType.ts
|
|
2359
|
+
// LoginView
|
|
2360
|
+
var LoginLinkedId;
|
|
2361
|
+
(function (LoginLinkedId) {
|
|
2362
|
+
LoginLinkedId[LoginLinkedId["Username"] = 100] = "Username";
|
|
2363
|
+
LoginLinkedId[LoginLinkedId["Password"] = 101] = "Password";
|
|
2364
|
+
})(LoginLinkedId || (LoginLinkedId = {}));
|
|
2365
|
+
// CardView
|
|
2366
|
+
var CardLinkedId;
|
|
2367
|
+
(function (CardLinkedId) {
|
|
2368
|
+
CardLinkedId[CardLinkedId["CardholderName"] = 300] = "CardholderName";
|
|
2369
|
+
CardLinkedId[CardLinkedId["ExpMonth"] = 301] = "ExpMonth";
|
|
2370
|
+
CardLinkedId[CardLinkedId["ExpYear"] = 302] = "ExpYear";
|
|
2371
|
+
CardLinkedId[CardLinkedId["Code"] = 303] = "Code";
|
|
2372
|
+
CardLinkedId[CardLinkedId["Brand"] = 304] = "Brand";
|
|
2373
|
+
CardLinkedId[CardLinkedId["Number"] = 305] = "Number";
|
|
2374
|
+
})(CardLinkedId || (CardLinkedId = {}));
|
|
2375
|
+
// IdentityView
|
|
2376
|
+
var IdentityLinkedId;
|
|
2377
|
+
(function (IdentityLinkedId) {
|
|
2378
|
+
IdentityLinkedId[IdentityLinkedId["Title"] = 400] = "Title";
|
|
2379
|
+
IdentityLinkedId[IdentityLinkedId["MiddleName"] = 401] = "MiddleName";
|
|
2380
|
+
IdentityLinkedId[IdentityLinkedId["Address1"] = 402] = "Address1";
|
|
2381
|
+
IdentityLinkedId[IdentityLinkedId["Address2"] = 403] = "Address2";
|
|
2382
|
+
IdentityLinkedId[IdentityLinkedId["Address3"] = 404] = "Address3";
|
|
2383
|
+
IdentityLinkedId[IdentityLinkedId["City"] = 405] = "City";
|
|
2384
|
+
IdentityLinkedId[IdentityLinkedId["State"] = 406] = "State";
|
|
2385
|
+
IdentityLinkedId[IdentityLinkedId["PostalCode"] = 407] = "PostalCode";
|
|
2386
|
+
IdentityLinkedId[IdentityLinkedId["Country"] = 408] = "Country";
|
|
2387
|
+
IdentityLinkedId[IdentityLinkedId["Company"] = 409] = "Company";
|
|
2388
|
+
IdentityLinkedId[IdentityLinkedId["Email"] = 410] = "Email";
|
|
2389
|
+
IdentityLinkedId[IdentityLinkedId["Phone"] = 411] = "Phone";
|
|
2390
|
+
IdentityLinkedId[IdentityLinkedId["Ssn"] = 412] = "Ssn";
|
|
2391
|
+
IdentityLinkedId[IdentityLinkedId["Username"] = 413] = "Username";
|
|
2392
|
+
IdentityLinkedId[IdentityLinkedId["PassportNumber"] = 414] = "PassportNumber";
|
|
2393
|
+
IdentityLinkedId[IdentityLinkedId["LicenseNumber"] = 415] = "LicenseNumber";
|
|
2394
|
+
IdentityLinkedId[IdentityLinkedId["FirstName"] = 416] = "FirstName";
|
|
2395
|
+
IdentityLinkedId[IdentityLinkedId["LastName"] = 417] = "LastName";
|
|
2396
|
+
IdentityLinkedId[IdentityLinkedId["FullName"] = 418] = "FullName";
|
|
2397
|
+
})(IdentityLinkedId || (IdentityLinkedId = {}));
|
|
2398
|
+
|
|
2399
|
+
// CONCATENATED MODULE: ./jslib/common/src/misc/linkedFieldOption.decorator.ts
|
|
2400
|
+
class LinkedMetadata {
|
|
2401
|
+
constructor(propertyKey, _i18nKey) {
|
|
2402
|
+
this.propertyKey = propertyKey;
|
|
2403
|
+
this._i18nKey = _i18nKey;
|
|
2404
|
+
}
|
|
2405
|
+
get i18nKey() {
|
|
2406
|
+
var _a;
|
|
2407
|
+
return (_a = this._i18nKey) !== null && _a !== void 0 ? _a : this.propertyKey;
|
|
2408
|
+
}
|
|
2409
|
+
}
|
|
2410
|
+
/**
|
|
2411
|
+
* A decorator used to set metadata used by Linked custom fields. Apply it to a class property or getter to make it
|
|
2412
|
+
* available as a Linked custom field option.
|
|
2413
|
+
* @param id - A unique value that is saved in the Field model. It is used to look up the decorated class property.
|
|
2414
|
+
* @param i18nKey - The i18n key used to describe the decorated class property in the UI. If it is null, then the name
|
|
2415
|
+
* of the class property will be used as the i18n key.
|
|
2416
|
+
*/
|
|
2417
|
+
function linkedFieldOption(id, i18nKey) {
|
|
2418
|
+
return (prototype, propertyKey) => {
|
|
2419
|
+
if (prototype.linkedFieldOptions == null) {
|
|
2420
|
+
prototype.linkedFieldOptions = new Map();
|
|
2421
|
+
}
|
|
2422
|
+
prototype.linkedFieldOptions.set(id, new LinkedMetadata(propertyKey, i18nKey));
|
|
2423
|
+
};
|
|
2424
|
+
}
|
|
2425
|
+
|
|
2294
2426
|
// CONCATENATED MODULE: ./jslib/common/src/models/view/cardView.ts
|
|
2295
|
-
|
|
2427
|
+
var cardView_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2428
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2429
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2430
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2431
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2432
|
+
};
|
|
2433
|
+
var cardView_metadata = (undefined && undefined.__metadata) || function (k, v) {
|
|
2434
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2435
|
+
};
|
|
2436
|
+
|
|
2437
|
+
|
|
2438
|
+
|
|
2439
|
+
class cardView_CardView extends ItemView {
|
|
2296
2440
|
// tslint:enable
|
|
2297
2441
|
constructor(c) {
|
|
2442
|
+
super();
|
|
2298
2443
|
this.cardholderName = null;
|
|
2299
2444
|
this.expMonth = null;
|
|
2300
2445
|
this.expYear = null;
|
|
@@ -2303,7 +2448,6 @@ class CardView {
|
|
|
2303
2448
|
this._brand = null;
|
|
2304
2449
|
this._number = null;
|
|
2305
2450
|
this._subTitle = null;
|
|
2306
|
-
// ctor
|
|
2307
2451
|
}
|
|
2308
2452
|
get maskedCode() {
|
|
2309
2453
|
return this.code != null ? '•'.repeat(this.code.length) : null;
|
|
@@ -2354,6 +2498,32 @@ class CardView {
|
|
|
2354
2498
|
return year.length === 2 ? '20' + year : year;
|
|
2355
2499
|
}
|
|
2356
2500
|
}
|
|
2501
|
+
cardView_decorate([
|
|
2502
|
+
linkedFieldOption(CardLinkedId.CardholderName),
|
|
2503
|
+
cardView_metadata("design:type", String)
|
|
2504
|
+
], cardView_CardView.prototype, "cardholderName", void 0);
|
|
2505
|
+
cardView_decorate([
|
|
2506
|
+
linkedFieldOption(CardLinkedId.ExpMonth, 'expirationMonth'),
|
|
2507
|
+
cardView_metadata("design:type", String)
|
|
2508
|
+
], cardView_CardView.prototype, "expMonth", void 0);
|
|
2509
|
+
cardView_decorate([
|
|
2510
|
+
linkedFieldOption(CardLinkedId.ExpYear, 'expirationYear'),
|
|
2511
|
+
cardView_metadata("design:type", String)
|
|
2512
|
+
], cardView_CardView.prototype, "expYear", void 0);
|
|
2513
|
+
cardView_decorate([
|
|
2514
|
+
linkedFieldOption(CardLinkedId.Code, 'securityCode'),
|
|
2515
|
+
cardView_metadata("design:type", String)
|
|
2516
|
+
], cardView_CardView.prototype, "code", void 0);
|
|
2517
|
+
cardView_decorate([
|
|
2518
|
+
linkedFieldOption(CardLinkedId.Brand),
|
|
2519
|
+
cardView_metadata("design:type", String),
|
|
2520
|
+
cardView_metadata("design:paramtypes", [String])
|
|
2521
|
+
], cardView_CardView.prototype, "brand", null);
|
|
2522
|
+
cardView_decorate([
|
|
2523
|
+
linkedFieldOption(CardLinkedId.Number),
|
|
2524
|
+
cardView_metadata("design:type", String),
|
|
2525
|
+
cardView_metadata("design:paramtypes", [String])
|
|
2526
|
+
], cardView_CardView.prototype, "number", null);
|
|
2357
2527
|
|
|
2358
2528
|
// CONCATENATED MODULE: ./jslib/common/src/models/domain/card.ts
|
|
2359
2529
|
|
|
@@ -2375,7 +2545,7 @@ class card_Card extends domainBase_Domain {
|
|
|
2375
2545
|
}, alreadyEncrypted, []);
|
|
2376
2546
|
}
|
|
2377
2547
|
decrypt(orgId, encKey) {
|
|
2378
|
-
return this.decryptObj(new
|
|
2548
|
+
return this.decryptObj(new cardView_CardView(this), {
|
|
2379
2549
|
cardholderName: null,
|
|
2380
2550
|
brand: null,
|
|
2381
2551
|
number: null,
|
|
@@ -2406,10 +2576,23 @@ var CipherRepromptType;
|
|
|
2406
2576
|
})(CipherRepromptType || (CipherRepromptType = {}));
|
|
2407
2577
|
|
|
2408
2578
|
// CONCATENATED MODULE: ./jslib/common/src/models/view/identityView.ts
|
|
2579
|
+
var identityView_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2580
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2581
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2582
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2583
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2584
|
+
};
|
|
2585
|
+
var identityView_metadata = (undefined && undefined.__metadata) || function (k, v) {
|
|
2586
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2587
|
+
};
|
|
2588
|
+
|
|
2409
2589
|
|
|
2410
|
-
|
|
2590
|
+
|
|
2591
|
+
|
|
2592
|
+
class identityView_IdentityView extends ItemView {
|
|
2411
2593
|
// tslint:enable
|
|
2412
2594
|
constructor(i) {
|
|
2595
|
+
super();
|
|
2413
2596
|
this.title = null;
|
|
2414
2597
|
this.middleName = null;
|
|
2415
2598
|
this.address1 = null;
|
|
@@ -2430,7 +2613,6 @@ class identityView_IdentityView {
|
|
|
2430
2613
|
this._firstName = null;
|
|
2431
2614
|
this._lastName = null;
|
|
2432
2615
|
this._subTitle = null;
|
|
2433
|
-
// ctor
|
|
2434
2616
|
}
|
|
2435
2617
|
get firstName() {
|
|
2436
2618
|
return this._firstName;
|
|
@@ -2511,11 +2693,103 @@ class identityView_IdentityView {
|
|
|
2511
2693
|
return addressPart2;
|
|
2512
2694
|
}
|
|
2513
2695
|
}
|
|
2696
|
+
identityView_decorate([
|
|
2697
|
+
linkedFieldOption(IdentityLinkedId.Title),
|
|
2698
|
+
identityView_metadata("design:type", String)
|
|
2699
|
+
], identityView_IdentityView.prototype, "title", void 0);
|
|
2700
|
+
identityView_decorate([
|
|
2701
|
+
linkedFieldOption(IdentityLinkedId.MiddleName),
|
|
2702
|
+
identityView_metadata("design:type", String)
|
|
2703
|
+
], identityView_IdentityView.prototype, "middleName", void 0);
|
|
2704
|
+
identityView_decorate([
|
|
2705
|
+
linkedFieldOption(IdentityLinkedId.Address1),
|
|
2706
|
+
identityView_metadata("design:type", String)
|
|
2707
|
+
], identityView_IdentityView.prototype, "address1", void 0);
|
|
2708
|
+
identityView_decorate([
|
|
2709
|
+
linkedFieldOption(IdentityLinkedId.Address2),
|
|
2710
|
+
identityView_metadata("design:type", String)
|
|
2711
|
+
], identityView_IdentityView.prototype, "address2", void 0);
|
|
2712
|
+
identityView_decorate([
|
|
2713
|
+
linkedFieldOption(IdentityLinkedId.Address3),
|
|
2714
|
+
identityView_metadata("design:type", String)
|
|
2715
|
+
], identityView_IdentityView.prototype, "address3", void 0);
|
|
2716
|
+
identityView_decorate([
|
|
2717
|
+
linkedFieldOption(IdentityLinkedId.City, 'cityTown'),
|
|
2718
|
+
identityView_metadata("design:type", String)
|
|
2719
|
+
], identityView_IdentityView.prototype, "city", void 0);
|
|
2720
|
+
identityView_decorate([
|
|
2721
|
+
linkedFieldOption(IdentityLinkedId.State, 'stateProvince'),
|
|
2722
|
+
identityView_metadata("design:type", String)
|
|
2723
|
+
], identityView_IdentityView.prototype, "state", void 0);
|
|
2724
|
+
identityView_decorate([
|
|
2725
|
+
linkedFieldOption(IdentityLinkedId.PostalCode, 'zipPostalCode'),
|
|
2726
|
+
identityView_metadata("design:type", String)
|
|
2727
|
+
], identityView_IdentityView.prototype, "postalCode", void 0);
|
|
2728
|
+
identityView_decorate([
|
|
2729
|
+
linkedFieldOption(IdentityLinkedId.Country),
|
|
2730
|
+
identityView_metadata("design:type", String)
|
|
2731
|
+
], identityView_IdentityView.prototype, "country", void 0);
|
|
2732
|
+
identityView_decorate([
|
|
2733
|
+
linkedFieldOption(IdentityLinkedId.Company),
|
|
2734
|
+
identityView_metadata("design:type", String)
|
|
2735
|
+
], identityView_IdentityView.prototype, "company", void 0);
|
|
2736
|
+
identityView_decorate([
|
|
2737
|
+
linkedFieldOption(IdentityLinkedId.Email),
|
|
2738
|
+
identityView_metadata("design:type", String)
|
|
2739
|
+
], identityView_IdentityView.prototype, "email", void 0);
|
|
2740
|
+
identityView_decorate([
|
|
2741
|
+
linkedFieldOption(IdentityLinkedId.Phone),
|
|
2742
|
+
identityView_metadata("design:type", String)
|
|
2743
|
+
], identityView_IdentityView.prototype, "phone", void 0);
|
|
2744
|
+
identityView_decorate([
|
|
2745
|
+
linkedFieldOption(IdentityLinkedId.Ssn),
|
|
2746
|
+
identityView_metadata("design:type", String)
|
|
2747
|
+
], identityView_IdentityView.prototype, "ssn", void 0);
|
|
2748
|
+
identityView_decorate([
|
|
2749
|
+
linkedFieldOption(IdentityLinkedId.Username),
|
|
2750
|
+
identityView_metadata("design:type", String)
|
|
2751
|
+
], identityView_IdentityView.prototype, "username", void 0);
|
|
2752
|
+
identityView_decorate([
|
|
2753
|
+
linkedFieldOption(IdentityLinkedId.PassportNumber),
|
|
2754
|
+
identityView_metadata("design:type", String)
|
|
2755
|
+
], identityView_IdentityView.prototype, "passportNumber", void 0);
|
|
2756
|
+
identityView_decorate([
|
|
2757
|
+
linkedFieldOption(IdentityLinkedId.LicenseNumber),
|
|
2758
|
+
identityView_metadata("design:type", String)
|
|
2759
|
+
], identityView_IdentityView.prototype, "licenseNumber", void 0);
|
|
2760
|
+
identityView_decorate([
|
|
2761
|
+
linkedFieldOption(IdentityLinkedId.FirstName),
|
|
2762
|
+
identityView_metadata("design:type", String),
|
|
2763
|
+
identityView_metadata("design:paramtypes", [String])
|
|
2764
|
+
], identityView_IdentityView.prototype, "firstName", null);
|
|
2765
|
+
identityView_decorate([
|
|
2766
|
+
linkedFieldOption(IdentityLinkedId.LastName),
|
|
2767
|
+
identityView_metadata("design:type", String),
|
|
2768
|
+
identityView_metadata("design:paramtypes", [String])
|
|
2769
|
+
], identityView_IdentityView.prototype, "lastName", null);
|
|
2770
|
+
identityView_decorate([
|
|
2771
|
+
linkedFieldOption(IdentityLinkedId.FullName),
|
|
2772
|
+
identityView_metadata("design:type", String),
|
|
2773
|
+
identityView_metadata("design:paramtypes", [])
|
|
2774
|
+
], identityView_IdentityView.prototype, "fullName", null);
|
|
2514
2775
|
|
|
2515
2776
|
// CONCATENATED MODULE: ./jslib/common/src/models/view/loginView.ts
|
|
2777
|
+
var loginView_decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
2778
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2779
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
2780
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
2781
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
2782
|
+
};
|
|
2783
|
+
var loginView_metadata = (undefined && undefined.__metadata) || function (k, v) {
|
|
2784
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
2785
|
+
};
|
|
2786
|
+
|
|
2516
2787
|
|
|
2517
|
-
|
|
2788
|
+
|
|
2789
|
+
|
|
2790
|
+
class loginView_LoginView extends ItemView {
|
|
2518
2791
|
constructor(l) {
|
|
2792
|
+
super();
|
|
2519
2793
|
this.username = null;
|
|
2520
2794
|
this.password = null;
|
|
2521
2795
|
this.passwordRevisionDate = null;
|
|
@@ -2556,10 +2830,20 @@ class loginView_LoginView {
|
|
|
2556
2830
|
return this.uris != null && this.uris.length > 0;
|
|
2557
2831
|
}
|
|
2558
2832
|
}
|
|
2833
|
+
loginView_decorate([
|
|
2834
|
+
linkedFieldOption(LoginLinkedId.Username),
|
|
2835
|
+
loginView_metadata("design:type", String)
|
|
2836
|
+
], loginView_LoginView.prototype, "username", void 0);
|
|
2837
|
+
loginView_decorate([
|
|
2838
|
+
linkedFieldOption(LoginLinkedId.Password),
|
|
2839
|
+
loginView_metadata("design:type", String)
|
|
2840
|
+
], loginView_LoginView.prototype, "password", void 0);
|
|
2559
2841
|
|
|
2560
2842
|
// CONCATENATED MODULE: ./jslib/common/src/models/view/secureNoteView.ts
|
|
2561
|
-
|
|
2843
|
+
|
|
2844
|
+
class secureNoteView_SecureNoteView extends ItemView {
|
|
2562
2845
|
constructor(n) {
|
|
2846
|
+
super();
|
|
2563
2847
|
this.type = null;
|
|
2564
2848
|
if (!n) {
|
|
2565
2849
|
return;
|
|
@@ -2593,8 +2877,8 @@ class cipherView_CipherView {
|
|
|
2593
2877
|
this.viewPassword = true;
|
|
2594
2878
|
this.login = new loginView_LoginView();
|
|
2595
2879
|
this.identity = new identityView_IdentityView();
|
|
2596
|
-
this.card = new
|
|
2597
|
-
this.secureNote = new
|
|
2880
|
+
this.card = new cardView_CardView();
|
|
2881
|
+
this.secureNote = new secureNoteView_SecureNoteView();
|
|
2598
2882
|
this.attachments = null;
|
|
2599
2883
|
this.fields = null;
|
|
2600
2884
|
this.passwordHistory = null;
|
|
@@ -2620,21 +2904,24 @@ class cipherView_CipherView {
|
|
|
2620
2904
|
// Old locally stored ciphers might have reprompt == null. If so set it to None.
|
|
2621
2905
|
this.reprompt = (_a = c.reprompt) !== null && _a !== void 0 ? _a : CipherRepromptType.None;
|
|
2622
2906
|
}
|
|
2623
|
-
get
|
|
2907
|
+
get item() {
|
|
2624
2908
|
switch (this.type) {
|
|
2625
2909
|
case CipherType.Login:
|
|
2626
|
-
return this.login
|
|
2910
|
+
return this.login;
|
|
2627
2911
|
case CipherType.SecureNote:
|
|
2628
|
-
return this.secureNote
|
|
2912
|
+
return this.secureNote;
|
|
2629
2913
|
case CipherType.Card:
|
|
2630
|
-
return this.card
|
|
2914
|
+
return this.card;
|
|
2631
2915
|
case CipherType.Identity:
|
|
2632
|
-
return this.identity
|
|
2916
|
+
return this.identity;
|
|
2633
2917
|
default:
|
|
2634
2918
|
break;
|
|
2635
2919
|
}
|
|
2636
2920
|
return null;
|
|
2637
2921
|
}
|
|
2922
|
+
get subTitle() {
|
|
2923
|
+
return this.item.subTitle;
|
|
2924
|
+
}
|
|
2638
2925
|
get hasPasswordHistory() {
|
|
2639
2926
|
return this.passwordHistory && this.passwordHistory.length > 0;
|
|
2640
2927
|
}
|
|
@@ -2666,6 +2953,22 @@ class cipherView_CipherView {
|
|
|
2666
2953
|
get isDeleted() {
|
|
2667
2954
|
return this.deletedDate != null;
|
|
2668
2955
|
}
|
|
2956
|
+
get linkedFieldOptions() {
|
|
2957
|
+
return this.item.linkedFieldOptions;
|
|
2958
|
+
}
|
|
2959
|
+
linkedFieldValue(id) {
|
|
2960
|
+
var _a;
|
|
2961
|
+
const linkedFieldOption = (_a = this.linkedFieldOptions) === null || _a === void 0 ? void 0 : _a.get(id);
|
|
2962
|
+
if (linkedFieldOption == null) {
|
|
2963
|
+
return null;
|
|
2964
|
+
}
|
|
2965
|
+
const item = this.item;
|
|
2966
|
+
return this.item[linkedFieldOption.propertyKey];
|
|
2967
|
+
}
|
|
2968
|
+
linkedFieldI18nKey(id) {
|
|
2969
|
+
var _a;
|
|
2970
|
+
return (_a = this.linkedFieldOptions.get(id)) === null || _a === void 0 ? void 0 : _a.i18nKey;
|
|
2971
|
+
}
|
|
2669
2972
|
}
|
|
2670
2973
|
|
|
2671
2974
|
// CONCATENATED MODULE: ./jslib/common/src/models/view/fieldView.ts
|
|
@@ -2676,10 +2979,12 @@ class FieldView {
|
|
|
2676
2979
|
this.type = null;
|
|
2677
2980
|
this.newField = false; // Marks if the field is new and hasn't been saved
|
|
2678
2981
|
this.showValue = false;
|
|
2982
|
+
this.linkedId = null;
|
|
2679
2983
|
if (!f) {
|
|
2680
2984
|
return;
|
|
2681
2985
|
}
|
|
2682
2986
|
this.type = f.type;
|
|
2987
|
+
this.linkedId = f.linkedId;
|
|
2683
2988
|
}
|
|
2684
2989
|
get maskedValue() {
|
|
2685
2990
|
return this.value != null ? '••••••••' : null;
|
|
@@ -2697,6 +3002,7 @@ class field_Field extends domainBase_Domain {
|
|
|
2697
3002
|
return;
|
|
2698
3003
|
}
|
|
2699
3004
|
this.type = obj.type;
|
|
3005
|
+
this.linkedId = obj.linkedId;
|
|
2700
3006
|
this.buildDomainModel(this, obj, {
|
|
2701
3007
|
name: null,
|
|
2702
3008
|
value: null,
|
|
@@ -2714,7 +3020,8 @@ class field_Field extends domainBase_Domain {
|
|
|
2714
3020
|
name: null,
|
|
2715
3021
|
value: null,
|
|
2716
3022
|
type: null,
|
|
2717
|
-
|
|
3023
|
+
linkedId: null,
|
|
3024
|
+
}, ['type', 'linkedId']);
|
|
2718
3025
|
return f;
|
|
2719
3026
|
}
|
|
2720
3027
|
}
|
|
@@ -3057,7 +3364,7 @@ class secureNote_SecureNote extends domainBase_Domain {
|
|
|
3057
3364
|
this.type = obj.type;
|
|
3058
3365
|
}
|
|
3059
3366
|
decrypt(orgId, encKey) {
|
|
3060
|
-
return Promise.resolve(new
|
|
3367
|
+
return Promise.resolve(new secureNoteView_SecureNoteView(this));
|
|
3061
3368
|
}
|
|
3062
3369
|
toSecureNoteData() {
|
|
3063
3370
|
const n = new SecureNoteData();
|
|
@@ -3348,6 +3655,7 @@ class fieldApi_FieldApi extends BaseResponse {
|
|
|
3348
3655
|
this.type = this.getResponseProperty('Type');
|
|
3349
3656
|
this.name = this.getResponseProperty('Name');
|
|
3350
3657
|
this.value = this.getResponseProperty('Value');
|
|
3658
|
+
this.linkedId = this.getResponseProperty('linkedId');
|
|
3351
3659
|
}
|
|
3352
3660
|
}
|
|
3353
3661
|
|
|
@@ -3526,6 +3834,7 @@ class cipherRequest_CipherRequest {
|
|
|
3526
3834
|
field.type = f.type;
|
|
3527
3835
|
field.name = f.name ? f.name.encryptedString : null;
|
|
3528
3836
|
field.value = f.value ? f.value.encryptedString : null;
|
|
3837
|
+
field.linkedId = f.linkedId;
|
|
3529
3838
|
return field;
|
|
3530
3839
|
});
|
|
3531
3840
|
}
|
|
@@ -3916,7 +4225,7 @@ const DomainMatchBlacklist = new Map([
|
|
|
3916
4225
|
['google.com', new Set(['script.google.com'])],
|
|
3917
4226
|
]);
|
|
3918
4227
|
class cipher_service_CipherService {
|
|
3919
|
-
constructor(cryptoService, userService, settingsService, apiService, fileUploadService, storageService, i18nService, searchService) {
|
|
4228
|
+
constructor(cryptoService, userService, settingsService, apiService, fileUploadService, storageService, i18nService, searchService, logService) {
|
|
3920
4229
|
this.cryptoService = cryptoService;
|
|
3921
4230
|
this.userService = userService;
|
|
3922
4231
|
this.settingsService = settingsService;
|
|
@@ -3925,6 +4234,7 @@ class cipher_service_CipherService {
|
|
|
3925
4234
|
this.storageService = storageService;
|
|
3926
4235
|
this.i18nService = i18nService;
|
|
3927
4236
|
this.searchService = searchService;
|
|
4237
|
+
this.logService = logService;
|
|
3928
4238
|
this.sortedCiphersCache = new SortedCiphersCache(this.sortCiphersByLastUsed);
|
|
3929
4239
|
}
|
|
3930
4240
|
get decryptedCipherCache() {
|
|
@@ -4073,6 +4383,7 @@ class cipher_service_CipherService {
|
|
|
4073
4383
|
return cipher_service_awaiter(this, void 0, void 0, function* () {
|
|
4074
4384
|
const field = new field_Field();
|
|
4075
4385
|
field.type = fieldModel.type;
|
|
4386
|
+
field.linkedId = fieldModel.linkedId;
|
|
4076
4387
|
// normalize boolean type field values
|
|
4077
4388
|
if (fieldModel.type === FieldType.Boolean && fieldModel.value !== 'true') {
|
|
4078
4389
|
fieldModel.value = 'false';
|
|
@@ -4258,7 +4569,9 @@ class cipher_service_CipherService {
|
|
|
4258
4569
|
return true;
|
|
4259
4570
|
}
|
|
4260
4571
|
}
|
|
4261
|
-
catch (
|
|
4572
|
+
catch (e) {
|
|
4573
|
+
this.logService.error(e);
|
|
4574
|
+
}
|
|
4262
4575
|
break;
|
|
4263
4576
|
case UriMatchType.Never:
|
|
4264
4577
|
default:
|
|
@@ -13594,7 +13907,9 @@ class crypto_service_CryptoService {
|
|
|
13594
13907
|
encType = parseInt(headerPieces[0], null);
|
|
13595
13908
|
encPieces = headerPieces[1].split('|');
|
|
13596
13909
|
}
|
|
13597
|
-
catch (e) {
|
|
13910
|
+
catch (e) {
|
|
13911
|
+
this.logService.error(e);
|
|
13912
|
+
}
|
|
13598
13913
|
}
|
|
13599
13914
|
switch (encType) {
|
|
13600
13915
|
case EncryptionType.Rsa2048_OaepSha256_B64:
|
|
@@ -13997,6 +14312,9 @@ class environment_service_EnvironmentService {
|
|
|
13997
14312
|
}
|
|
13998
14313
|
return 'https://events.bitwarden.com';
|
|
13999
14314
|
}
|
|
14315
|
+
getKeyConnectorUrl() {
|
|
14316
|
+
return this.keyConnectorUrl;
|
|
14317
|
+
}
|
|
14000
14318
|
setUrlsFromStorage() {
|
|
14001
14319
|
return environment_service_awaiter(this, void 0, void 0, function* () {
|
|
14002
14320
|
const urlsObj = yield this.storageService.get(ConstantsService.environmentUrlsKey);
|
|
@@ -14008,6 +14326,7 @@ class environment_service_EnvironmentService {
|
|
|
14008
14326
|
notifications: null,
|
|
14009
14327
|
events: null,
|
|
14010
14328
|
webVault: null,
|
|
14329
|
+
keyConnector: null,
|
|
14011
14330
|
};
|
|
14012
14331
|
const envUrls = new EnvironmentUrls();
|
|
14013
14332
|
if (urls.base) {
|
|
@@ -14020,6 +14339,7 @@ class environment_service_EnvironmentService {
|
|
|
14020
14339
|
this.iconsUrl = urls.icons;
|
|
14021
14340
|
this.notificationsUrl = urls.notifications;
|
|
14022
14341
|
this.eventsUrl = envUrls.events = urls.events;
|
|
14342
|
+
this.keyConnectorUrl = urls.keyConnector;
|
|
14023
14343
|
});
|
|
14024
14344
|
}
|
|
14025
14345
|
setUrls(urls, saveSettings = true) {
|
|
@@ -14031,6 +14351,7 @@ class environment_service_EnvironmentService {
|
|
|
14031
14351
|
urls.icons = this.formatUrl(urls.icons);
|
|
14032
14352
|
urls.notifications = this.formatUrl(urls.notifications);
|
|
14033
14353
|
urls.events = this.formatUrl(urls.events);
|
|
14354
|
+
urls.keyConnector = this.formatUrl(urls.keyConnector);
|
|
14034
14355
|
if (saveSettings) {
|
|
14035
14356
|
yield this.storageService.save(ConstantsService.environmentUrlsKey, {
|
|
14036
14357
|
base: urls.base,
|
|
@@ -14040,6 +14361,7 @@ class environment_service_EnvironmentService {
|
|
|
14040
14361
|
icons: urls.icons,
|
|
14041
14362
|
notifications: urls.notifications,
|
|
14042
14363
|
events: urls.events,
|
|
14364
|
+
keyConnector: urls.keyConnector,
|
|
14043
14365
|
});
|
|
14044
14366
|
}
|
|
14045
14367
|
this.baseUrl = urls.base;
|
|
@@ -14049,6 +14371,7 @@ class environment_service_EnvironmentService {
|
|
|
14049
14371
|
this.iconsUrl = urls.icons;
|
|
14050
14372
|
this.notificationsUrl = urls.notifications;
|
|
14051
14373
|
this.eventsUrl = urls.events;
|
|
14374
|
+
this.keyConnectorUrl = urls.keyConnector;
|
|
14052
14375
|
this.urlsSubject.next(urls);
|
|
14053
14376
|
return urls;
|
|
14054
14377
|
});
|
|
@@ -14062,6 +14385,7 @@ class environment_service_EnvironmentService {
|
|
|
14062
14385
|
icons: this.iconsUrl,
|
|
14063
14386
|
notifications: this.notificationsUrl,
|
|
14064
14387
|
events: this.eventsUrl,
|
|
14388
|
+
keyConnector: this.keyConnectorUrl,
|
|
14065
14389
|
};
|
|
14066
14390
|
}
|
|
14067
14391
|
formatUrl(url) {
|
|
@@ -14089,7 +14413,7 @@ class export_card_Card {
|
|
|
14089
14413
|
if (o == null) {
|
|
14090
14414
|
return;
|
|
14091
14415
|
}
|
|
14092
|
-
if (o instanceof
|
|
14416
|
+
if (o instanceof cardView_CardView) {
|
|
14093
14417
|
this.cardholderName = o.cardholderName;
|
|
14094
14418
|
this.brand = o.brand;
|
|
14095
14419
|
this.number = o.number;
|
|
@@ -14116,7 +14440,7 @@ class export_card_Card {
|
|
|
14116
14440
|
req.code = '123';
|
|
14117
14441
|
return req;
|
|
14118
14442
|
}
|
|
14119
|
-
static toView(req, view = new
|
|
14443
|
+
static toView(req, view = new cardView_CardView()) {
|
|
14120
14444
|
view.cardholderName = req.cardholderName;
|
|
14121
14445
|
view.brand = req.brand;
|
|
14122
14446
|
view.number = req.number;
|
|
@@ -14156,6 +14480,7 @@ class export_field_Field {
|
|
|
14156
14480
|
this.value = (_b = o.value) === null || _b === void 0 ? void 0 : _b.encryptedString;
|
|
14157
14481
|
}
|
|
14158
14482
|
this.type = o.type;
|
|
14483
|
+
this.linkedId = o.linkedId;
|
|
14159
14484
|
}
|
|
14160
14485
|
static template() {
|
|
14161
14486
|
const req = new export_field_Field();
|
|
@@ -14168,12 +14493,14 @@ class export_field_Field {
|
|
|
14168
14493
|
view.type = req.type;
|
|
14169
14494
|
view.value = req.value;
|
|
14170
14495
|
view.name = req.name;
|
|
14496
|
+
view.linkedId = req.linkedId;
|
|
14171
14497
|
return view;
|
|
14172
14498
|
}
|
|
14173
14499
|
static toDomain(req, domain = new field_Field()) {
|
|
14174
14500
|
domain.type = req.type;
|
|
14175
14501
|
domain.value = req.value != null ? new encString_EncString(req.value) : null;
|
|
14176
14502
|
domain.name = req.name != null ? new encString_EncString(req.name) : null;
|
|
14503
|
+
domain.linkedId = req.linkedId;
|
|
14177
14504
|
return domain;
|
|
14178
14505
|
}
|
|
14179
14506
|
}
|
|
@@ -14412,7 +14739,7 @@ class export_secureNote_SecureNote {
|
|
|
14412
14739
|
req.type = SecureNoteType.Generic;
|
|
14413
14740
|
return req;
|
|
14414
14741
|
}
|
|
14415
|
-
static toView(req, view = new
|
|
14742
|
+
static toView(req, view = new secureNoteView_SecureNoteView()) {
|
|
14416
14743
|
view.type = req.type;
|
|
14417
14744
|
return view;
|
|
14418
14745
|
}
|
|
@@ -14631,6 +14958,7 @@ var EventType;
|
|
|
14631
14958
|
EventType[EventType["User_FailedLogIn2fa"] = 1006] = "User_FailedLogIn2fa";
|
|
14632
14959
|
EventType[EventType["User_ClientExportedVault"] = 1007] = "User_ClientExportedVault";
|
|
14633
14960
|
EventType[EventType["User_UpdatedTempPassword"] = 1008] = "User_UpdatedTempPassword";
|
|
14961
|
+
EventType[EventType["User_MigratedKeyToKeyConnector"] = 1009] = "User_MigratedKeyToKeyConnector";
|
|
14634
14962
|
EventType[EventType["Cipher_Created"] = 1100] = "Cipher_Created";
|
|
14635
14963
|
EventType[EventType["Cipher_Updated"] = 1101] = "Cipher_Updated";
|
|
14636
14964
|
EventType[EventType["Cipher_Deleted"] = 1102] = "Cipher_Deleted";
|
|
@@ -14665,10 +14993,15 @@ var EventType;
|
|
|
14665
14993
|
EventType[EventType["OrganizationUser_ResetPassword_Withdraw"] = 1507] = "OrganizationUser_ResetPassword_Withdraw";
|
|
14666
14994
|
EventType[EventType["OrganizationUser_AdminResetPassword"] = 1508] = "OrganizationUser_AdminResetPassword";
|
|
14667
14995
|
EventType[EventType["OrganizationUser_ResetSsoLink"] = 1509] = "OrganizationUser_ResetSsoLink";
|
|
14996
|
+
EventType[EventType["OrganizationUser_FirstSsoLogin"] = 1510] = "OrganizationUser_FirstSsoLogin";
|
|
14668
14997
|
EventType[EventType["Organization_Updated"] = 1600] = "Organization_Updated";
|
|
14669
14998
|
EventType[EventType["Organization_PurgedVault"] = 1601] = "Organization_PurgedVault";
|
|
14670
14999
|
// Organization_ClientExportedVault = 1602,
|
|
14671
15000
|
EventType[EventType["Organization_VaultAccessed"] = 1603] = "Organization_VaultAccessed";
|
|
15001
|
+
EventType[EventType["Organization_EnabledSso"] = 1604] = "Organization_EnabledSso";
|
|
15002
|
+
EventType[EventType["Organization_DisabledSso"] = 1605] = "Organization_DisabledSso";
|
|
15003
|
+
EventType[EventType["Organization_EnabledKeyConnector"] = 1606] = "Organization_EnabledKeyConnector";
|
|
15004
|
+
EventType[EventType["Organization_DisabledKeyConnector"] = 1607] = "Organization_DisabledKeyConnector";
|
|
14672
15005
|
EventType[EventType["Policy_Updated"] = 1700] = "Policy_Updated";
|
|
14673
15006
|
EventType[EventType["ProviderUser_Invited"] = 1800] = "ProviderUser_Invited";
|
|
14674
15007
|
EventType[EventType["ProviderUser_Confirmed"] = 1801] = "ProviderUser_Confirmed";
|
|
@@ -15275,7 +15608,9 @@ class Version {
|
|
|
15275
15608
|
this.month = parts[1];
|
|
15276
15609
|
this.day = parts[2];
|
|
15277
15610
|
}
|
|
15278
|
-
catch (_a) {
|
|
15611
|
+
catch (_a) {
|
|
15612
|
+
// Ignore error
|
|
15613
|
+
}
|
|
15279
15614
|
}
|
|
15280
15615
|
/**
|
|
15281
15616
|
* Compares two Azure Versions against each other
|
|
@@ -15998,7 +16333,7 @@ class baseImporter_BaseImporter {
|
|
|
15998
16333
|
this.isNullOrWhitespace(cipher.login.password) &&
|
|
15999
16334
|
(cipher.login.uris == null || cipher.login.uris.length === 0)) {
|
|
16000
16335
|
cipher.type = CipherType.SecureNote;
|
|
16001
|
-
cipher.secureNote = new
|
|
16336
|
+
cipher.secureNote = new secureNoteView_SecureNoteView();
|
|
16002
16337
|
cipher.secureNote.type = SecureNoteType.Generic;
|
|
16003
16338
|
}
|
|
16004
16339
|
}
|
|
@@ -16270,7 +16605,7 @@ class bitwardenCsvImporter_BitwardenCsvImporter extends baseImporter_BaseImporte
|
|
|
16270
16605
|
switch (valueType) {
|
|
16271
16606
|
case 'note':
|
|
16272
16607
|
cipher.type = CipherType.SecureNote;
|
|
16273
|
-
cipher.secureNote = new
|
|
16608
|
+
cipher.secureNote = new secureNoteView_SecureNoteView();
|
|
16274
16609
|
cipher.secureNote.type = SecureNoteType.Generic;
|
|
16275
16610
|
break;
|
|
16276
16611
|
default:
|
|
@@ -16801,7 +17136,7 @@ class dashlaneJsonImporter_DashlaneJsonImporter extends baseImporter_BaseImporte
|
|
|
16801
17136
|
processCard(results) {
|
|
16802
17137
|
results.forEach((obj) => {
|
|
16803
17138
|
const cipher = new cipherView_CipherView();
|
|
16804
|
-
cipher.card = new
|
|
17139
|
+
cipher.card = new cardView_CardView();
|
|
16805
17140
|
cipher.type = CipherType.Card;
|
|
16806
17141
|
cipher.name = this.getValueOrDefault(obj.bank);
|
|
16807
17142
|
cipher.card.number = this.getValueOrDefault(obj.cardNumber);
|
|
@@ -16822,7 +17157,7 @@ class dashlaneJsonImporter_DashlaneJsonImporter extends baseImporter_BaseImporte
|
|
|
16822
17157
|
processNote(results, nameProperty, name = null) {
|
|
16823
17158
|
results.forEach((obj) => {
|
|
16824
17159
|
const cipher = new cipherView_CipherView();
|
|
16825
|
-
cipher.secureNote = new
|
|
17160
|
+
cipher.secureNote = new secureNoteView_SecureNoteView();
|
|
16826
17161
|
cipher.type = CipherType.SecureNote;
|
|
16827
17162
|
cipher.secureNote.type = SecureNoteType.Generic;
|
|
16828
17163
|
if (name != null) {
|
|
@@ -16876,7 +17211,7 @@ class encryptrCsvImporter_EncryptrCsvImporter extends baseImporter_BaseImporter
|
|
|
16876
17211
|
}
|
|
16877
17212
|
else if (type === 'Credit Card') {
|
|
16878
17213
|
cipher.type = CipherType.Card;
|
|
16879
|
-
cipher.card = new
|
|
17214
|
+
cipher.card = new cardView_CardView();
|
|
16880
17215
|
cipher.card.cardholderName = this.getValueOrDefault(value['Name on card']);
|
|
16881
17216
|
cipher.card.number = this.getValueOrDefault(value['Card Number']);
|
|
16882
17217
|
cipher.card.brand = this.getCardBrand(cipher.card.number);
|
|
@@ -16927,13 +17262,13 @@ class enpassCsvImporter_EnpassCsvImporter extends baseImporter_BaseImporter {
|
|
|
16927
17262
|
!this.containsField(value, 'password') && !this.containsField(value, 'email') &&
|
|
16928
17263
|
!this.containsField(value, 'url'))) {
|
|
16929
17264
|
cipher.type = CipherType.SecureNote;
|
|
16930
|
-
cipher.secureNote = new
|
|
17265
|
+
cipher.secureNote = new secureNoteView_SecureNoteView();
|
|
16931
17266
|
cipher.secureNote.type = SecureNoteType.Generic;
|
|
16932
17267
|
}
|
|
16933
17268
|
if (this.containsField(value, 'cardholder') && this.containsField(value, 'number') &&
|
|
16934
17269
|
this.containsField(value, 'expiry date')) {
|
|
16935
17270
|
cipher.type = CipherType.Card;
|
|
16936
|
-
cipher.card = new
|
|
17271
|
+
cipher.card = new cardView_CardView();
|
|
16937
17272
|
}
|
|
16938
17273
|
if (value.length > 2 && (value.length % 2) === 0) {
|
|
16939
17274
|
for (let i = 0; i < value.length - 2; i += 2) {
|
|
@@ -17086,7 +17421,7 @@ class enpassJsonImporter_EnpassJsonImporter extends baseImporter_BaseImporter {
|
|
|
17086
17421
|
cipher.login.uris = this.makeUriArray(urls);
|
|
17087
17422
|
}
|
|
17088
17423
|
processCard(cipher, fields) {
|
|
17089
|
-
cipher.card = new
|
|
17424
|
+
cipher.card = new cardView_CardView();
|
|
17090
17425
|
cipher.type = CipherType.Card;
|
|
17091
17426
|
fields.forEach((field) => {
|
|
17092
17427
|
if (this.isNullOrWhitespace(field.value) || field.type === 'section' || field.type === 'ccType') {
|
|
@@ -17215,7 +17550,7 @@ class fsecureFskImporter_FSecureFskImporter extends baseImporter_BaseImporter {
|
|
|
17215
17550
|
}
|
|
17216
17551
|
else if (value.style === 'creditcard') {
|
|
17217
17552
|
cipher.type = CipherType.Card;
|
|
17218
|
-
cipher.card = new
|
|
17553
|
+
cipher.card = new cardView_CardView();
|
|
17219
17554
|
cipher.card.cardholderName = this.getValueOrDefault(value.username);
|
|
17220
17555
|
cipher.card.number = this.getValueOrDefault(value.creditNumber);
|
|
17221
17556
|
cipher.card.brand = this.getCardBrand(cipher.card.number);
|
|
@@ -17681,7 +18016,7 @@ class lastpassCsvImporter_LastPassCsvImporter extends baseImporter_BaseImporter
|
|
|
17681
18016
|
return cipher;
|
|
17682
18017
|
}
|
|
17683
18018
|
parseCard(value) {
|
|
17684
|
-
const card = new
|
|
18019
|
+
const card = new cardView_CardView();
|
|
17685
18020
|
card.cardholderName = this.getValueOrDefault(value.ccname);
|
|
17686
18021
|
card.number = this.getValueOrDefault(value.ccnum);
|
|
17687
18022
|
card.code = this.getValueOrDefault(value.cccsc);
|
|
@@ -17787,7 +18122,7 @@ class lastpassCsvImporter_LastPassCsvImporter extends baseImporter_BaseImporter
|
|
|
17787
18122
|
}
|
|
17788
18123
|
}
|
|
17789
18124
|
if (!processedNote) {
|
|
17790
|
-
cipher.secureNote = new
|
|
18125
|
+
cipher.secureNote = new secureNoteView_SecureNoteView();
|
|
17791
18126
|
cipher.secureNote.type = SecureNoteType.Generic;
|
|
17792
18127
|
cipher.notes = this.getValueOrDefault(value.extra);
|
|
17793
18128
|
}
|
|
@@ -17923,7 +18258,7 @@ class msecureCsvImporter_MSecureCsvImporter extends baseImporter_BaseImporter {
|
|
|
17923
18258
|
}
|
|
17924
18259
|
else if (value.length > 3) {
|
|
17925
18260
|
cipher.type = CipherType.SecureNote;
|
|
17926
|
-
cipher.secureNote = new
|
|
18261
|
+
cipher.secureNote = new secureNoteView_SecureNoteView();
|
|
17927
18262
|
cipher.secureNote.type = SecureNoteType.Generic;
|
|
17928
18263
|
for (let i = 3; i < value.length; i++) {
|
|
17929
18264
|
if (!this.isNullOrWhitespace(value[i])) {
|
|
@@ -17974,7 +18309,7 @@ class mykiCsvImporter_MykiCsvImporter extends baseImporter_BaseImporter {
|
|
|
17974
18309
|
}
|
|
17975
18310
|
else if (value.cardNumber !== undefined) {
|
|
17976
18311
|
// Cards
|
|
17977
|
-
cipher.card = new
|
|
18312
|
+
cipher.card = new cardView_CardView();
|
|
17978
18313
|
cipher.type = CipherType.Card;
|
|
17979
18314
|
cipher.card.cardholderName = this.getValueOrDefault(value.cardName);
|
|
17980
18315
|
cipher.card.number = this.getValueOrDefault(value.cardNumber);
|
|
@@ -18001,7 +18336,7 @@ class mykiCsvImporter_MykiCsvImporter extends baseImporter_BaseImporter {
|
|
|
18001
18336
|
}
|
|
18002
18337
|
else if (value.content !== undefined) {
|
|
18003
18338
|
// Notes
|
|
18004
|
-
cipher.secureNote = new
|
|
18339
|
+
cipher.secureNote = new secureNoteView_SecureNoteView();
|
|
18005
18340
|
cipher.type = CipherType.SecureNote;
|
|
18006
18341
|
cipher.secureNote.type = SecureNoteType.Generic;
|
|
18007
18342
|
cipher.name = this.getValueOrDefault(value.title, '--');
|
|
@@ -18181,7 +18516,7 @@ class onepassword1PifImporter_OnePassword1PifImporter extends baseImporter_BaseI
|
|
|
18181
18516
|
}
|
|
18182
18517
|
if (!this.isNullOrWhitespace(item.details.ccnum) || !this.isNullOrWhitespace(item.details.cvv)) {
|
|
18183
18518
|
cipher.type = CipherType.Card;
|
|
18184
|
-
cipher.card = new
|
|
18519
|
+
cipher.card = new cardView_CardView();
|
|
18185
18520
|
}
|
|
18186
18521
|
else if (!this.isNullOrWhitespace(item.details.firstname) ||
|
|
18187
18522
|
!this.isNullOrWhitespace(item.details.address1)) {
|
|
@@ -18211,12 +18546,12 @@ class onepassword1PifImporter_OnePassword1PifImporter extends baseImporter_BaseI
|
|
|
18211
18546
|
cipher.name = this.getValueOrDefault(item.title);
|
|
18212
18547
|
if (item.typeName === 'securenotes.SecureNote') {
|
|
18213
18548
|
cipher.type = CipherType.SecureNote;
|
|
18214
|
-
cipher.secureNote = new
|
|
18549
|
+
cipher.secureNote = new secureNoteView_SecureNoteView();
|
|
18215
18550
|
cipher.secureNote.type = SecureNoteType.Generic;
|
|
18216
18551
|
}
|
|
18217
18552
|
else if (item.typeName === 'wallet.financial.CreditCard') {
|
|
18218
18553
|
cipher.type = CipherType.Card;
|
|
18219
|
-
cipher.card = new
|
|
18554
|
+
cipher.card = new cardView_CardView();
|
|
18220
18555
|
}
|
|
18221
18556
|
else if (item.typeName === 'identities.Identity') {
|
|
18222
18557
|
cipher.type = CipherType.Identity;
|
|
@@ -18655,7 +18990,7 @@ class onepasswordMacCsvImporter_OnePasswordMacCsvImporter extends onepasswordCsv
|
|
|
18655
18990
|
switch (onePassType) {
|
|
18656
18991
|
case 'Credit Card':
|
|
18657
18992
|
cipher.type = CipherType.Card;
|
|
18658
|
-
cipher.card = new
|
|
18993
|
+
cipher.card = new cardView_CardView();
|
|
18659
18994
|
IgnoredProperties.push('type');
|
|
18660
18995
|
break;
|
|
18661
18996
|
case 'Identity':
|
|
@@ -18689,7 +19024,7 @@ class onepasswordWinCsvImporter_OnePasswordWinCsvImporter extends onepasswordCsv
|
|
|
18689
19024
|
if (!this.isNullOrWhitespace(this.getPropByRegexp(value, /\d+: number/i)) &&
|
|
18690
19025
|
!this.isNullOrWhitespace(this.getPropByRegexp(value, /\d+: expiry date/i))) {
|
|
18691
19026
|
cipher.type = CipherType.Card;
|
|
18692
|
-
cipher.card = new
|
|
19027
|
+
cipher.card = new cardView_CardView();
|
|
18693
19028
|
}
|
|
18694
19029
|
if (!this.isNullOrWhitespace(this.getPropByRegexp(value, /name \d+: first name/i)) ||
|
|
18695
19030
|
!this.isNullOrWhitespace(this.getPropByRegexp(value, /name \d+: initial/i)) ||
|
|
@@ -18904,7 +19239,9 @@ class passpackCsvImporter_PasspackCsvImporter extends baseImporter_BaseImporter
|
|
|
18904
19239
|
const t = JSON.parse(tagJson);
|
|
18905
19240
|
return this.getValueOrDefault(t.tag);
|
|
18906
19241
|
}
|
|
18907
|
-
catch (_a) {
|
|
19242
|
+
catch (_a) {
|
|
19243
|
+
// Ignore error
|
|
19244
|
+
}
|
|
18908
19245
|
return null;
|
|
18909
19246
|
}).filter((t) => !this.isNullOrWhitespace(t)) : null;
|
|
18910
19247
|
if (this.organization && tags != null && tags.length > 0) {
|
|
@@ -18950,7 +19287,9 @@ class passpackCsvImporter_PasspackCsvImporter extends baseImporter_BaseImporter
|
|
|
18950
19287
|
try {
|
|
18951
19288
|
return JSON.parse(fieldJson);
|
|
18952
19289
|
}
|
|
18953
|
-
catch (_a) {
|
|
19290
|
+
catch (_a) {
|
|
19291
|
+
// Ignore error
|
|
19292
|
+
}
|
|
18954
19293
|
return null;
|
|
18955
19294
|
}) : null;
|
|
18956
19295
|
if (fields != null) {
|
|
@@ -19056,7 +19395,7 @@ class passwordBossJsonImporter_PasswordBossJsonImporter extends baseImporter_Bas
|
|
|
19056
19395
|
cipher.notes = value.identifiers.notes.split('\\r\\n').join('\n').split('\\n').join('\n');
|
|
19057
19396
|
}
|
|
19058
19397
|
if (value.type === 'CreditCard') {
|
|
19059
|
-
cipher.card = new
|
|
19398
|
+
cipher.card = new cardView_CardView();
|
|
19060
19399
|
cipher.type = CipherType.Card;
|
|
19061
19400
|
}
|
|
19062
19401
|
for (const property in value.identifiers) {
|
|
@@ -19094,7 +19433,9 @@ class passwordBossJsonImporter_PasswordBossJsonImporter extends baseImporter_Bas
|
|
|
19094
19433
|
cipher.card.expYear = expDate.getFullYear().toString();
|
|
19095
19434
|
cipher.card.expMonth = (expDate.getMonth() + 1).toString();
|
|
19096
19435
|
}
|
|
19097
|
-
catch (_a) {
|
|
19436
|
+
catch (_a) {
|
|
19437
|
+
// Ignore error
|
|
19438
|
+
}
|
|
19098
19439
|
continue;
|
|
19099
19440
|
}
|
|
19100
19441
|
else if (property === 'cardType') {
|
|
@@ -19306,7 +19647,7 @@ class rememBearCsvImporter_RememBearCsvImporter extends baseImporter_BaseImporte
|
|
|
19306
19647
|
}
|
|
19307
19648
|
else if (value.type === 'CreditCardItem') {
|
|
19308
19649
|
cipher.type = CipherType.Card;
|
|
19309
|
-
cipher.card = new
|
|
19650
|
+
cipher.card = new cardView_CardView();
|
|
19310
19651
|
cipher.card.cardholderName = this.getValueOrDefault(value.cardholder);
|
|
19311
19652
|
cipher.card.number = this.getValueOrDefault(value.number);
|
|
19312
19653
|
cipher.card.brand = this.getCardBrand(cipher.card.number);
|
|
@@ -19320,7 +19661,9 @@ class rememBearCsvImporter_RememBearCsvImporter extends baseImporter_BaseImporte
|
|
|
19320
19661
|
}
|
|
19321
19662
|
}
|
|
19322
19663
|
}
|
|
19323
|
-
catch (_a) {
|
|
19664
|
+
catch (_a) {
|
|
19665
|
+
// Ignore error
|
|
19666
|
+
}
|
|
19324
19667
|
try {
|
|
19325
19668
|
const expYear = this.getValueOrDefault(value.expiryYear);
|
|
19326
19669
|
if (expYear != null) {
|
|
@@ -19330,7 +19673,9 @@ class rememBearCsvImporter_RememBearCsvImporter extends baseImporter_BaseImporte
|
|
|
19330
19673
|
}
|
|
19331
19674
|
}
|
|
19332
19675
|
}
|
|
19333
|
-
catch (_b) {
|
|
19676
|
+
catch (_b) {
|
|
19677
|
+
// Ignore error
|
|
19678
|
+
}
|
|
19334
19679
|
const pin = this.getValueOrDefault(value.pin);
|
|
19335
19680
|
if (pin != null) {
|
|
19336
19681
|
this.processKvp(cipher, 'PIN', pin);
|
|
@@ -19402,6 +19747,32 @@ class roboformCsvImporter_RoboFormCsvImporter extends baseImporter_BaseImporter
|
|
|
19402
19747
|
}
|
|
19403
19748
|
}
|
|
19404
19749
|
|
|
19750
|
+
// CONCATENATED MODULE: ./jslib/common/src/importers/safariCsvImporter.ts
|
|
19751
|
+
|
|
19752
|
+
|
|
19753
|
+
class safariCsvImporter_SafariCsvImporter extends baseImporter_BaseImporter {
|
|
19754
|
+
parse(data) {
|
|
19755
|
+
const result = new ImportResult();
|
|
19756
|
+
const results = this.parseCsv(data, true);
|
|
19757
|
+
if (results == null) {
|
|
19758
|
+
result.success = false;
|
|
19759
|
+
return Promise.resolve(result);
|
|
19760
|
+
}
|
|
19761
|
+
results.forEach(value => {
|
|
19762
|
+
const cipher = this.initLoginCipher();
|
|
19763
|
+
cipher.name = this.getValueOrDefault(value.Title, '--');
|
|
19764
|
+
cipher.login.username = this.getValueOrDefault(value.Username);
|
|
19765
|
+
cipher.login.password = this.getValueOrDefault(value.Password);
|
|
19766
|
+
cipher.login.uris = this.makeUriArray(value.Url);
|
|
19767
|
+
cipher.login.totp = this.getValueOrDefault(value.OTPAuth);
|
|
19768
|
+
this.cleanupCipher(cipher);
|
|
19769
|
+
result.ciphers.push(cipher);
|
|
19770
|
+
});
|
|
19771
|
+
result.success = true;
|
|
19772
|
+
return Promise.resolve(result);
|
|
19773
|
+
}
|
|
19774
|
+
}
|
|
19775
|
+
|
|
19405
19776
|
// CONCATENATED MODULE: ./jslib/common/src/importers/safeInCloudXmlImporter.ts
|
|
19406
19777
|
|
|
19407
19778
|
|
|
@@ -19454,7 +19825,7 @@ class safeInCloudXmlImporter_SafeInCloudXmlImporter extends baseImporter_BaseImp
|
|
|
19454
19825
|
const cardType = cardEl.getAttribute('type');
|
|
19455
19826
|
if (cardType === 'note') {
|
|
19456
19827
|
cipher.type = CipherType.SecureNote;
|
|
19457
|
-
cipher.secureNote = new
|
|
19828
|
+
cipher.secureNote = new secureNoteView_SecureNoteView();
|
|
19458
19829
|
cipher.secureNote.type = SecureNoteType.Generic;
|
|
19459
19830
|
}
|
|
19460
19831
|
else {
|
|
@@ -19724,7 +20095,7 @@ class truekeyCsvImporter_TrueKeyCsvImporter extends baseImporter_BaseImporter {
|
|
|
19724
20095
|
}
|
|
19725
20096
|
if (value.kind === 'cc') {
|
|
19726
20097
|
cipher.type = CipherType.Card;
|
|
19727
|
-
cipher.card = new
|
|
20098
|
+
cipher.card = new cardView_CardView();
|
|
19728
20099
|
cipher.card.cardholderName = this.getValueOrDefault(value.cardholder);
|
|
19729
20100
|
cipher.card.number = this.getValueOrDefault(value.number);
|
|
19730
20101
|
cipher.card.brand = this.getCardBrand(cipher.card.number);
|
|
@@ -19734,12 +20105,14 @@ class truekeyCsvImporter_TrueKeyCsvImporter extends baseImporter_BaseImporter {
|
|
|
19734
20105
|
cipher.card.expYear = expDate.getFullYear().toString();
|
|
19735
20106
|
cipher.card.expMonth = (expDate.getMonth() + 1).toString();
|
|
19736
20107
|
}
|
|
19737
|
-
catch (_a) {
|
|
20108
|
+
catch (_a) {
|
|
20109
|
+
// Ignore error
|
|
20110
|
+
}
|
|
19738
20111
|
}
|
|
19739
20112
|
}
|
|
19740
20113
|
else if (value.kind !== 'login') {
|
|
19741
20114
|
cipher.type = CipherType.SecureNote;
|
|
19742
|
-
cipher.secureNote = new
|
|
20115
|
+
cipher.secureNote = new secureNoteView_SecureNoteView();
|
|
19743
20116
|
cipher.secureNote.type = SecureNoteType.Generic;
|
|
19744
20117
|
if (!this.isNullOrWhitespace(cipher.notes)) {
|
|
19745
20118
|
cipher.notes = this.getValueOrDefault(value.document_content, '');
|
|
@@ -19944,6 +20317,7 @@ var import_service_awaiter = (undefined && undefined.__awaiter) || function (thi
|
|
|
19944
20317
|
|
|
19945
20318
|
|
|
19946
20319
|
|
|
20320
|
+
|
|
19947
20321
|
|
|
19948
20322
|
|
|
19949
20323
|
class import_service_ImportService {
|
|
@@ -19958,12 +20332,13 @@ class import_service_ImportService {
|
|
|
19958
20332
|
this.featuredImportOptions = [
|
|
19959
20333
|
{ id: 'bitwardenjson', name: 'Bitwarden (json)' },
|
|
19960
20334
|
{ id: 'bitwardencsv', name: 'Bitwarden (csv)' },
|
|
19961
|
-
{ id: 'lastpasscsv', name: 'LastPass (csv)' },
|
|
19962
20335
|
{ id: 'chromecsv', name: 'Chrome (csv)' },
|
|
20336
|
+
{ id: 'dashlanejson', name: 'Dashlane (json)' },
|
|
19963
20337
|
{ id: 'firefoxcsv', name: 'Firefox (csv)' },
|
|
19964
20338
|
{ id: 'keepass2xml', name: 'KeePass 2 (xml)' },
|
|
20339
|
+
{ id: 'lastpasscsv', name: 'LastPass (csv)' },
|
|
20340
|
+
{ id: 'safaricsv', name: 'Safari and macOS (csv)' },
|
|
19965
20341
|
{ id: '1password1pif', name: '1Password (1pif)' },
|
|
19966
|
-
{ id: 'dashlanejson', name: 'Dashlane (json)' },
|
|
19967
20342
|
];
|
|
19968
20343
|
this.regularImportOptions = [
|
|
19969
20344
|
{ id: 'keepassxcsv', name: 'KeePassX (csv)' },
|
|
@@ -20095,6 +20470,8 @@ class import_service_ImportService {
|
|
|
20095
20470
|
return new upmCsvImporter_UpmCsvImporter();
|
|
20096
20471
|
case 'saferpasscsv':
|
|
20097
20472
|
return new saferpassCsvImport_SaferPassCsvImporter();
|
|
20473
|
+
case 'safaricsv':
|
|
20474
|
+
return new safariCsvImporter_SafariCsvImporter();
|
|
20098
20475
|
case 'meldiumcsv':
|
|
20099
20476
|
return new meldiumCsvImporter_MeldiumCsvImporter();
|
|
20100
20477
|
case '1password1pif':
|
|
@@ -20258,6 +20635,121 @@ class import_service_ImportService {
|
|
|
20258
20635
|
}
|
|
20259
20636
|
}
|
|
20260
20637
|
|
|
20638
|
+
// CONCATENATED MODULE: ./jslib/common/src/enums/organizationUserType.ts
|
|
20639
|
+
var OrganizationUserType;
|
|
20640
|
+
(function (OrganizationUserType) {
|
|
20641
|
+
OrganizationUserType[OrganizationUserType["Owner"] = 0] = "Owner";
|
|
20642
|
+
OrganizationUserType[OrganizationUserType["Admin"] = 1] = "Admin";
|
|
20643
|
+
OrganizationUserType[OrganizationUserType["User"] = 2] = "User";
|
|
20644
|
+
OrganizationUserType[OrganizationUserType["Manager"] = 3] = "Manager";
|
|
20645
|
+
OrganizationUserType[OrganizationUserType["Custom"] = 4] = "Custom";
|
|
20646
|
+
})(OrganizationUserType || (OrganizationUserType = {}));
|
|
20647
|
+
|
|
20648
|
+
// CONCATENATED MODULE: ./jslib/common/src/services/keyConnector.service.ts
|
|
20649
|
+
var keyConnector_service_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20650
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
20651
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20652
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20653
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20654
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
20655
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20656
|
+
});
|
|
20657
|
+
};
|
|
20658
|
+
|
|
20659
|
+
|
|
20660
|
+
|
|
20661
|
+
|
|
20662
|
+
const keyConnector_service_Keys = {
|
|
20663
|
+
usesKeyConnector: 'usesKeyConnector',
|
|
20664
|
+
convertAccountToKeyConnector: 'convertAccountToKeyConnector',
|
|
20665
|
+
};
|
|
20666
|
+
class keyConnector_service_KeyConnectorService {
|
|
20667
|
+
constructor(storageService, userService, cryptoService, apiService, tokenService, logService) {
|
|
20668
|
+
this.storageService = storageService;
|
|
20669
|
+
this.userService = userService;
|
|
20670
|
+
this.cryptoService = cryptoService;
|
|
20671
|
+
this.apiService = apiService;
|
|
20672
|
+
this.tokenService = tokenService;
|
|
20673
|
+
this.logService = logService;
|
|
20674
|
+
this.usesKeyConnector = null;
|
|
20675
|
+
}
|
|
20676
|
+
setUsesKeyConnector(usesKeyConnector) {
|
|
20677
|
+
this.usesKeyConnector = usesKeyConnector;
|
|
20678
|
+
return this.storageService.save(keyConnector_service_Keys.usesKeyConnector, usesKeyConnector);
|
|
20679
|
+
}
|
|
20680
|
+
getUsesKeyConnector() {
|
|
20681
|
+
var _a;
|
|
20682
|
+
return keyConnector_service_awaiter(this, void 0, void 0, function* () {
|
|
20683
|
+
return (_a = this.usesKeyConnector) !== null && _a !== void 0 ? _a : (this.usesKeyConnector = yield this.storageService.get(keyConnector_service_Keys.usesKeyConnector));
|
|
20684
|
+
});
|
|
20685
|
+
}
|
|
20686
|
+
userNeedsMigration() {
|
|
20687
|
+
return keyConnector_service_awaiter(this, void 0, void 0, function* () {
|
|
20688
|
+
const loggedInUsingSso = this.tokenService.getIsExternal();
|
|
20689
|
+
const requiredByOrganization = (yield this.getManagingOrganization()) != null;
|
|
20690
|
+
const userIsNotUsingKeyConnector = !(yield this.getUsesKeyConnector());
|
|
20691
|
+
return loggedInUsingSso && requiredByOrganization && userIsNotUsingKeyConnector;
|
|
20692
|
+
});
|
|
20693
|
+
}
|
|
20694
|
+
migrateUser() {
|
|
20695
|
+
return keyConnector_service_awaiter(this, void 0, void 0, function* () {
|
|
20696
|
+
const organization = yield this.getManagingOrganization();
|
|
20697
|
+
const key = yield this.cryptoService.getKey();
|
|
20698
|
+
try {
|
|
20699
|
+
const keyConnectorRequest = new KeyConnectorUserKeyRequest(key.encKeyB64);
|
|
20700
|
+
yield this.apiService.postUserKeyToKeyConnector(organization.keyConnectorUrl, keyConnectorRequest);
|
|
20701
|
+
}
|
|
20702
|
+
catch (e) {
|
|
20703
|
+
throw new Error('Unable to reach key connector');
|
|
20704
|
+
}
|
|
20705
|
+
yield this.apiService.postConvertToKeyConnector();
|
|
20706
|
+
});
|
|
20707
|
+
}
|
|
20708
|
+
getAndSetKey(url) {
|
|
20709
|
+
return keyConnector_service_awaiter(this, void 0, void 0, function* () {
|
|
20710
|
+
try {
|
|
20711
|
+
const userKeyResponse = yield this.apiService.getUserKeyFromKeyConnector(url);
|
|
20712
|
+
const keyArr = utils_Utils.fromB64ToArray(userKeyResponse.key);
|
|
20713
|
+
const k = new symmetricCryptoKey_SymmetricCryptoKey(keyArr);
|
|
20714
|
+
yield this.cryptoService.setKey(k);
|
|
20715
|
+
}
|
|
20716
|
+
catch (e) {
|
|
20717
|
+
this.logService.error(e);
|
|
20718
|
+
throw new Error('Unable to reach key connector');
|
|
20719
|
+
}
|
|
20720
|
+
});
|
|
20721
|
+
}
|
|
20722
|
+
getManagingOrganization() {
|
|
20723
|
+
return keyConnector_service_awaiter(this, void 0, void 0, function* () {
|
|
20724
|
+
const orgs = yield this.userService.getAllOrganizations();
|
|
20725
|
+
return orgs.find(o => o.keyConnectorEnabled &&
|
|
20726
|
+
o.type !== OrganizationUserType.Admin &&
|
|
20727
|
+
o.type !== OrganizationUserType.Owner &&
|
|
20728
|
+
!o.isProviderUser);
|
|
20729
|
+
});
|
|
20730
|
+
}
|
|
20731
|
+
setConvertAccountRequired(status) {
|
|
20732
|
+
return keyConnector_service_awaiter(this, void 0, void 0, function* () {
|
|
20733
|
+
yield this.storageService.save(keyConnector_service_Keys.convertAccountToKeyConnector, status);
|
|
20734
|
+
});
|
|
20735
|
+
}
|
|
20736
|
+
getConvertAccountRequired() {
|
|
20737
|
+
return keyConnector_service_awaiter(this, void 0, void 0, function* () {
|
|
20738
|
+
return yield this.storageService.get(keyConnector_service_Keys.convertAccountToKeyConnector);
|
|
20739
|
+
});
|
|
20740
|
+
}
|
|
20741
|
+
removeConvertAccountRequired() {
|
|
20742
|
+
return keyConnector_service_awaiter(this, void 0, void 0, function* () {
|
|
20743
|
+
yield this.storageService.remove(keyConnector_service_Keys.convertAccountToKeyConnector);
|
|
20744
|
+
});
|
|
20745
|
+
}
|
|
20746
|
+
clear() {
|
|
20747
|
+
return keyConnector_service_awaiter(this, void 0, void 0, function* () {
|
|
20748
|
+
yield this.removeConvertAccountRequired();
|
|
20749
|
+
});
|
|
20750
|
+
}
|
|
20751
|
+
}
|
|
20752
|
+
|
|
20261
20753
|
// CONCATENATED MODULE: ./jslib/common/src/services/noopMessaging.service.ts
|
|
20262
20754
|
class NoopMessagingService {
|
|
20263
20755
|
send(subscriber, arg = {}) {
|
|
@@ -20887,16 +21379,6 @@ var OrganizationUserStatusType;
|
|
|
20887
21379
|
OrganizationUserStatusType[OrganizationUserStatusType["Confirmed"] = 2] = "Confirmed";
|
|
20888
21380
|
})(OrganizationUserStatusType || (OrganizationUserStatusType = {}));
|
|
20889
21381
|
|
|
20890
|
-
// CONCATENATED MODULE: ./jslib/common/src/enums/organizationUserType.ts
|
|
20891
|
-
var OrganizationUserType;
|
|
20892
|
-
(function (OrganizationUserType) {
|
|
20893
|
-
OrganizationUserType[OrganizationUserType["Owner"] = 0] = "Owner";
|
|
20894
|
-
OrganizationUserType[OrganizationUserType["Admin"] = 1] = "Admin";
|
|
20895
|
-
OrganizationUserType[OrganizationUserType["User"] = 2] = "User";
|
|
20896
|
-
OrganizationUserType[OrganizationUserType["Manager"] = 3] = "Manager";
|
|
20897
|
-
OrganizationUserType[OrganizationUserType["Custom"] = 4] = "Custom";
|
|
20898
|
-
})(OrganizationUserType || (OrganizationUserType = {}));
|
|
20899
|
-
|
|
20900
21382
|
// CONCATENATED MODULE: ./jslib/common/src/services/policy.service.ts
|
|
20901
21383
|
var policy_service_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
20902
21384
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -21204,7 +21686,9 @@ class search_service_SearchService {
|
|
|
21204
21686
|
try {
|
|
21205
21687
|
searchResults = index.search(query.substr(1).trim());
|
|
21206
21688
|
}
|
|
21207
|
-
catch (
|
|
21689
|
+
catch (e) {
|
|
21690
|
+
this.logService.error(e);
|
|
21691
|
+
}
|
|
21208
21692
|
}
|
|
21209
21693
|
else {
|
|
21210
21694
|
// tslint:disable-next-line
|
|
@@ -21495,7 +21979,9 @@ class SendFileView {
|
|
|
21495
21979
|
return parseInt(this.size, null);
|
|
21496
21980
|
}
|
|
21497
21981
|
}
|
|
21498
|
-
catch (_a) {
|
|
21982
|
+
catch (_a) {
|
|
21983
|
+
// Invalid file size.
|
|
21984
|
+
}
|
|
21499
21985
|
return 0;
|
|
21500
21986
|
}
|
|
21501
21987
|
}
|
|
@@ -22079,6 +22565,7 @@ class OrganizationData {
|
|
|
22079
22565
|
this.use2fa = response.use2fa;
|
|
22080
22566
|
this.useApi = response.useApi;
|
|
22081
22567
|
this.useSso = response.useSso;
|
|
22568
|
+
this.useKeyConnector = response.useKeyConnector;
|
|
22082
22569
|
this.useResetPassword = response.useResetPassword;
|
|
22083
22570
|
this.selfHost = response.selfHost;
|
|
22084
22571
|
this.usersGetPremium = response.usersGetPremium;
|
|
@@ -22093,6 +22580,11 @@ class OrganizationData {
|
|
|
22093
22580
|
this.hasPublicAndPrivateKeys = response.hasPublicAndPrivateKeys;
|
|
22094
22581
|
this.providerId = response.providerId;
|
|
22095
22582
|
this.providerName = response.providerName;
|
|
22583
|
+
this.familySponsorshipFriendlyName = response.familySponsorshipFriendlyName;
|
|
22584
|
+
this.familySponsorshipAvailable = response.familySponsorshipAvailable;
|
|
22585
|
+
this.planProductType = response.planProductType;
|
|
22586
|
+
this.keyConnectorEnabled = response.keyConnectorEnabled;
|
|
22587
|
+
this.keyConnectorUrl = response.keyConnectorUrl;
|
|
22096
22588
|
}
|
|
22097
22589
|
}
|
|
22098
22590
|
|
|
@@ -22130,7 +22622,7 @@ const sync_service_Keys = {
|
|
|
22130
22622
|
lastSyncPrefix: 'lastSync_',
|
|
22131
22623
|
};
|
|
22132
22624
|
class sync_service_SyncService {
|
|
22133
|
-
constructor(userService, apiService, settingsService, folderService, cipherService, cryptoService, collectionService, storageService, messagingService, policyService, sendService, logoutCallback) {
|
|
22625
|
+
constructor(userService, apiService, settingsService, folderService, cipherService, cryptoService, collectionService, storageService, messagingService, policyService, sendService, logService, tokenService, keyConnectorService, logoutCallback) {
|
|
22134
22626
|
this.userService = userService;
|
|
22135
22627
|
this.apiService = apiService;
|
|
22136
22628
|
this.settingsService = settingsService;
|
|
@@ -22142,6 +22634,9 @@ class sync_service_SyncService {
|
|
|
22142
22634
|
this.messagingService = messagingService;
|
|
22143
22635
|
this.policyService = policyService;
|
|
22144
22636
|
this.sendService = sendService;
|
|
22637
|
+
this.logService = logService;
|
|
22638
|
+
this.tokenService = tokenService;
|
|
22639
|
+
this.keyConnectorService = keyConnectorService;
|
|
22145
22640
|
this.logoutCallback = logoutCallback;
|
|
22146
22641
|
this.syncInProgress = false;
|
|
22147
22642
|
}
|
|
@@ -22229,7 +22724,9 @@ class sync_service_SyncService {
|
|
|
22229
22724
|
}
|
|
22230
22725
|
}
|
|
22231
22726
|
}
|
|
22232
|
-
catch (
|
|
22727
|
+
catch (e) {
|
|
22728
|
+
this.logService.error(e);
|
|
22729
|
+
}
|
|
22233
22730
|
}
|
|
22234
22731
|
return this.syncCompleted(false);
|
|
22235
22732
|
});
|
|
@@ -22333,7 +22830,9 @@ class sync_service_SyncService {
|
|
|
22333
22830
|
}
|
|
22334
22831
|
}
|
|
22335
22832
|
}
|
|
22336
|
-
catch (
|
|
22833
|
+
catch (e) {
|
|
22834
|
+
this.logService.error(e);
|
|
22835
|
+
}
|
|
22337
22836
|
}
|
|
22338
22837
|
return this.syncCompleted(false);
|
|
22339
22838
|
});
|
|
@@ -22392,6 +22891,7 @@ class sync_service_SyncService {
|
|
|
22392
22891
|
yield this.userService.setSecurityStamp(response.securityStamp);
|
|
22393
22892
|
yield this.userService.setEmailVerified(response.emailVerified);
|
|
22394
22893
|
yield this.userService.setForcePasswordReset(response.forcePasswordReset);
|
|
22894
|
+
yield this.keyConnectorService.setUsesKeyConnector(response.usesKeyConnector);
|
|
22395
22895
|
const organizations = {};
|
|
22396
22896
|
response.organizations.forEach(o => {
|
|
22397
22897
|
organizations[o.id] = new OrganizationData(o);
|
|
@@ -22406,10 +22906,16 @@ class sync_service_SyncService {
|
|
|
22406
22906
|
organizations[o.id].isProviderUser = true;
|
|
22407
22907
|
}
|
|
22408
22908
|
});
|
|
22409
|
-
|
|
22909
|
+
yield Promise.all([
|
|
22410
22910
|
this.userService.replaceOrganizations(organizations),
|
|
22411
22911
|
this.userService.replaceProviders(providers),
|
|
22412
22912
|
]);
|
|
22913
|
+
if (yield this.keyConnectorService.userNeedsMigration()) {
|
|
22914
|
+
this.messagingService.send('convertAccountToKeyConnector');
|
|
22915
|
+
}
|
|
22916
|
+
else {
|
|
22917
|
+
this.keyConnectorService.removeConvertAccountRequired();
|
|
22918
|
+
}
|
|
22413
22919
|
});
|
|
22414
22920
|
}
|
|
22415
22921
|
syncFolders(userId, response) {
|
|
@@ -22699,6 +23205,13 @@ class token_service_TokenService {
|
|
|
22699
23205
|
}
|
|
22700
23206
|
return decoded.iss;
|
|
22701
23207
|
}
|
|
23208
|
+
getIsExternal() {
|
|
23209
|
+
const decoded = this.decodeToken();
|
|
23210
|
+
if (!Array.isArray(decoded.amr)) {
|
|
23211
|
+
throw new Error('No amr found');
|
|
23212
|
+
}
|
|
23213
|
+
return decoded.amr.includes('external');
|
|
23214
|
+
}
|
|
22702
23215
|
storeTokenValue(key, value) {
|
|
22703
23216
|
return token_service_awaiter(this, void 0, void 0, function* () {
|
|
22704
23217
|
if (yield this.skipTokenStorage()) {
|
|
@@ -22732,9 +23245,10 @@ var totp_service_awaiter = (undefined && undefined.__awaiter) || function (thisA
|
|
|
22732
23245
|
const B32Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
|
|
22733
23246
|
const SteamChars = '23456789BCDFGHJKMNPQRTVWXY';
|
|
22734
23247
|
class totp_service_TotpService {
|
|
22735
|
-
constructor(storageService, cryptoFunctionService) {
|
|
23248
|
+
constructor(storageService, cryptoFunctionService, logService) {
|
|
22736
23249
|
this.storageService = storageService;
|
|
22737
23250
|
this.cryptoFunctionService = cryptoFunctionService;
|
|
23251
|
+
this.logService = logService;
|
|
22738
23252
|
}
|
|
22739
23253
|
getCode(key) {
|
|
22740
23254
|
return totp_service_awaiter(this, void 0, void 0, function* () {
|
|
@@ -22759,7 +23273,9 @@ class totp_service_TotpService {
|
|
|
22759
23273
|
digits = digitParams;
|
|
22760
23274
|
}
|
|
22761
23275
|
}
|
|
22762
|
-
catch (_a) {
|
|
23276
|
+
catch (_a) {
|
|
23277
|
+
this.logService.error('Invalid digits param.');
|
|
23278
|
+
}
|
|
22763
23279
|
}
|
|
22764
23280
|
if (params.has('period') && params.get('period') != null) {
|
|
22765
23281
|
try {
|
|
@@ -22768,7 +23284,9 @@ class totp_service_TotpService {
|
|
|
22768
23284
|
period = periodParam;
|
|
22769
23285
|
}
|
|
22770
23286
|
}
|
|
22771
|
-
catch (_b) {
|
|
23287
|
+
catch (_b) {
|
|
23288
|
+
this.logService.error('Invalid period param.');
|
|
23289
|
+
}
|
|
22772
23290
|
}
|
|
22773
23291
|
if (params.has('secret') && params.get('secret') != null) {
|
|
22774
23292
|
keyB32 = params.get('secret');
|
|
@@ -22824,7 +23342,9 @@ class totp_service_TotpService {
|
|
|
22824
23342
|
try {
|
|
22825
23343
|
period = parseInt(params.get('period').trim(), null);
|
|
22826
23344
|
}
|
|
22827
|
-
catch (_a) {
|
|
23345
|
+
catch (_a) {
|
|
23346
|
+
this.logService.error('Invalid period param.');
|
|
23347
|
+
}
|
|
22828
23348
|
}
|
|
22829
23349
|
}
|
|
22830
23350
|
return period;
|
|
@@ -22901,6 +23421,7 @@ class organization_Organization {
|
|
|
22901
23421
|
this.use2fa = obj.use2fa;
|
|
22902
23422
|
this.useApi = obj.useApi;
|
|
22903
23423
|
this.useSso = obj.useSso;
|
|
23424
|
+
this.useKeyConnector = obj.useKeyConnector;
|
|
22904
23425
|
this.useResetPassword = obj.useResetPassword;
|
|
22905
23426
|
this.selfHost = obj.selfHost;
|
|
22906
23427
|
this.usersGetPremium = obj.usersGetPremium;
|
|
@@ -22916,6 +23437,11 @@ class organization_Organization {
|
|
|
22916
23437
|
this.providerId = obj.providerId;
|
|
22917
23438
|
this.providerName = obj.providerName;
|
|
22918
23439
|
this.isProviderUser = obj.isProviderUser;
|
|
23440
|
+
this.familySponsorshipFriendlyName = obj.familySponsorshipFriendlyName;
|
|
23441
|
+
this.familySponsorshipAvailable = obj.familySponsorshipAvailable;
|
|
23442
|
+
this.planProductType = obj.planProductType;
|
|
23443
|
+
this.keyConnectorEnabled = obj.keyConnectorEnabled;
|
|
23444
|
+
this.keyConnectorUrl = obj.keyConnectorUrl;
|
|
22919
23445
|
}
|
|
22920
23446
|
get canAccess() {
|
|
22921
23447
|
if (this.type === OrganizationUserType.Owner) {
|
|
@@ -23192,6 +23718,12 @@ class user_service_UserService {
|
|
|
23192
23718
|
return false;
|
|
23193
23719
|
});
|
|
23194
23720
|
}
|
|
23721
|
+
canManageSponsorships() {
|
|
23722
|
+
return user_service_awaiter(this, void 0, void 0, function* () {
|
|
23723
|
+
const orgs = yield this.getAllOrganizations();
|
|
23724
|
+
return orgs.some(o => o.familySponsorshipAvailable || o.familySponsorshipFriendlyName !== null);
|
|
23725
|
+
});
|
|
23726
|
+
}
|
|
23195
23727
|
getOrganization(id) {
|
|
23196
23728
|
return user_service_awaiter(this, void 0, void 0, function* () {
|
|
23197
23729
|
const userId = yield this.getUserId();
|
|
@@ -23271,6 +23803,98 @@ class user_service_UserService {
|
|
|
23271
23803
|
}
|
|
23272
23804
|
}
|
|
23273
23805
|
|
|
23806
|
+
// CONCATENATED MODULE: ./jslib/common/src/enums/verificationType.ts
|
|
23807
|
+
var VerificationType;
|
|
23808
|
+
(function (VerificationType) {
|
|
23809
|
+
VerificationType[VerificationType["MasterPassword"] = 0] = "MasterPassword";
|
|
23810
|
+
VerificationType[VerificationType["OTP"] = 1] = "OTP";
|
|
23811
|
+
})(VerificationType || (VerificationType = {}));
|
|
23812
|
+
|
|
23813
|
+
// CONCATENATED MODULE: ./jslib/common/src/models/request/account/verifyOTPRequest.ts
|
|
23814
|
+
class VerifyOTPRequest {
|
|
23815
|
+
constructor(OTP) {
|
|
23816
|
+
this.OTP = OTP;
|
|
23817
|
+
}
|
|
23818
|
+
}
|
|
23819
|
+
|
|
23820
|
+
// CONCATENATED MODULE: ./jslib/common/src/models/request/secretVerificationRequest.ts
|
|
23821
|
+
class SecretVerificationRequest {
|
|
23822
|
+
}
|
|
23823
|
+
|
|
23824
|
+
// CONCATENATED MODULE: ./jslib/common/src/services/userVerification.service.ts
|
|
23825
|
+
var userVerification_service_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
23826
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
23827
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
23828
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
23829
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
23830
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23831
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23832
|
+
});
|
|
23833
|
+
};
|
|
23834
|
+
|
|
23835
|
+
|
|
23836
|
+
|
|
23837
|
+
class userVerification_service_UserVerificationService {
|
|
23838
|
+
constructor(cryptoService, i18nService, apiService) {
|
|
23839
|
+
this.cryptoService = cryptoService;
|
|
23840
|
+
this.i18nService = i18nService;
|
|
23841
|
+
this.apiService = apiService;
|
|
23842
|
+
}
|
|
23843
|
+
buildRequest(verification, requestClass, alreadyHashed) {
|
|
23844
|
+
return userVerification_service_awaiter(this, void 0, void 0, function* () {
|
|
23845
|
+
this.validateInput(verification);
|
|
23846
|
+
const request = requestClass != null
|
|
23847
|
+
? new requestClass()
|
|
23848
|
+
: new SecretVerificationRequest();
|
|
23849
|
+
if (verification.type === VerificationType.OTP) {
|
|
23850
|
+
request.otp = verification.secret;
|
|
23851
|
+
}
|
|
23852
|
+
else {
|
|
23853
|
+
request.masterPasswordHash = alreadyHashed
|
|
23854
|
+
? verification.secret
|
|
23855
|
+
: yield this.cryptoService.hashPassword(verification.secret, null);
|
|
23856
|
+
}
|
|
23857
|
+
return request;
|
|
23858
|
+
});
|
|
23859
|
+
}
|
|
23860
|
+
verifyUser(verification) {
|
|
23861
|
+
return userVerification_service_awaiter(this, void 0, void 0, function* () {
|
|
23862
|
+
this.validateInput(verification);
|
|
23863
|
+
if (verification.type === VerificationType.OTP) {
|
|
23864
|
+
const request = new VerifyOTPRequest(verification.secret);
|
|
23865
|
+
try {
|
|
23866
|
+
yield this.apiService.postAccountVerifyOTP(request);
|
|
23867
|
+
}
|
|
23868
|
+
catch (e) {
|
|
23869
|
+
throw new Error(this.i18nService.t('invalidVerificationCode'));
|
|
23870
|
+
}
|
|
23871
|
+
}
|
|
23872
|
+
else {
|
|
23873
|
+
const passwordValid = yield this.cryptoService.compareAndUpdateKeyHash(verification.secret, null);
|
|
23874
|
+
if (!passwordValid) {
|
|
23875
|
+
throw new Error(this.i18nService.t('invalidMasterPassword'));
|
|
23876
|
+
}
|
|
23877
|
+
}
|
|
23878
|
+
return true;
|
|
23879
|
+
});
|
|
23880
|
+
}
|
|
23881
|
+
requestOTP() {
|
|
23882
|
+
return userVerification_service_awaiter(this, void 0, void 0, function* () {
|
|
23883
|
+
yield this.apiService.postAccountRequestOTP();
|
|
23884
|
+
});
|
|
23885
|
+
}
|
|
23886
|
+
validateInput(verification) {
|
|
23887
|
+
if ((verification === null || verification === void 0 ? void 0 : verification.secret) == null || verification.secret === '') {
|
|
23888
|
+
if (verification.type === VerificationType.OTP) {
|
|
23889
|
+
throw new Error(this.i18nService.t('verificationCodeRequired'));
|
|
23890
|
+
}
|
|
23891
|
+
else {
|
|
23892
|
+
throw new Error(this.i18nService.t('masterPassRequired'));
|
|
23893
|
+
}
|
|
23894
|
+
}
|
|
23895
|
+
}
|
|
23896
|
+
}
|
|
23897
|
+
|
|
23274
23898
|
// CONCATENATED MODULE: ./jslib/common/src/services/vaultTimeout.service.ts
|
|
23275
23899
|
var vaultTimeout_service_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
23276
23900
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -23284,7 +23908,7 @@ var vaultTimeout_service_awaiter = (undefined && undefined.__awaiter) || functio
|
|
|
23284
23908
|
|
|
23285
23909
|
|
|
23286
23910
|
class vaultTimeout_service_VaultTimeoutService {
|
|
23287
|
-
constructor(cipherService, folderService, collectionService, cryptoService, platformUtilsService, storageService, messagingService, searchService, userService, tokenService, policyService, lockedCallback = null, loggedOutCallback = null) {
|
|
23911
|
+
constructor(cipherService, folderService, collectionService, cryptoService, platformUtilsService, storageService, messagingService, searchService, userService, tokenService, policyService, keyConnectorService, lockedCallback = null, loggedOutCallback = null) {
|
|
23288
23912
|
this.cipherService = cipherService;
|
|
23289
23913
|
this.folderService = folderService;
|
|
23290
23914
|
this.collectionService = collectionService;
|
|
@@ -23296,6 +23920,7 @@ class vaultTimeout_service_VaultTimeoutService {
|
|
|
23296
23920
|
this.userService = userService;
|
|
23297
23921
|
this.tokenService = tokenService;
|
|
23298
23922
|
this.policyService = policyService;
|
|
23923
|
+
this.keyConnectorService = keyConnectorService;
|
|
23299
23924
|
this.lockedCallback = lockedCallback;
|
|
23300
23925
|
this.loggedOutCallback = loggedOutCallback;
|
|
23301
23926
|
this.pinProtectedKey = null;
|
|
@@ -23363,6 +23988,13 @@ class vaultTimeout_service_VaultTimeoutService {
|
|
|
23363
23988
|
if (!authed) {
|
|
23364
23989
|
return;
|
|
23365
23990
|
}
|
|
23991
|
+
if (yield this.keyConnectorService.getUsesKeyConnector()) {
|
|
23992
|
+
const pinSet = yield this.isPinLockSet();
|
|
23993
|
+
const pinLock = (pinSet[0] && this.pinProtectedKey != null) || pinSet[1];
|
|
23994
|
+
if (!pinLock && !(yield this.isBiometricLockSet())) {
|
|
23995
|
+
yield this.logOut();
|
|
23996
|
+
}
|
|
23997
|
+
}
|
|
23366
23998
|
this.biometricLocked = true;
|
|
23367
23999
|
this.everBeenUnlocked = true;
|
|
23368
24000
|
yield this.cryptoService.clearKey(false);
|
|
@@ -23996,6 +24628,8 @@ class identityTokenResponse_IdentityTokenResponse extends BaseResponse {
|
|
|
23996
24628
|
this.kdf = this.getResponseProperty('Kdf');
|
|
23997
24629
|
this.kdfIterations = this.getResponseProperty('KdfIterations');
|
|
23998
24630
|
this.forcePasswordReset = this.getResponseProperty('ForcePasswordReset');
|
|
24631
|
+
this.apiUseKeyConnector = this.getResponseProperty('ApiUseKeyConnector');
|
|
24632
|
+
this.keyConnectorUrl = this.getResponseProperty('KeyConnectorUrl');
|
|
23999
24633
|
}
|
|
24000
24634
|
}
|
|
24001
24635
|
|
|
@@ -24072,6 +24706,8 @@ class ssoConfigApi_SsoConfigApi extends BaseResponse {
|
|
|
24072
24706
|
return;
|
|
24073
24707
|
}
|
|
24074
24708
|
this.configType = this.getResponseProperty('ConfigType');
|
|
24709
|
+
this.keyConnectorEnabled = this.getResponseProperty('KeyConnectorEnabled');
|
|
24710
|
+
this.keyConnectorUrl = this.getResponseProperty('KeyConnectorUrl');
|
|
24075
24711
|
this.authority = this.getResponseProperty('Authority');
|
|
24076
24712
|
this.clientId = this.getResponseProperty('ClientId');
|
|
24077
24713
|
this.clientSecret = this.getResponseProperty('ClientSecret');
|
|
@@ -24278,6 +24914,7 @@ class subscriptionResponse_BillingSubscriptionItemResponse extends BaseResponse
|
|
|
24278
24914
|
this.amount = this.getResponseProperty('Amount');
|
|
24279
24915
|
this.quantity = this.getResponseProperty('Quantity');
|
|
24280
24916
|
this.interval = this.getResponseProperty('Interval');
|
|
24917
|
+
this.sponsoredSubscriptionItem = this.getResponseProperty('SponsoredSubscriptionItem');
|
|
24281
24918
|
}
|
|
24282
24919
|
}
|
|
24283
24920
|
class subscriptionResponse_BillingSubscriptionUpcomingInvoiceResponse extends BaseResponse {
|
|
@@ -24372,10 +25009,12 @@ class organizationUserResponse_OrganizationUserResponse extends BaseResponse {
|
|
|
24372
25009
|
}
|
|
24373
25010
|
class OrganizationUserUserDetailsResponse extends organizationUserResponse_OrganizationUserResponse {
|
|
24374
25011
|
constructor(response) {
|
|
25012
|
+
var _a;
|
|
24375
25013
|
super(response);
|
|
24376
25014
|
this.name = this.getResponseProperty('Name');
|
|
24377
25015
|
this.email = this.getResponseProperty('Email');
|
|
24378
25016
|
this.twoFactorEnabled = this.getResponseProperty('TwoFactorEnabled');
|
|
25017
|
+
this.usesKeyConnector = (_a = this.getResponseProperty('UsesKeyConnector')) !== null && _a !== void 0 ? _a : false;
|
|
24379
25018
|
}
|
|
24380
25019
|
}
|
|
24381
25020
|
class organizationUserResponse_OrganizationUserDetailsResponse extends organizationUserResponse_OrganizationUserResponse {
|
|
@@ -24403,6 +25042,7 @@ class organizationUserResponse_OrganizationUserResetPasswordDetailsReponse exten
|
|
|
24403
25042
|
|
|
24404
25043
|
class profileOrganizationResponse_ProfileOrganizationResponse extends BaseResponse {
|
|
24405
25044
|
constructor(response) {
|
|
25045
|
+
var _a, _b;
|
|
24406
25046
|
super(response);
|
|
24407
25047
|
this.id = this.getResponseProperty('Id');
|
|
24408
25048
|
this.name = this.getResponseProperty('Name');
|
|
@@ -24414,6 +25054,7 @@ class profileOrganizationResponse_ProfileOrganizationResponse extends BaseRespon
|
|
|
24414
25054
|
this.use2fa = this.getResponseProperty('Use2fa');
|
|
24415
25055
|
this.useApi = this.getResponseProperty('UseApi');
|
|
24416
25056
|
this.useSso = this.getResponseProperty('UseSso');
|
|
25057
|
+
this.useKeyConnector = (_a = this.getResponseProperty('UseKeyConnector')) !== null && _a !== void 0 ? _a : false;
|
|
24417
25058
|
this.useResetPassword = this.getResponseProperty('UseResetPassword');
|
|
24418
25059
|
this.selfHost = this.getResponseProperty('SelfHost');
|
|
24419
25060
|
this.usersGetPremium = this.getResponseProperty('UsersGetPremium');
|
|
@@ -24432,43 +25073,20 @@ class profileOrganizationResponse_ProfileOrganizationResponse extends BaseRespon
|
|
|
24432
25073
|
this.userId = this.getResponseProperty('UserId');
|
|
24433
25074
|
this.providerId = this.getResponseProperty('ProviderId');
|
|
24434
25075
|
this.providerName = this.getResponseProperty('ProviderName');
|
|
25076
|
+
this.familySponsorshipFriendlyName = this.getResponseProperty('FamilySponsorshipFriendlyName');
|
|
25077
|
+
this.familySponsorshipAvailable = this.getResponseProperty('FamilySponsorshipAvailable');
|
|
25078
|
+
this.planProductType = this.getResponseProperty('PlanProductType');
|
|
25079
|
+
this.keyConnectorEnabled = (_b = this.getResponseProperty('KeyConnectorEnabled')) !== null && _b !== void 0 ? _b : false;
|
|
25080
|
+
this.keyConnectorUrl = this.getResponseProperty('KeyConnectorUrl');
|
|
24435
25081
|
}
|
|
24436
25082
|
}
|
|
24437
25083
|
|
|
24438
25084
|
// CONCATENATED MODULE: ./jslib/common/src/models/response/profileProviderOrganizationResponse.ts
|
|
24439
25085
|
|
|
24440
|
-
|
|
24441
|
-
class profileProviderOrganizationResponse_ProfileProviderOrganizationResponse extends BaseResponse {
|
|
25086
|
+
class profileProviderOrganizationResponse_ProfileProviderOrganizationResponse extends profileOrganizationResponse_ProfileOrganizationResponse {
|
|
24442
25087
|
constructor(response) {
|
|
24443
25088
|
super(response);
|
|
24444
|
-
this.
|
|
24445
|
-
this.name = this.getResponseProperty('Name');
|
|
24446
|
-
this.usePolicies = this.getResponseProperty('UsePolicies');
|
|
24447
|
-
this.useGroups = this.getResponseProperty('UseGroups');
|
|
24448
|
-
this.useDirectory = this.getResponseProperty('UseDirectory');
|
|
24449
|
-
this.useEvents = this.getResponseProperty('UseEvents');
|
|
24450
|
-
this.useTotp = this.getResponseProperty('UseTotp');
|
|
24451
|
-
this.use2fa = this.getResponseProperty('Use2fa');
|
|
24452
|
-
this.useApi = this.getResponseProperty('UseApi');
|
|
24453
|
-
this.useSso = this.getResponseProperty('UseSso');
|
|
24454
|
-
this.useResetPassword = this.getResponseProperty('UseResetPassword');
|
|
24455
|
-
this.selfHost = this.getResponseProperty('SelfHost');
|
|
24456
|
-
this.usersGetPremium = this.getResponseProperty('UsersGetPremium');
|
|
24457
|
-
this.seats = this.getResponseProperty('Seats');
|
|
24458
|
-
this.maxCollections = this.getResponseProperty('MaxCollections');
|
|
24459
|
-
this.maxStorageGb = this.getResponseProperty('MaxStorageGb');
|
|
24460
|
-
this.key = this.getResponseProperty('Key');
|
|
24461
|
-
this.hasPublicAndPrivateKeys = this.getResponseProperty('HasPublicAndPrivateKeys');
|
|
24462
|
-
this.status = this.getResponseProperty('Status');
|
|
24463
|
-
this.type = this.getResponseProperty('Type');
|
|
24464
|
-
this.enabled = this.getResponseProperty('Enabled');
|
|
24465
|
-
this.ssoBound = this.getResponseProperty('SsoBound');
|
|
24466
|
-
this.identifier = this.getResponseProperty('Identifier');
|
|
24467
|
-
this.permissions = new permissionsApi_PermissionsApi(this.getResponseProperty('permissions'));
|
|
24468
|
-
this.resetPasswordEnrolled = this.getResponseProperty('ResetPasswordEnrolled');
|
|
24469
|
-
this.userId = this.getResponseProperty('UserId');
|
|
24470
|
-
this.providerId = this.getResponseProperty('ProviderId');
|
|
24471
|
-
this.providerName = this.getResponseProperty('ProviderName');
|
|
25089
|
+
this.keyConnectorEnabled = false;
|
|
24472
25090
|
}
|
|
24473
25091
|
}
|
|
24474
25092
|
|
|
@@ -24497,7 +25115,7 @@ class profileProviderResponse_ProfileProviderResponse extends BaseResponse {
|
|
|
24497
25115
|
|
|
24498
25116
|
class profileResponse_ProfileResponse extends BaseResponse {
|
|
24499
25117
|
constructor(response) {
|
|
24500
|
-
var _a;
|
|
25118
|
+
var _a, _b;
|
|
24501
25119
|
super(response);
|
|
24502
25120
|
this.organizations = [];
|
|
24503
25121
|
this.providers = [];
|
|
@@ -24514,6 +25132,7 @@ class profileResponse_ProfileResponse extends BaseResponse {
|
|
|
24514
25132
|
this.privateKey = this.getResponseProperty('PrivateKey');
|
|
24515
25133
|
this.securityStamp = this.getResponseProperty('SecurityStamp');
|
|
24516
25134
|
this.forcePasswordReset = (_a = this.getResponseProperty('ForcePasswordReset')) !== null && _a !== void 0 ? _a : false;
|
|
25135
|
+
this.usesKeyConnector = (_b = this.getResponseProperty('UsesKeyConnector')) !== null && _b !== void 0 ? _b : false;
|
|
24517
25136
|
const organizations = this.getResponseProperty('Organizations');
|
|
24518
25137
|
if (organizations != null) {
|
|
24519
25138
|
this.organizations = organizations.map((o) => new profileOrganizationResponse_ProfileOrganizationResponse(o));
|
|
@@ -24909,6 +25528,15 @@ class userKeyResponse_UserKeyResponse extends BaseResponse {
|
|
|
24909
25528
|
}
|
|
24910
25529
|
}
|
|
24911
25530
|
|
|
25531
|
+
// CONCATENATED MODULE: ./jslib/common/src/models/response/keyConnectorUserKeyResponse.ts
|
|
25532
|
+
|
|
25533
|
+
class keyConnectorUserKeyResponse_KeyConnectorUserKeyResponse extends BaseResponse {
|
|
25534
|
+
constructor(response) {
|
|
25535
|
+
super(response);
|
|
25536
|
+
this.key = this.getResponseProperty('Key');
|
|
25537
|
+
}
|
|
25538
|
+
}
|
|
25539
|
+
|
|
24912
25540
|
// CONCATENATED MODULE: ./jslib/common/src/services/api.service.ts
|
|
24913
25541
|
var api_service_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
24914
25542
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -24972,6 +25600,7 @@ var api_service_awaiter = (undefined && undefined.__awaiter) || function (thisAr
|
|
|
24972
25600
|
|
|
24973
25601
|
|
|
24974
25602
|
|
|
25603
|
+
|
|
24975
25604
|
|
|
24976
25605
|
|
|
24977
25606
|
class api_service_ApiService {
|
|
@@ -25095,6 +25724,9 @@ class api_service_ApiService {
|
|
|
25095
25724
|
setPassword(request) {
|
|
25096
25725
|
return this.send('POST', '/accounts/set-password', request, true, false);
|
|
25097
25726
|
}
|
|
25727
|
+
postSetKeyConnectorKey(request) {
|
|
25728
|
+
return this.send('POST', '/accounts/set-key-connector-key', request, true, false);
|
|
25729
|
+
}
|
|
25098
25730
|
postSecurityStamp(request) {
|
|
25099
25731
|
return this.send('POST', '/accounts/security-stamp', request, true, false);
|
|
25100
25732
|
}
|
|
@@ -25191,6 +25823,15 @@ class api_service_ApiService {
|
|
|
25191
25823
|
putUpdateTempPassword(request) {
|
|
25192
25824
|
return this.send('PUT', '/accounts/update-temp-password', request, true, false);
|
|
25193
25825
|
}
|
|
25826
|
+
postAccountRequestOTP() {
|
|
25827
|
+
return this.send('POST', '/accounts/request-otp', null, true, false);
|
|
25828
|
+
}
|
|
25829
|
+
postAccountVerifyOTP(request) {
|
|
25830
|
+
return this.send('POST', '/accounts/verify-otp', request, true, false);
|
|
25831
|
+
}
|
|
25832
|
+
postConvertToKeyConnector() {
|
|
25833
|
+
return this.send('POST', '/accounts/convert-to-key-connector', null, true, false);
|
|
25834
|
+
}
|
|
25194
25835
|
// Folder APIs
|
|
25195
25836
|
getFolder(id) {
|
|
25196
25837
|
return api_service_awaiter(this, void 0, void 0, function* () {
|
|
@@ -26231,6 +26872,60 @@ class api_service_ApiService {
|
|
|
26231
26872
|
return r;
|
|
26232
26873
|
});
|
|
26233
26874
|
}
|
|
26875
|
+
// Key Connector
|
|
26876
|
+
getUserKeyFromKeyConnector(keyConnectorUrl) {
|
|
26877
|
+
return api_service_awaiter(this, void 0, void 0, function* () {
|
|
26878
|
+
const authHeader = yield this.getActiveBearerToken();
|
|
26879
|
+
const response = yield this.fetch(new Request(keyConnectorUrl + '/user-keys', {
|
|
26880
|
+
cache: 'no-store',
|
|
26881
|
+
method: 'GET',
|
|
26882
|
+
headers: new Headers({
|
|
26883
|
+
'Accept': 'application/json',
|
|
26884
|
+
'Authorization': 'Bearer ' + authHeader,
|
|
26885
|
+
}),
|
|
26886
|
+
}));
|
|
26887
|
+
if (response.status !== 200) {
|
|
26888
|
+
const error = yield this.handleError(response, false, true);
|
|
26889
|
+
return Promise.reject(error);
|
|
26890
|
+
}
|
|
26891
|
+
return new keyConnectorUserKeyResponse_KeyConnectorUserKeyResponse(yield response.json());
|
|
26892
|
+
});
|
|
26893
|
+
}
|
|
26894
|
+
postUserKeyToKeyConnector(keyConnectorUrl, request) {
|
|
26895
|
+
return api_service_awaiter(this, void 0, void 0, function* () {
|
|
26896
|
+
const authHeader = yield this.getActiveBearerToken();
|
|
26897
|
+
const response = yield this.fetch(new Request(keyConnectorUrl + '/user-keys', {
|
|
26898
|
+
cache: 'no-store',
|
|
26899
|
+
method: 'POST',
|
|
26900
|
+
headers: new Headers({
|
|
26901
|
+
'Accept': 'application/json',
|
|
26902
|
+
'Authorization': 'Bearer ' + authHeader,
|
|
26903
|
+
'Content-Type': 'application/json; charset=utf-8',
|
|
26904
|
+
}),
|
|
26905
|
+
body: JSON.stringify(request),
|
|
26906
|
+
}));
|
|
26907
|
+
if (response.status !== 200) {
|
|
26908
|
+
const error = yield this.handleError(response, false, true);
|
|
26909
|
+
return Promise.reject(error);
|
|
26910
|
+
}
|
|
26911
|
+
});
|
|
26912
|
+
}
|
|
26913
|
+
getKeyConnectorAlive(keyConnectorUrl) {
|
|
26914
|
+
return api_service_awaiter(this, void 0, void 0, function* () {
|
|
26915
|
+
const response = yield this.fetch(new Request(keyConnectorUrl + '/alive', {
|
|
26916
|
+
cache: 'no-store',
|
|
26917
|
+
method: 'GET',
|
|
26918
|
+
headers: new Headers({
|
|
26919
|
+
'Accept': 'application/json',
|
|
26920
|
+
'Content-Type': 'application/json; charset=utf-8',
|
|
26921
|
+
}),
|
|
26922
|
+
}));
|
|
26923
|
+
if (response.status !== 200) {
|
|
26924
|
+
const error = yield this.handleError(response, false, true);
|
|
26925
|
+
return Promise.reject(error);
|
|
26926
|
+
}
|
|
26927
|
+
});
|
|
26928
|
+
}
|
|
26234
26929
|
// Helpers
|
|
26235
26930
|
getActiveBearerToken() {
|
|
26236
26931
|
return api_service_awaiter(this, void 0, void 0, function* () {
|
|
@@ -26280,6 +26975,31 @@ class api_service_ApiService {
|
|
|
26280
26975
|
}
|
|
26281
26976
|
});
|
|
26282
26977
|
}
|
|
26978
|
+
postCreateSponsorship(sponsoredOrgId, request) {
|
|
26979
|
+
return api_service_awaiter(this, void 0, void 0, function* () {
|
|
26980
|
+
return yield this.send('POST', '/organization/sponsorship/' + sponsoredOrgId + '/families-for-enterprise', request, true, false);
|
|
26981
|
+
});
|
|
26982
|
+
}
|
|
26983
|
+
deleteRevokeSponsorship(sponsoringOrganizationId) {
|
|
26984
|
+
return api_service_awaiter(this, void 0, void 0, function* () {
|
|
26985
|
+
return yield this.send('DELETE', '/organization/sponsorship/' + sponsoringOrganizationId, null, true, false);
|
|
26986
|
+
});
|
|
26987
|
+
}
|
|
26988
|
+
deleteRemoveSponsorship(sponsoringOrgId) {
|
|
26989
|
+
return api_service_awaiter(this, void 0, void 0, function* () {
|
|
26990
|
+
return yield this.send('DELETE', '/organization/sponsorship/sponsored/' + sponsoringOrgId, null, true, false);
|
|
26991
|
+
});
|
|
26992
|
+
}
|
|
26993
|
+
postRedeemSponsorship(sponsorshipToken, request) {
|
|
26994
|
+
return api_service_awaiter(this, void 0, void 0, function* () {
|
|
26995
|
+
return yield this.send('POST', '/organization/sponsorship/redeem?sponsorshipToken=' + encodeURIComponent(sponsorshipToken), request, true, false);
|
|
26996
|
+
});
|
|
26997
|
+
}
|
|
26998
|
+
postResendSponsorshipOffer(sponsoringOrgId) {
|
|
26999
|
+
return api_service_awaiter(this, void 0, void 0, function* () {
|
|
27000
|
+
return yield this.send('POST', '/organization/sponsorship/' + sponsoringOrgId + '/families-for-enterprise/resend', null, true, false);
|
|
27001
|
+
});
|
|
27002
|
+
}
|
|
26283
27003
|
doAuthRefresh() {
|
|
26284
27004
|
return api_service_awaiter(this, void 0, void 0, function* () {
|
|
26285
27005
|
const refreshToken = yield this.tokenService.getRefreshToken();
|
|
@@ -26344,6 +27064,11 @@ class api_service_ApiService {
|
|
|
26344
27064
|
send(method, path, body, authed, hasResponse, apiUrl, alterHeaders) {
|
|
26345
27065
|
return api_service_awaiter(this, void 0, void 0, function* () {
|
|
26346
27066
|
apiUrl = utils_Utils.isNullOrWhitespace(apiUrl) ? this.environmentService.getApiUrl() : apiUrl;
|
|
27067
|
+
const requestUrl = apiUrl + path;
|
|
27068
|
+
// Prevent directory traversal from malicious paths
|
|
27069
|
+
if (new URL(requestUrl).href !== requestUrl) {
|
|
27070
|
+
return Promise.reject('Invalid request url path.');
|
|
27071
|
+
}
|
|
26347
27072
|
const headers = new Headers({
|
|
26348
27073
|
'Device-Type': this.deviceType,
|
|
26349
27074
|
});
|
|
@@ -26381,7 +27106,7 @@ class api_service_ApiService {
|
|
|
26381
27106
|
alterHeaders(headers);
|
|
26382
27107
|
}
|
|
26383
27108
|
requestInit.headers = headers;
|
|
26384
|
-
const response = yield this.fetch(new Request(
|
|
27109
|
+
const response = yield this.fetch(new Request(requestUrl, requestInit));
|
|
26385
27110
|
if (hasResponse && response.status === 200) {
|
|
26386
27111
|
const responseJson = yield response.json();
|
|
26387
27112
|
return responseJson;
|
|
@@ -26826,6 +27551,7 @@ class config_command_ConfigCommand {
|
|
|
26826
27551
|
icons: options.icons || null,
|
|
26827
27552
|
notifications: options.notifications || null,
|
|
26828
27553
|
events: options.events || null,
|
|
27554
|
+
keyConnector: options.keyConnector || null,
|
|
26829
27555
|
});
|
|
26830
27556
|
const res = new MessageResponse('Saved setting `config`.', null);
|
|
26831
27557
|
return Response.success(res);
|
|
@@ -27119,18 +27845,9 @@ var external_http_ = __webpack_require__(23);
|
|
|
27119
27845
|
// EXTERNAL MODULE: external "inquirer"
|
|
27120
27846
|
var external_inquirer_ = __webpack_require__(4);
|
|
27121
27847
|
|
|
27122
|
-
// CONCATENATED MODULE: ./jslib/common/src/models/request/passwordVerificationRequest.ts
|
|
27123
|
-
class PasswordVerificationRequest {
|
|
27124
|
-
}
|
|
27125
|
-
|
|
27126
27848
|
// CONCATENATED MODULE: ./jslib/common/src/models/request/twoFactorEmailRequest.ts
|
|
27127
27849
|
|
|
27128
|
-
class twoFactorEmailRequest_TwoFactorEmailRequest extends
|
|
27129
|
-
constructor(email, masterPasswordHash) {
|
|
27130
|
-
super();
|
|
27131
|
-
this.masterPasswordHash = masterPasswordHash;
|
|
27132
|
-
this.email = email;
|
|
27133
|
-
}
|
|
27850
|
+
class twoFactorEmailRequest_TwoFactorEmailRequest extends SecretVerificationRequest {
|
|
27134
27851
|
}
|
|
27135
27852
|
|
|
27136
27853
|
// CONCATENATED MODULE: ./jslib/common/src/models/request/organizationUserResetPasswordRequest.ts
|
|
@@ -27165,7 +27882,7 @@ var login_command_awaiter = (undefined && undefined.__awaiter) || function (this
|
|
|
27165
27882
|
// tslint:disable-next-line
|
|
27166
27883
|
const login_command_open = __webpack_require__(13);
|
|
27167
27884
|
class login_command_LoginCommand {
|
|
27168
|
-
constructor(authService, apiService, i18nService, environmentService, passwordGenerationService, cryptoFunctionService, platformUtilsService, userService, cryptoService, policyService, clientId, syncService) {
|
|
27885
|
+
constructor(authService, apiService, i18nService, environmentService, passwordGenerationService, cryptoFunctionService, platformUtilsService, userService, cryptoService, policyService, clientId, syncService, keyConnectorService) {
|
|
27169
27886
|
this.authService = authService;
|
|
27170
27887
|
this.apiService = apiService;
|
|
27171
27888
|
this.i18nService = i18nService;
|
|
@@ -27177,6 +27894,7 @@ class login_command_LoginCommand {
|
|
|
27177
27894
|
this.cryptoService = cryptoService;
|
|
27178
27895
|
this.policyService = policyService;
|
|
27179
27896
|
this.syncService = syncService;
|
|
27897
|
+
this.keyConnectorService = keyConnectorService;
|
|
27180
27898
|
this.ssoRedirectUri = null;
|
|
27181
27899
|
this.clientId = clientId;
|
|
27182
27900
|
}
|
|
@@ -27185,6 +27903,7 @@ class login_command_LoginCommand {
|
|
|
27185
27903
|
this.canInteract = process.env.BW_NOINTERACTION !== 'true';
|
|
27186
27904
|
let ssoCodeVerifier = null;
|
|
27187
27905
|
let ssoCode = null;
|
|
27906
|
+
let orgIdentifier = null;
|
|
27188
27907
|
let clientId = null;
|
|
27189
27908
|
let clientSecret = null;
|
|
27190
27909
|
if (options.apikey != null) {
|
|
@@ -27206,7 +27925,9 @@ class login_command_LoginCommand {
|
|
|
27206
27925
|
const codeVerifierHash = yield this.cryptoFunctionService.hash(ssoCodeVerifier, 'sha256');
|
|
27207
27926
|
const codeChallenge = utils_Utils.fromBufferToUrlB64(codeVerifierHash);
|
|
27208
27927
|
try {
|
|
27209
|
-
|
|
27928
|
+
const ssoParams = yield this.openSsoPrompt(codeChallenge, state);
|
|
27929
|
+
ssoCode = ssoParams.ssoCode;
|
|
27930
|
+
orgIdentifier = ssoParams.orgIdentifier;
|
|
27210
27931
|
}
|
|
27211
27932
|
catch (_a) {
|
|
27212
27933
|
return Response.badRequest('Something went wrong. Try again.');
|
|
@@ -27279,7 +28000,7 @@ class login_command_LoginCommand {
|
|
|
27279
28000
|
response = yield this.authService.logInApiKey(clientId, clientSecret);
|
|
27280
28001
|
}
|
|
27281
28002
|
else if (ssoCode != null && ssoCodeVerifier != null) {
|
|
27282
|
-
response = yield this.authService.logInSso(ssoCode, ssoCodeVerifier, this.ssoRedirectUri);
|
|
28003
|
+
response = yield this.authService.logInSso(ssoCode, ssoCodeVerifier, this.ssoRedirectUri, orgIdentifier);
|
|
27283
28004
|
}
|
|
27284
28005
|
else {
|
|
27285
28006
|
response = yield this.authService.logIn(email, password);
|
|
@@ -27346,7 +28067,9 @@ class login_command_LoginCommand {
|
|
|
27346
28067
|
}
|
|
27347
28068
|
if (twoFactorToken == null && response.twoFactorProviders.size > 1 &&
|
|
27348
28069
|
selectedProvider.type === TwoFactorProviderType.Email) {
|
|
27349
|
-
const emailReq = new twoFactorEmailRequest_TwoFactorEmailRequest(
|
|
28070
|
+
const emailReq = new twoFactorEmailRequest_TwoFactorEmailRequest();
|
|
28071
|
+
emailReq.email = this.authService.email;
|
|
28072
|
+
emailReq.masterPasswordHash = this.authService.masterPasswordHash;
|
|
27350
28073
|
yield this.apiService.postTwoFactorEmail(emailReq);
|
|
27351
28074
|
}
|
|
27352
28075
|
if (twoFactorToken == null) {
|
|
@@ -27372,9 +28095,14 @@ class login_command_LoginCommand {
|
|
|
27372
28095
|
return Response.error('In order to log in with SSO from the CLI, you must first log in' +
|
|
27373
28096
|
' through the web vault to set your master password.');
|
|
27374
28097
|
}
|
|
28098
|
+
// Full sync required for the reset password and key connector checks
|
|
28099
|
+
yield this.syncService.fullSync(true);
|
|
28100
|
+
// Handle converting to Key Connector if required
|
|
28101
|
+
if (yield this.keyConnectorService.userNeedsMigration()) {
|
|
28102
|
+
return yield this.migrateToKeyConnector();
|
|
28103
|
+
}
|
|
27375
28104
|
// Handle Updating Temp Password if NOT using an API Key for authentication
|
|
27376
28105
|
if (response.forcePasswordReset && (clientId == null && clientSecret == null)) {
|
|
27377
|
-
yield this.syncService.fullSync(true);
|
|
27378
28106
|
return yield this.updateTempPassword();
|
|
27379
28107
|
}
|
|
27380
28108
|
return yield this.handleSuccessResponse();
|
|
@@ -27484,6 +28212,55 @@ class login_command_LoginCommand {
|
|
|
27484
28212
|
}
|
|
27485
28213
|
return userInput;
|
|
27486
28214
|
}
|
|
28215
|
+
migrateToKeyConnector() {
|
|
28216
|
+
return login_command_awaiter(this, void 0, void 0, function* () {
|
|
28217
|
+
// If no interaction available, alert user to use web vault
|
|
28218
|
+
if (!this.canInteract) {
|
|
28219
|
+
yield this.logout();
|
|
28220
|
+
this.authService.logOut(() => { });
|
|
28221
|
+
return Response.error(new MessageResponse('An organization you are a member of is using Key Connector. ' +
|
|
28222
|
+
'In order to access the vault, you must opt-in to Key Connector now via the web vault. You have been logged out.', null));
|
|
28223
|
+
}
|
|
28224
|
+
const organization = yield this.keyConnectorService.getManagingOrganization();
|
|
28225
|
+
const answer = yield external_inquirer_["createPromptModule"]({ output: process.stderr })({
|
|
28226
|
+
type: 'list',
|
|
28227
|
+
name: 'convert',
|
|
28228
|
+
message: organization.name + ' is using a self-hosted key server. A master password is no longer required to log in for members of this organization. ',
|
|
28229
|
+
choices: [
|
|
28230
|
+
{
|
|
28231
|
+
name: 'Remove master password and log in',
|
|
28232
|
+
value: 'remove',
|
|
28233
|
+
},
|
|
28234
|
+
{
|
|
28235
|
+
name: 'Leave organization and log in',
|
|
28236
|
+
value: 'leave',
|
|
28237
|
+
},
|
|
28238
|
+
{
|
|
28239
|
+
name: 'Exit',
|
|
28240
|
+
value: 'exit',
|
|
28241
|
+
},
|
|
28242
|
+
],
|
|
28243
|
+
});
|
|
28244
|
+
if (answer.convert === 'remove') {
|
|
28245
|
+
yield this.keyConnectorService.migrateUser();
|
|
28246
|
+
// Update environment URL - required for api key login
|
|
28247
|
+
const urls = this.environmentService.getUrls();
|
|
28248
|
+
urls.keyConnector = organization.keyConnectorUrl;
|
|
28249
|
+
yield this.environmentService.setUrls(urls, true);
|
|
28250
|
+
return yield this.handleSuccessResponse();
|
|
28251
|
+
}
|
|
28252
|
+
else if (answer.convert === 'leave') {
|
|
28253
|
+
yield this.apiService.postLeaveOrganization(organization.id);
|
|
28254
|
+
yield this.syncService.fullSync(true);
|
|
28255
|
+
return yield this.handleSuccessResponse();
|
|
28256
|
+
}
|
|
28257
|
+
else {
|
|
28258
|
+
yield this.logout();
|
|
28259
|
+
this.authService.logOut(() => { });
|
|
28260
|
+
return Response.error('You have been logged out.');
|
|
28261
|
+
}
|
|
28262
|
+
});
|
|
28263
|
+
}
|
|
27487
28264
|
apiClientId() {
|
|
27488
28265
|
return login_command_awaiter(this, void 0, void 0, function* () {
|
|
27489
28266
|
let clientId = null;
|
|
@@ -27534,7 +28311,7 @@ class login_command_LoginCommand {
|
|
|
27534
28311
|
};
|
|
27535
28312
|
});
|
|
27536
28313
|
}
|
|
27537
|
-
|
|
28314
|
+
openSsoPrompt(codeChallenge, state) {
|
|
27538
28315
|
return login_command_awaiter(this, void 0, void 0, function* () {
|
|
27539
28316
|
return new Promise((resolve, reject) => {
|
|
27540
28317
|
const callbackServer = external_http_["createServer"]((req, res) => {
|
|
@@ -27542,6 +28319,7 @@ class login_command_LoginCommand {
|
|
|
27542
28319
|
const url = new URL(urlString);
|
|
27543
28320
|
const code = url.searchParams.get('code');
|
|
27544
28321
|
const receivedState = url.searchParams.get('state');
|
|
28322
|
+
const orgIdentifier = this.getOrgIdentifierFromState(receivedState);
|
|
27545
28323
|
res.setHeader('Content-Type', 'text/html');
|
|
27546
28324
|
if (code != null && receivedState != null && this.checkState(receivedState, state)) {
|
|
27547
28325
|
res.writeHead(200);
|
|
@@ -27549,7 +28327,10 @@ class login_command_LoginCommand {
|
|
|
27549
28327
|
'<h1>Successfully authenticated with the Bitwarden CLI</h1>' +
|
|
27550
28328
|
'<p>You may now close this tab and return to the terminal.</p>' +
|
|
27551
28329
|
'</body></html>');
|
|
27552
|
-
callbackServer.close(() => resolve(
|
|
28330
|
+
callbackServer.close(() => resolve({
|
|
28331
|
+
ssoCode: code,
|
|
28332
|
+
orgIdentifier: orgIdentifier,
|
|
28333
|
+
}));
|
|
27553
28334
|
}
|
|
27554
28335
|
else {
|
|
27555
28336
|
res.writeHead(400);
|
|
@@ -27573,7 +28354,9 @@ class login_command_LoginCommand {
|
|
|
27573
28354
|
foundPort = true;
|
|
27574
28355
|
break;
|
|
27575
28356
|
}
|
|
27576
|
-
catch (_a) {
|
|
28357
|
+
catch (_a) {
|
|
28358
|
+
// Ignore error since we run the same command up to 5 times.
|
|
28359
|
+
}
|
|
27577
28360
|
}
|
|
27578
28361
|
if (!foundPort) {
|
|
27579
28362
|
reject();
|
|
@@ -27581,6 +28364,13 @@ class login_command_LoginCommand {
|
|
|
27581
28364
|
});
|
|
27582
28365
|
});
|
|
27583
28366
|
}
|
|
28367
|
+
getOrgIdentifierFromState(state) {
|
|
28368
|
+
if (state === null || state === undefined) {
|
|
28369
|
+
return null;
|
|
28370
|
+
}
|
|
28371
|
+
const stateSplit = state.split('_identifier=');
|
|
28372
|
+
return stateSplit.length > 1 ? stateSplit[1] : null;
|
|
28373
|
+
}
|
|
27584
28374
|
checkState(state, checkState) {
|
|
27585
28375
|
if (state === null || state === undefined) {
|
|
27586
28376
|
return false;
|
|
@@ -27608,8 +28398,8 @@ var commands_login_command_awaiter = (undefined && undefined.__awaiter) || funct
|
|
|
27608
28398
|
|
|
27609
28399
|
|
|
27610
28400
|
class commands_login_command_LoginCommand extends login_command_LoginCommand {
|
|
27611
|
-
constructor(authService, apiService, cryptoFunctionService, syncService, i18nService, environmentService, passwordGenerationService, platformUtilsService, userService, cryptoService, policyService, logoutCallback) {
|
|
27612
|
-
super(authService, apiService, i18nService, environmentService, passwordGenerationService, cryptoFunctionService, platformUtilsService, userService, cryptoService, policyService, 'cli', syncService);
|
|
28401
|
+
constructor(authService, apiService, cryptoFunctionService, syncService, i18nService, environmentService, passwordGenerationService, platformUtilsService, userService, cryptoService, policyService, keyConnectorService, logoutCallback) {
|
|
28402
|
+
super(authService, apiService, i18nService, environmentService, passwordGenerationService, cryptoFunctionService, platformUtilsService, userService, cryptoService, policyService, 'cli', syncService, keyConnectorService);
|
|
27613
28403
|
this.logoutCallback = logoutCallback;
|
|
27614
28404
|
this.logout = this.logoutCallback;
|
|
27615
28405
|
this.validatedParams = () => commands_login_command_awaiter(this, void 0, void 0, function* () {
|
|
@@ -27617,8 +28407,8 @@ class commands_login_command_LoginCommand extends login_command_LoginCommand {
|
|
|
27617
28407
|
process.env.BW_SESSION = utils_Utils.fromBufferToB64(key);
|
|
27618
28408
|
});
|
|
27619
28409
|
this.success = () => commands_login_command_awaiter(this, void 0, void 0, function* () {
|
|
27620
|
-
yield
|
|
27621
|
-
if ((this.options.sso != null || this.options.apikey != null) && this.canInteract) {
|
|
28410
|
+
const usesKeyConnector = yield this.keyConnectorService.getUsesKeyConnector();
|
|
28411
|
+
if ((this.options.sso != null || this.options.apikey != null) && this.canInteract && !usesKeyConnector) {
|
|
27622
28412
|
const res = new MessageResponse('You are logged in!', '\n' +
|
|
27623
28413
|
'To unlock your vault, use the `unlock` command. ex:\n' +
|
|
27624
28414
|
'$ bw unlock');
|
|
@@ -27814,7 +28604,7 @@ class unlock_command_UnlockCommand {
|
|
|
27814
28604
|
}
|
|
27815
28605
|
else {
|
|
27816
28606
|
const serverKeyHash = yield this.cryptoService.hashPassword(password, key, HashPurpose.ServerAuthorization);
|
|
27817
|
-
const request = new
|
|
28607
|
+
const request = new SecretVerificationRequest();
|
|
27818
28608
|
request.masterPasswordHash = serverKeyHash;
|
|
27819
28609
|
try {
|
|
27820
28610
|
yield this.apiService.postAccountVerifyPassword(request);
|
|
@@ -28297,7 +29087,7 @@ class program_Program extends baseProgram_BaseProgram {
|
|
|
28297
29087
|
.action((email, password, options) => program_awaiter(this, void 0, void 0, function* () {
|
|
28298
29088
|
if (!options.check) {
|
|
28299
29089
|
yield this.exitIfAuthed();
|
|
28300
|
-
const command = new commands_login_command_LoginCommand(this.main.authService, this.main.apiService, this.main.cryptoFunctionService, this.main.syncService, this.main.i18nService, this.main.environmentService, this.main.passwordGenerationService, this.main.platformUtilsService, this.main.userService, this.main.cryptoService, this.main.policyService, () => program_awaiter(this, void 0, void 0, function* () { return yield this.main.logout(); }));
|
|
29090
|
+
const command = new commands_login_command_LoginCommand(this.main.authService, this.main.apiService, this.main.cryptoFunctionService, this.main.syncService, this.main.i18nService, this.main.environmentService, this.main.passwordGenerationService, this.main.platformUtilsService, this.main.userService, this.main.cryptoService, this.main.policyService, this.main.keyConnectorService, () => program_awaiter(this, void 0, void 0, function* () { return yield this.main.logout(); }));
|
|
28301
29091
|
const response = yield command.run(email, password, options);
|
|
28302
29092
|
this.processResponse(response);
|
|
28303
29093
|
}
|
|
@@ -28326,6 +29116,13 @@ class program_Program extends baseProgram_BaseProgram {
|
|
|
28326
29116
|
})
|
|
28327
29117
|
.action((cmd) => program_awaiter(this, void 0, void 0, function* () {
|
|
28328
29118
|
yield this.exitIfNotAuthed();
|
|
29119
|
+
if (this.main.keyConnectorService.getUsesKeyConnector()) {
|
|
29120
|
+
const logoutCommand = new logout_command_LogoutCommand(this.main.authService, this.main.i18nService, () => program_awaiter(this, void 0, void 0, function* () { return yield this.main.logout(); }));
|
|
29121
|
+
yield logoutCommand.run();
|
|
29122
|
+
this.processResponse(Response.error('You cannot lock your vault because you are using Key Connector. ' +
|
|
29123
|
+
'To protect your vault, you have been logged out.'), true);
|
|
29124
|
+
return;
|
|
29125
|
+
}
|
|
28329
29126
|
const command = new lock_command_LockCommand(this.main.vaultTimeoutService);
|
|
28330
29127
|
const response = yield command.run(cmd);
|
|
28331
29128
|
this.processResponse(response);
|
|
@@ -28443,6 +29240,7 @@ class program_Program extends baseProgram_BaseProgram {
|
|
|
28443
29240
|
.option('--icons <url>', 'Provides a custom icons service URL that differs from the base URL.')
|
|
28444
29241
|
.option('--notifications <url>', 'Provides a custom notifications URL that differs from the base URL.')
|
|
28445
29242
|
.option('--events <url>', 'Provides a custom events URL that differs from the base URL.')
|
|
29243
|
+
.option('--key-connector <url>', 'Provides the URL for your Key Connector server.')
|
|
28446
29244
|
.on('--help', () => {
|
|
28447
29245
|
writeLn('\n Settings:');
|
|
28448
29246
|
writeLn('');
|
|
@@ -28544,11 +29342,19 @@ class program_Program extends baseProgram_BaseProgram {
|
|
|
28544
29342
|
if (!hasKey) {
|
|
28545
29343
|
const canInteract = process.env.BW_NOINTERACTION !== 'true';
|
|
28546
29344
|
if (canInteract) {
|
|
28547
|
-
const
|
|
28548
|
-
|
|
28549
|
-
|
|
29345
|
+
const usesKeyConnector = yield this.main.keyConnectorService.getUsesKeyConnector();
|
|
29346
|
+
if (usesKeyConnector) {
|
|
29347
|
+
const response = Response.error('Your vault is locked. You must unlock your vault using your session key.\n' +
|
|
29348
|
+
'If you do not have your session key, you can get a new one by logging out and logging in again.');
|
|
28550
29349
|
this.processResponse(response, true);
|
|
28551
29350
|
}
|
|
29351
|
+
else {
|
|
29352
|
+
const command = new unlock_command_UnlockCommand(this.main.cryptoService, this.main.userService, this.main.cryptoFunctionService, this.main.apiService, this.main.logService);
|
|
29353
|
+
const response = yield command.run(null, null);
|
|
29354
|
+
if (!response.success) {
|
|
29355
|
+
this.processResponse(response, true);
|
|
29356
|
+
}
|
|
29357
|
+
}
|
|
28552
29358
|
}
|
|
28553
29359
|
else {
|
|
28554
29360
|
this.processResponse(Response.error('Vault is locked.'), true);
|
|
@@ -30767,11 +31573,13 @@ var export_command_awaiter = (undefined && undefined.__awaiter) || function (thi
|
|
|
30767
31573
|
|
|
30768
31574
|
|
|
30769
31575
|
|
|
31576
|
+
|
|
30770
31577
|
class export_command_ExportCommand {
|
|
30771
|
-
constructor(
|
|
30772
|
-
this.cryptoService = cryptoService;
|
|
31578
|
+
constructor(exportService, policyService, keyConnectorService, userVerificationService) {
|
|
30773
31579
|
this.exportService = exportService;
|
|
30774
31580
|
this.policyService = policyService;
|
|
31581
|
+
this.keyConnectorService = keyConnectorService;
|
|
31582
|
+
this.userVerificationService = userVerificationService;
|
|
30775
31583
|
}
|
|
30776
31584
|
run(password, options) {
|
|
30777
31585
|
return export_command_awaiter(this, void 0, void 0, function* () {
|
|
@@ -30780,39 +31588,34 @@ class export_command_ExportCommand {
|
|
|
30780
31588
|
return Response.badRequest('One or more organization policies prevents you from exporting your personal vault.');
|
|
30781
31589
|
}
|
|
30782
31590
|
const canInteract = process.env.BW_NOINTERACTION !== 'true';
|
|
30783
|
-
if (
|
|
30784
|
-
|
|
30785
|
-
type: 'password',
|
|
30786
|
-
name: 'password',
|
|
30787
|
-
message: 'Master password:',
|
|
30788
|
-
});
|
|
30789
|
-
password = answer.password;
|
|
31591
|
+
if (!canInteract) {
|
|
31592
|
+
return Response.badRequest('User verification is required. Try running this command again in interactive mode.');
|
|
30790
31593
|
}
|
|
30791
|
-
|
|
30792
|
-
|
|
31594
|
+
try {
|
|
31595
|
+
(yield this.keyConnectorService.getUsesKeyConnector())
|
|
31596
|
+
? yield this.verifyOTP()
|
|
31597
|
+
: yield this.verifyMasterPassword(password);
|
|
30793
31598
|
}
|
|
30794
|
-
|
|
30795
|
-
|
|
30796
|
-
if (format !== 'encrypted_json' && format !== 'json') {
|
|
30797
|
-
format = 'csv';
|
|
30798
|
-
}
|
|
30799
|
-
if (options.organizationid != null && !utils_Utils.isGuid(options.organizationid)) {
|
|
30800
|
-
return Response.error('`' + options.organizationid + '` is not a GUID.');
|
|
30801
|
-
}
|
|
30802
|
-
let exportContent = null;
|
|
30803
|
-
try {
|
|
30804
|
-
exportContent = options.organizationid != null ?
|
|
30805
|
-
yield this.exportService.getOrganizationExport(options.organizationid, format) :
|
|
30806
|
-
yield this.exportService.getExport(format);
|
|
30807
|
-
}
|
|
30808
|
-
catch (e) {
|
|
30809
|
-
return Response.error(e);
|
|
30810
|
-
}
|
|
30811
|
-
return yield this.saveFile(exportContent, options, format);
|
|
31599
|
+
catch (e) {
|
|
31600
|
+
return Response.badRequest(e.message);
|
|
30812
31601
|
}
|
|
30813
|
-
|
|
30814
|
-
|
|
31602
|
+
let format = options.format;
|
|
31603
|
+
if (format !== 'encrypted_json' && format !== 'json') {
|
|
31604
|
+
format = 'csv';
|
|
31605
|
+
}
|
|
31606
|
+
if (options.organizationid != null && !utils_Utils.isGuid(options.organizationid)) {
|
|
31607
|
+
return Response.error('`' + options.organizationid + '` is not a GUID.');
|
|
31608
|
+
}
|
|
31609
|
+
let exportContent = null;
|
|
31610
|
+
try {
|
|
31611
|
+
exportContent = options.organizationid != null ?
|
|
31612
|
+
yield this.exportService.getOrganizationExport(options.organizationid, format) :
|
|
31613
|
+
yield this.exportService.getExport(format);
|
|
31614
|
+
}
|
|
31615
|
+
catch (e) {
|
|
31616
|
+
return Response.error(e);
|
|
30815
31617
|
}
|
|
31618
|
+
return yield this.saveFile(exportContent, options, format);
|
|
30816
31619
|
});
|
|
30817
31620
|
}
|
|
30818
31621
|
saveFile(exportContent, options, format) {
|
|
@@ -30838,6 +31641,36 @@ class export_command_ExportCommand {
|
|
|
30838
31641
|
}
|
|
30839
31642
|
return this.exportService.getFileName(prefix, format);
|
|
30840
31643
|
}
|
|
31644
|
+
verifyMasterPassword(password) {
|
|
31645
|
+
return export_command_awaiter(this, void 0, void 0, function* () {
|
|
31646
|
+
if (password == null || password === '') {
|
|
31647
|
+
const answer = yield external_inquirer_["createPromptModule"]({ output: process.stderr })({
|
|
31648
|
+
type: 'password',
|
|
31649
|
+
name: 'password',
|
|
31650
|
+
message: 'Master password:',
|
|
31651
|
+
});
|
|
31652
|
+
password = answer.password;
|
|
31653
|
+
}
|
|
31654
|
+
yield this.userVerificationService.verifyUser({
|
|
31655
|
+
type: VerificationType.MasterPassword,
|
|
31656
|
+
secret: password,
|
|
31657
|
+
});
|
|
31658
|
+
});
|
|
31659
|
+
}
|
|
31660
|
+
verifyOTP() {
|
|
31661
|
+
return export_command_awaiter(this, void 0, void 0, function* () {
|
|
31662
|
+
yield this.userVerificationService.requestOTP();
|
|
31663
|
+
const answer = yield external_inquirer_["createPromptModule"]({ output: process.stderr })({
|
|
31664
|
+
type: 'password',
|
|
31665
|
+
name: 'otp',
|
|
31666
|
+
message: 'A verification code has been emailed to you.\n Verification code:',
|
|
31667
|
+
});
|
|
31668
|
+
yield this.userVerificationService.verifyUser({
|
|
31669
|
+
type: VerificationType.OTP,
|
|
31670
|
+
secret: answer.otp,
|
|
31671
|
+
});
|
|
31672
|
+
});
|
|
31673
|
+
}
|
|
30841
31674
|
}
|
|
30842
31675
|
|
|
30843
31676
|
// CONCATENATED MODULE: ./src/commands/import.command.ts
|
|
@@ -31651,7 +32484,7 @@ class vault_program_VaultProgram extends program_Program {
|
|
|
31651
32484
|
})
|
|
31652
32485
|
.action((password, options) => vault_program_awaiter(this, void 0, void 0, function* () {
|
|
31653
32486
|
yield this.exitIfLocked();
|
|
31654
|
-
const command = new export_command_ExportCommand(this.main.
|
|
32487
|
+
const command = new export_command_ExportCommand(this.main.exportService, this.main.policyService, this.main.keyConnectorService, this.main.userVerificationService);
|
|
31655
32488
|
const response = yield command.run(password, options);
|
|
31656
32489
|
this.processResponse(response);
|
|
31657
32490
|
}));
|
|
@@ -31704,6 +32537,8 @@ var bw_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argum
|
|
|
31704
32537
|
|
|
31705
32538
|
|
|
31706
32539
|
|
|
32540
|
+
|
|
32541
|
+
|
|
31707
32542
|
|
|
31708
32543
|
|
|
31709
32544
|
|
|
@@ -31750,23 +32585,25 @@ class bw_Main {
|
|
|
31750
32585
|
this.containerService = new ContainerService(this.cryptoService);
|
|
31751
32586
|
this.settingsService = new SettingsService(this.userService, this.storageService);
|
|
31752
32587
|
this.fileUploadService = new fileUpload_service_FileUploadService(this.logService, this.apiService);
|
|
31753
|
-
this.cipherService = new cipher_service_CipherService(this.cryptoService, this.userService, this.settingsService, this.apiService, this.fileUploadService, this.storageService, this.i18nService, null);
|
|
32588
|
+
this.cipherService = new cipher_service_CipherService(this.cryptoService, this.userService, this.settingsService, this.apiService, this.fileUploadService, this.storageService, this.i18nService, null, this.logService);
|
|
31754
32589
|
this.folderService = new folder_service_FolderService(this.cryptoService, this.userService, this.apiService, this.storageService, this.i18nService, this.cipherService);
|
|
31755
32590
|
this.collectionService = new collection_service_CollectionService(this.cryptoService, this.userService, this.storageService, this.i18nService);
|
|
31756
32591
|
this.searchService = new search_service_SearchService(this.cipherService, this.logService, this.i18nService);
|
|
31757
32592
|
this.policyService = new policy_service_PolicyService(this.userService, this.storageService, this.apiService);
|
|
31758
32593
|
this.sendService = new send_service_SendService(this.cryptoService, this.userService, this.apiService, this.fileUploadService, this.storageService, this.i18nService, this.cryptoFunctionService);
|
|
31759
|
-
this.
|
|
31760
|
-
this.
|
|
32594
|
+
this.keyConnectorService = new keyConnector_service_KeyConnectorService(this.storageService, this.userService, this.cryptoService, this.apiService, this.tokenService, this.logService);
|
|
32595
|
+
this.vaultTimeoutService = new vaultTimeout_service_VaultTimeoutService(this.cipherService, this.folderService, this.collectionService, this.cryptoService, this.platformUtilsService, this.storageService, this.messagingService, this.searchService, this.userService, this.tokenService, this.policyService, this.keyConnectorService, () => bw_awaiter(this, void 0, void 0, function* () { return yield this.cryptoService.clearStoredKey('auto'); }), null);
|
|
32596
|
+
this.syncService = new sync_service_SyncService(this.userService, this.apiService, this.settingsService, this.folderService, this.cipherService, this.cryptoService, this.collectionService, this.storageService, this.messagingService, this.policyService, this.sendService, this.logService, this.tokenService, this.keyConnectorService, (expired) => bw_awaiter(this, void 0, void 0, function* () { return yield this.logout(); }));
|
|
31761
32597
|
this.passwordGenerationService = new passwordGeneration_service_PasswordGenerationService(this.cryptoService, this.storageService, this.policyService);
|
|
31762
|
-
this.totpService = new totp_service_TotpService(this.storageService, this.cryptoFunctionService);
|
|
32598
|
+
this.totpService = new totp_service_TotpService(this.storageService, this.cryptoFunctionService, this.logService);
|
|
31763
32599
|
this.importService = new import_service_ImportService(this.cipherService, this.folderService, this.apiService, this.i18nService, this.collectionService, this.platformUtilsService, this.cryptoService);
|
|
31764
32600
|
this.exportService = new export_service_ExportService(this.folderService, this.cipherService, this.apiService, this.cryptoService);
|
|
31765
|
-
this.authService = new auth_service_AuthService(this.cryptoService, this.apiService, this.userService, this.tokenService, this.appIdService, this.i18nService, this.platformUtilsService, this.messagingService, this.vaultTimeoutService, this.logService, true);
|
|
32601
|
+
this.authService = new auth_service_AuthService(this.cryptoService, this.apiService, this.userService, this.tokenService, this.appIdService, this.i18nService, this.platformUtilsService, this.messagingService, this.vaultTimeoutService, this.logService, this.cryptoFunctionService, this.environmentService, this.keyConnectorService, true);
|
|
31766
32602
|
this.auditService = new audit_service_AuditService(this.cryptoFunctionService, this.apiService);
|
|
31767
32603
|
this.program = new program_Program(this);
|
|
31768
32604
|
this.vaultProgram = new vault_program_VaultProgram(this);
|
|
31769
32605
|
this.sendProgram = new send_program_SendProgram(this);
|
|
32606
|
+
this.userVerificationService = new userVerification_service_UserVerificationService(this.cryptoService, this.i18nService, this.apiService);
|
|
31770
32607
|
}
|
|
31771
32608
|
run() {
|
|
31772
32609
|
return bw_awaiter(this, void 0, void 0, function* () {
|