1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 07:13:32 +00:00

more services and async callthroughs for vault list/add

This commit is contained in:
Kyle Spearrin
2016-09-04 00:34:24 -04:00
parent 32f4ab4987
commit 8f0a24b1b9
14 changed files with 303 additions and 166 deletions

View File

@@ -1,4 +1,4 @@
var CipherString = function (encryptedString) {
var CipherString = function (encryptedString) {
this.encryptedString = encryptedString;
if (encryptedString) {
@@ -20,20 +20,35 @@
};
}();
var Site = function (obj) {
var cryptoService = chrome.extension.getBackgroundPage().cryptoService;
var Site = function (obj, alreadyEncrypted) {
this.id = obj.id;
this.folderId = obj.folderId;
this.name = cryptoService.encrypt(obj.name);
this.uri = cryptoService.encrypt(obj.uri);
this.username = cryptoService.encrypt(obj.username);
this.password = cryptoService.encrypt(obj.password);
this.notes = cryptoService.encrypt(obj.notes);
if (alreadyEncrypted === true) {
this.name = obj.name;
this.uri = obj.uri;
this.username = obj.username;
this.password = obj.password;
this.notes = obj.notes;
}
else {
this.name = new CipherString(obj.name);
this.uri = new CipherString(obj.uri);
this.username = new CipherString(obj.username);
this.password = new CipherString(obj.password);
this.notes = new CipherString(obj.notes);
}
this.favorite = new obj.favorite;
};
var Folder = function (obj) {
var Folder = function (obj, alreadyEncrypted) {
this.id = obj.id;
this.name = new CipherString(obj.name);
if (alreadyEncrypted === true) {
this.name = obj.name;
}
else {
this.name = new CipherString(obj.name);
}
};