Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
views: {
receivers: {
map: function(doc) {
if (typeof doc.box !== 'object') return
if (typeof doc.box.receivers !== 'object') return
for (var receiver in doc.box.receivers) {
emit(receiver, null)
}
}.toString(),
reduce: '_count'
}
}
}
exports.transform = require('transform-pouch').transform
exports.box = function(sessionKeyPair, receivers) {
var db = this
var mypermit = permit(sessionKeyPair)
return db
// setup design document
.get(ddoc._id)
.catch(function(err) {
if (err.status === 404) {
return db.put(ddoc)
}
return err
})
const SimpleCryptoJS = require('simple-crypto-js').default
const transform = require('transform-pouch').transform
const cryptor = require('./cryptor')
/**
* pouch function to encrypt and decrypt
* @param {string} password
* @param {Object} [options={}]
* @return {Object | Promise}
*/
function simplecryptor (password, options = {}) {
const db = this
// set default ignore
options.ignore = ['_id', '_rev', '_deleted'].concat(options.ignore)
const simpleCryptoJS = new SimpleCryptoJS(password)
'use strict';
var pbkdf2 = require('native-crypto/pbkdf2');
var randomBytes = require('randombytes');
var configId = '_local/crypto';
var chachaHelper = require('./chacha');
var gcmHelper = require('./gcm');
var defaultDigest = 'sha256';
var defaultIterations = 100000;
var previousIterations = 1000;
var defaultAlgo = 'aes-gcm';
var transform = require('transform-pouch').transform;
var uuid = require('uuid');
function noop(){}
function cryptoInit(password, options) {
var db = this;
var key, cb;
var turnedOff = false;
var ignore = ['_id', '_rev', '_deleted']
if (!options) {
options = {};
}
var algo;
if (password && typeof password === 'object') {
options = password;
password = password.password;
delete options.password;
}