cbox-vault
pouchdb-based vault that encrypts/decrypts docs to/from the underlying db.
- replicates the Observable-based API of rx-pouchdb that it wraps, adding support for encryption.
- encryption builds on the robust openpgp library with opgp-service.
- supports hashing of document
_id
fields (see example).
example
debug.enable'example:*,cbox-vault:*,rx-pouchdb:*,id-encoder:*,shuffled-bins:*' // define hash function for securely hashing _id values before storing to db // define random bins for more efficient startkey/endkey search.reducearr.concatbin, // write docs to vault // read docs from vault // search Rob Hubbard tunes write$.forEachdebug'example:write:'.catchdebug'example:write:error:'.thenread$.forEachdebug'example:read:'.catchdebug'example:read:error:'.thensearch$.forEachdebug'example:search:'.catchdebug'example:search:error:'.thendb.destroy.thendebug'example:destroy:done'.catchdebug'example:destroy:error:'
view a live version of this example in the browser console, or by cloning this repository and running the following commands from a terminal:
npm installnpm run example
the files of this example are available in this repository.
API v1.0 stable
ES5
and Typescript
compatible.
coded in Typescript 2
, transpiled to ES5
.
Typescript type definitions of the API can be found here.
CONTRIBUTING
see the contribution guidelines
LICENSE
Copyright 2017 Stéphane M. Catala
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and Limitations under the License.