/dwebx-secret-storage

DEPRECATED LEGACY DWEB MODULE

Primary LanguageJavaScriptMIT LicenseMIT

dwebx-secret-storage

Store secret keys for ddrive archives in the user's home directory.

npm travis standard

Install

npm install dwebx-secret-storage

Usage

Return for the secret_key storage in ddrive/ddatabase.

var secretStore = require('dwebx-secret-storage')

var storage = {
  metadata: function (name, opts) {
    if (name === 'secret_key') return secretStore()(name, opts)
    return // other storage
  },
  content: function (name, opts) {
    return // other storage
  }
}

// store secret key in ~/.dwebx/secret_keys
var archive = ddrive(storage)

API

secretStorage([dir])

  • dir: directory to store keys under dir/.dwebx/secret_keys. Defaults to users home directory.

License

MIT