cozy-keys-lib 4.2.1-beta.0 → 4.3.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/package.json
CHANGED
package/src/WebVaultClient.js
CHANGED
|
@@ -14,7 +14,6 @@ import { CipherService } from './@bitwarden/jslib/services/cipher.service'
|
|
|
14
14
|
|
|
15
15
|
import { CollectionService } from './@bitwarden/jslib/services/collection.service'
|
|
16
16
|
import { ContainerService } from './@bitwarden/jslib/services/container.service'
|
|
17
|
-
import { CryptoService } from './@bitwarden/jslib/services/crypto.service'
|
|
18
17
|
import { EnvironmentService } from './@bitwarden/jslib/services/environment.service'
|
|
19
18
|
import { FolderService } from './@bitwarden/jslib/services/folder.service'
|
|
20
19
|
import { I18nService } from './@bitwarden/jslib/services/i18n.service'
|
|
@@ -45,6 +44,7 @@ import { KdfRequest } from './@bitwarden/jslib/models/request/kdfRequest'
|
|
|
45
44
|
import WebPlatformUtilsService from './WebPlatformUtilsService'
|
|
46
45
|
import HtmlStorageService from './HtmlStorageService'
|
|
47
46
|
import MemoryStorageService from './MemoryStorageService'
|
|
47
|
+
import { CryptoService } from './services/crypto.service'
|
|
48
48
|
|
|
49
49
|
import * as CozyUtils from './CozyUtils'
|
|
50
50
|
import logger from './logger'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CryptoService as CryptoServiceBase } from '../@bitwarden/jslib/services/crypto.service'
|
|
2
|
+
|
|
3
|
+
export class CryptoService extends CryptoServiceBase {
|
|
4
|
+
constructor(
|
|
5
|
+
storageService,
|
|
6
|
+
secureStorageService,
|
|
7
|
+
cryptoFunctionService,
|
|
8
|
+
platformUtilService
|
|
9
|
+
) {
|
|
10
|
+
super(
|
|
11
|
+
storageService,
|
|
12
|
+
secureStorageService,
|
|
13
|
+
cryptoFunctionService,
|
|
14
|
+
platformUtilService
|
|
15
|
+
)
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
setOrgKeys(orgs) {
|
|
19
|
+
const validOrgs = orgs.filter(org => org.key !== '')
|
|
20
|
+
|
|
21
|
+
return super.setOrgKeys(validOrgs)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -16,7 +16,6 @@ import { AuthService } from './@bitwarden/jslib/services/auth.service';
|
|
|
16
16
|
import { CipherService } from './@bitwarden/jslib/services/cipher.service';
|
|
17
17
|
import { CollectionService } from './@bitwarden/jslib/services/collection.service';
|
|
18
18
|
import { ContainerService } from './@bitwarden/jslib/services/container.service';
|
|
19
|
-
import { CryptoService } from './@bitwarden/jslib/services/crypto.service';
|
|
20
19
|
import { EnvironmentService } from './@bitwarden/jslib/services/environment.service';
|
|
21
20
|
import { FolderService } from './@bitwarden/jslib/services/folder.service';
|
|
22
21
|
import { I18nService } from './@bitwarden/jslib/services/i18n.service';
|
|
@@ -42,6 +41,7 @@ import { KdfRequest } from './@bitwarden/jslib/models/request/kdfRequest';
|
|
|
42
41
|
import WebPlatformUtilsService from './WebPlatformUtilsService';
|
|
43
42
|
import HtmlStorageService from './HtmlStorageService';
|
|
44
43
|
import MemoryStorageService from './MemoryStorageService';
|
|
44
|
+
import { CryptoService } from './services/crypto.service';
|
|
45
45
|
import * as CozyUtils from './CozyUtils';
|
|
46
46
|
import logger from './logger';
|
|
47
47
|
Utils.init();
|
|
@@ -19,9 +19,27 @@ export var checkShouldUnlock = /*#__PURE__*/function () {
|
|
|
19
19
|
addCheckShouldUnlock = _args.length > 1 && _args[1] !== undefined ? _args[1] : function () {
|
|
20
20
|
return true;
|
|
21
21
|
};
|
|
22
|
-
|
|
22
|
+
_context.next = 3;
|
|
23
|
+
return addCheckShouldUnlock();
|
|
23
24
|
|
|
24
|
-
case
|
|
25
|
+
case 3:
|
|
26
|
+
_context.t0 = _context.sent;
|
|
27
|
+
|
|
28
|
+
if (!_context.t0) {
|
|
29
|
+
_context.next = 8;
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
_context.next = 7;
|
|
34
|
+
return vaultClient.isLocked();
|
|
35
|
+
|
|
36
|
+
case 7:
|
|
37
|
+
_context.t0 = _context.sent;
|
|
38
|
+
|
|
39
|
+
case 8:
|
|
40
|
+
return _context.abrupt("return", _context.t0);
|
|
41
|
+
|
|
42
|
+
case 9:
|
|
25
43
|
case "end":
|
|
26
44
|
return _context.stop();
|
|
27
45
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
+
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _get from "@babel/runtime/helpers/get";
|
|
6
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
+
import { CryptoService as CryptoServiceBase } from '../@bitwarden/jslib/services/crypto.service';
|
|
8
|
+
export var CryptoService = /*#__PURE__*/function (_CryptoServiceBase) {
|
|
9
|
+
_inherits(CryptoService, _CryptoServiceBase);
|
|
10
|
+
|
|
11
|
+
function CryptoService(storageService, secureStorageService, cryptoFunctionService, platformUtilService) {
|
|
12
|
+
_classCallCheck(this, CryptoService);
|
|
13
|
+
|
|
14
|
+
return _possibleConstructorReturn(this, _getPrototypeOf(CryptoService).call(this, storageService, secureStorageService, cryptoFunctionService, platformUtilService));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
_createClass(CryptoService, [{
|
|
18
|
+
key: "setOrgKeys",
|
|
19
|
+
value: function setOrgKeys(orgs) {
|
|
20
|
+
var validOrgs = orgs.filter(function (org) {
|
|
21
|
+
return org.key !== '';
|
|
22
|
+
});
|
|
23
|
+
return _get(_getPrototypeOf(CryptoService.prototype), "setOrgKeys", this).call(this, validOrgs);
|
|
24
|
+
}
|
|
25
|
+
}]);
|
|
26
|
+
|
|
27
|
+
return CryptoService;
|
|
28
|
+
}(CryptoServiceBase);
|