libves 1.9.9 → 2.0.2
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/README.md +39 -7
- package/libVES.node.js +29 -10
- package/libves-2.0.2.tgz +0 -0
- package/package.json +7 -4
- package/libves-1.9.9.tgz +0 -0
package/README.md
CHANGED
|
@@ -1,15 +1,47 @@
|
|
|
1
1
|
## libVES
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Simple, safe and secure e2e encryption for data at-rest.
|
|
5
|
+
|
|
4
6
|
|
|
5
7
|
https://VESvault.com
|
|
8
|
+
|
|
6
9
|
https://VES.host
|
|
7
10
|
|
|
8
|
-
- Deposit and retrieve encrypted items into VESvault repository using end-to-end encryption
|
|
9
|
-
- Manage asymmetric encryption keys in the VESvault repository using end-to-end encryption
|
|
10
|
-
- [VESrecovery](https://www.vesvault.com/#vault)™ operations: set VESrecovery friends, assist in VESrecovery
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
; Instantiate libVES
|
|
13
|
+
|
|
14
|
+
var VES = new libVES({domain: 'x-myapp'});
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
; Authorize with VES in the same browser window
|
|
18
|
+
|
|
19
|
+
VES.flow(true).then(....)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
; Or, authorize in a popup window
|
|
23
|
+
|
|
24
|
+
VES.delegate().then(....)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
; Store an e2e encrypted value
|
|
28
|
+
|
|
29
|
+
VES.putValue('item-id', 'value')
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
; Store a value and e2e share with other VES accounts
|
|
33
|
+
|
|
34
|
+
VES.putValue('item-id', 'value', [{externalId: 'me@acme.com'}, {externalId: 'user1@acme.com'}, {externalId: 'user2@acme.com'}])
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
; Retrieve a previously stored value
|
|
38
|
+
|
|
39
|
+
VES.getValue('item-id').then(function(value) { .... })
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
See https://demo.ves.world
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
Full API Docs:
|
|
13
46
|
|
|
14
|
-
API Documentation:
|
|
15
47
|
https://ves.host/docs/libVES
|
package/libVES.node.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* \___/ - VESrecovery (TM)
|
|
15
15
|
*
|
|
16
16
|
*
|
|
17
|
-
* (c) 2017 -
|
|
17
|
+
* (c) 2017 - 2022 VESvault Corp
|
|
18
18
|
* Jim Zubov <jz@vesvault.com>
|
|
19
19
|
*
|
|
20
20
|
* GNU General Public License v3
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
*
|
|
28
28
|
* @title libVES
|
|
29
29
|
* @dev A JavaScript end-to-end encryption interface to VESvault REST API
|
|
30
|
-
* @version
|
|
30
|
+
* @version 2.00
|
|
31
31
|
*
|
|
32
32
|
* @dev Official source code: https://github.com/vesvault/libVES
|
|
33
33
|
*
|
|
@@ -349,7 +349,9 @@ libVES.prototype = {
|
|
|
349
349
|
});
|
|
350
350
|
},
|
|
351
351
|
vaultRefToUser: function(ext) {
|
|
352
|
-
|
|
352
|
+
var email = ext.externalId ? ext.externalId.replace(/\!.*/, '') : '';
|
|
353
|
+
if (!email.match(/\@/)) throw {code: 'NotFound', message: 'externalId is not an email for non-existing vault'};
|
|
354
|
+
return new libVES.User({email: email}, self);
|
|
353
355
|
}
|
|
354
356
|
};
|
|
355
357
|
});
|
|
@@ -361,7 +363,7 @@ libVES.prototype = {
|
|
|
361
363
|
return self.prepareExternals([ex]);
|
|
362
364
|
});
|
|
363
365
|
}).catch(function(e) {
|
|
364
|
-
throw new libVES.Error('NotFound','Cannot match externalId for domain:' + ext.domain + ', user:' + user + '. Define libVES.Domain.' + ext.domain + '.userToVaultRef(user) to return a valid reference.',{error: e});
|
|
366
|
+
throw new libVES.Error('NotFound', 'Cannot match externalId for domain:' + ext.domain + ', user:' + user + '. Define libVES.Domain.' + ext.domain + '.userToVaultRef(user) to return a valid reference.',{error: e});
|
|
365
367
|
})).then(function(exts) {
|
|
366
368
|
var vkey = new libVES.VaultKey({externals: exts, creator: self.me()},self);
|
|
367
369
|
return vkey.getId().then(function() {
|
|
@@ -371,7 +373,7 @@ libVES.prototype = {
|
|
|
371
373
|
return Promise.resolve(user || m().then(function(dom) {
|
|
372
374
|
return dom.vaultRefToUser(exts[0]);
|
|
373
375
|
})).catch(function(e) {
|
|
374
|
-
throw new libVES.Error('NotFound','No matching secondary
|
|
376
|
+
throw new libVES.Error('NotFound', 'No matching secondary vault key',{error: e});
|
|
375
377
|
}).then(function(u) {
|
|
376
378
|
return self.me().then(function(me) {
|
|
377
379
|
return Promise.all([me.getId(),u.getId()]).then(function(ids) {
|
|
@@ -551,6 +553,23 @@ libVES.prototype = {
|
|
|
551
553
|
});
|
|
552
554
|
});
|
|
553
555
|
},
|
|
556
|
+
setAnonymousKey: function(veskey, optns) {
|
|
557
|
+
var self = this;
|
|
558
|
+
return this.prepareExternals({externalId: self.externalId}).then(function(ext) {
|
|
559
|
+
if (!veskey) throw new libVES.Error('InvalidValue','VESkey cannot be empty');
|
|
560
|
+
return (new libVES.VaultKey({type: 'secondary', algo: (optns && optns.algo ? optns.algo : self.keyAlgo), externals: ext},self)).generate(veskey, optns).then(function(k) {
|
|
561
|
+
return k.post(undefined, ['encSessionToken'], optns).then(function(post) {
|
|
562
|
+
return k.setField('id', post.id, false).then(function() {
|
|
563
|
+
k.fieldUpdate = {id: true};
|
|
564
|
+
});
|
|
565
|
+
}).catch(function(e) {
|
|
566
|
+
if (!e || e.code != 'Unauthorized') throw e;
|
|
567
|
+
}).then(function() {
|
|
568
|
+
return self.unlock(veskey);
|
|
569
|
+
});
|
|
570
|
+
});
|
|
571
|
+
});
|
|
572
|
+
},
|
|
554
573
|
setShadow: function(usrs,optns) {
|
|
555
574
|
var self = this;
|
|
556
575
|
if (!(usrs instanceof Array)) return Promise.reject(new libVES.Error('InvalidValue', 'usrs must be an array'));
|
|
@@ -2084,7 +2103,7 @@ libVES.VaultItem.prototype = new libVES.Object({
|
|
|
2084
2103
|
apiUri: 'vaultItems',
|
|
2085
2104
|
fieldList: {id: true},
|
|
2086
2105
|
fieldClass: {vaultKey: libVES.VaultKey, file: libVES.File},
|
|
2087
|
-
fieldSets: [{type: true, meta: true},{vaultEntries: {id: true, encData: true, vaultKey: {id: true, type: true, user: {id: true}, algo: true}}},{vaultKey: true, file: true}],
|
|
2106
|
+
fieldSets: [{type: true, meta: true},{vaultEntries: {id: true, encData: true, vaultKey: {id: true, type: true, user: {id: true}, algo: true, externals: {id: true}}}},{vaultKey: true, file: true}],
|
|
2088
2107
|
defaultCipher: 'AES256GCM',
|
|
2089
2108
|
getRaw: function() {
|
|
2090
2109
|
var self = this;
|
|
@@ -3222,13 +3241,13 @@ libVES.Delegate = {
|
|
|
3222
3241
|
return this.popupWindow = window.open(url,this.name,"width=600,height=600,top=100,left=100");
|
|
3223
3242
|
},
|
|
3224
3243
|
retryPopup: function(url,href) {
|
|
3225
|
-
var f = this.retryPopupCalled;
|
|
3226
3244
|
this.retryPopupCalled++;
|
|
3227
|
-
if (
|
|
3228
|
-
else if (this.popupWindow) try {
|
|
3245
|
+
if (this.popupWindow) try {
|
|
3229
3246
|
this.popupWindow.focus();
|
|
3247
|
+
return true;
|
|
3230
3248
|
} catch(e) {}
|
|
3231
|
-
|
|
3249
|
+
this.openPopup(url);
|
|
3250
|
+
return true;
|
|
3232
3251
|
},
|
|
3233
3252
|
listener: function(evnt) {
|
|
3234
3253
|
if (this.popup && evnt.origin == this.matchOrigin) try {
|
package/libves-2.0.2.tgz
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libves",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"description": "Simple, safe and secure end-to-end encryption for data at-rest",
|
|
5
5
|
"main": "libVES.node.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"No test defined\" && exit 1"
|
|
@@ -13,13 +13,16 @@
|
|
|
13
13
|
"keywords": [
|
|
14
14
|
"encryption",
|
|
15
15
|
"VESvault",
|
|
16
|
-
"VES"
|
|
16
|
+
"VES",
|
|
17
|
+
"e2e",
|
|
18
|
+
"at-rest",
|
|
19
|
+
"end-to-end"
|
|
17
20
|
],
|
|
18
21
|
"author": "jz@vesvault.com",
|
|
19
22
|
"license": "GPL-3.0",
|
|
20
23
|
"bugs": {
|
|
21
24
|
"url": "https://github.com/vesvault/libVES/issues"
|
|
22
25
|
},
|
|
23
|
-
"homepage": "https://
|
|
26
|
+
"homepage": "https://ves.host/",
|
|
24
27
|
"readme": "README.md"
|
|
25
28
|
}
|
package/libves-1.9.9.tgz
DELETED
|
Binary file
|