Don't encrypt keys
This commit is contained in:
parent
58f57cca19
commit
0ccc9e4dc2
|
@ -18,8 +18,7 @@ define(function(require) {
|
||||||
};
|
};
|
||||||
CryptoWrappedContext.prototype.get = function(key, callback) {
|
CryptoWrappedContext.prototype.get = function(key, callback) {
|
||||||
var that = this;
|
var that = this;
|
||||||
var encryptedKey = this.encrypt(key);
|
this.context.get(key, function(err, value) {
|
||||||
this.context.get(encryptedKey, function(err, value) {
|
|
||||||
if(err) {
|
if(err) {
|
||||||
callback(err);
|
callback(err);
|
||||||
return;
|
return;
|
||||||
|
@ -31,13 +30,11 @@ define(function(require) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
CryptoWrappedContext.prototype.put = function(key, value, callback) {
|
CryptoWrappedContext.prototype.put = function(key, value, callback) {
|
||||||
var encryptedKey = this.encrypt(key);
|
|
||||||
var encryptedValue = this.encrypt(value);
|
var encryptedValue = this.encrypt(value);
|
||||||
this.context.put(encryptedKey, encryptedValue, callback);
|
this.context.put(key, encryptedValue, callback);
|
||||||
};
|
};
|
||||||
CryptoWrappedContext.prototype.delete = function(key, callback) {
|
CryptoWrappedContext.prototype.delete = function(key, callback) {
|
||||||
var encryptedKey = this.encrypt(key);
|
this.context.delete(key, callback);
|
||||||
this.context.delete(encryptedKey, callback);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Custom formatting for encryption objects <-> strings
|
// Custom formatting for encryption objects <-> strings
|
||||||
|
|
Loading…
Reference in New Issue