fix keewebhttp

This commit is contained in:
antelle 2017-05-22 00:29:05 +02:00
parent 6abacb5e6e
commit 3d2046260a
2 changed files with 6 additions and 6 deletions

View File

@ -11,7 +11,7 @@
"licence": "MIT",
"url": "https://plugins.keeweb.info/plugins/keewebhttp",
"resources": {
"js": "TBYsEeXIPNOFj+l5A11vpw6L1VotzpzmbYWQqRXO++fD2kevLkzWt0jx7xDxlZ0dRN3VzSxDUYqEHAYSgVn5ts/r6NXIOpPj7V2goR1TiknAymWhK59quEsaApcySO2oVtNo4UjZ3Kk34q2Mwlg2IiH1P5JhdjIb5cnQoN4gpSob0lbgCXnjUlZEPfZpOJ0zNtZpkE86OL1Lf2LrgzmauFXe+ColID4zNIP/6iGpPOnpe6FFqLMEgy5C4lkJ2/S0AHDAs49mzMKRhi+bcoh/PclrZ5hdqgUUIt0MNC1Wg0hxGHlHIpi+ObktARND9xcoMdZunzc/peUa91ZIC7n3Ig=="
"js": "EhaKYdn0BmZ5u0V3PNNlsvTUF1WkL2vFnFS8eYw2VFf672HPnlDTOIO28otTP94IdPiGhSYiQM6q1wuUSBf7GGoqeJfTEXL3ZmcNXU9ahjFoEdTQcKtOdgUBlujvGeuxHLofmPdgnVnD5Jq/626SfSxRt+ujdrEzffHQsaMzDdhXFl48ghWsa0bptHpODCVHd/JUXan6Ad5F8MJ2c2bbKGPpoZlLudpCD+EyrIyV8fZyW7IFUHJmFujZTpjK0ZNVtv6Ama9n7GMUSuTOnMSjhr6a9GLC9kJDnQ0NSG1ufANMmx25OC5OPECQphPWh7OM5WJH2xspgcVgqViHCFpuag=="
},
"publicKey": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0oZB2Kt7AzRFNqf8FuO3C3kepHPAIQYiDPYdQxHcsiaFCwyKVx6K1cE/3vBhb8/2rj+QIIWNfAAuu1Y+2VK90ZBeq6HciukWzQRO/HWhfdy0c7JwDAslmyGI5olj0ZQkNLhkde1MiMxjDPpRhZtdJaryVO5cFJaJESpv3dV6m0qXsaQCluWYOSNfSjP9C8o2zRVjSi3ZQZnZIV5pnk9K2MtlZIPXrN9iJiM5zZ9DTSnqApI6dC9mX4R3LvGN+GTovm9C8Crl+qb106nGRR3LcweicDnPyMtZLa/E0DBpWYxUVLDp6WeLhxoUBr+6+t3Xp9IDnPoANDQXJXD0f1vQxQIDAQAB"
}
}

View File

@ -10,7 +10,7 @@ const AutoTypeFilter = require('auto-type/auto-type-filter');
const Logger = require('util/logger');
const Alerts = require('comp/alerts');
const appModel = AutoType.appModel; // TODO: use AppModel.instance
// const appModel = ...; TODO: use AppModel.instance
const Version = '1.8.4.2';
const KeyPrefix = 'plugin:keewebhttp:key_';
@ -130,7 +130,7 @@ function encrypt(resp, value) {
function verifyRequest(req) {
if (req.Id && !keys[req.Id]) {
keys[req.Id] = appModel.settings.get(KeyPrefix + req.Id);
keys[req.Id] = AutoType.appModel.settings.get(KeyPrefix + req.Id);
}
const decrypted = decrypt(req, req.Verifier);
if (decrypted !== req.Nonce) {
@ -177,7 +177,7 @@ function associate(req) {
});
}).then(() => {
const id = 'KeeWeb_' + new Date().toISOString() + '_' + crypto.randomBytes(16).toString('hex');
appModel.settings.set(KeyPrefix + id, req.Key);
AutoType.appModel.settings.set(KeyPrefix + id, req.Key);
keys[id] = req.Key;
fs.writeFileSync(path.join(__dirname, 'keys.json'), JSON.stringify(keys));
return wrapResponse({
@ -196,7 +196,7 @@ function getLogins(req, config) {
const response = wrapResponse({
RequestType: req.RequestType
}, req.Id);
const filter = new AutoTypeFilter({ url }, appModel);
const filter = new AutoTypeFilter({ url }, AutoType.appModel);
const entries = filter.getEntries();
response.Count = entries.length;
if (!config.onlyCount) {